View Single Post
Old 20/06/2017, 03:21 PM   #10
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post Re: Problem with /repair and /accept repair

I tried with this new method:

Code:
dcmd_reparer(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 1)
	{
	new string[128];
	new montant = strval(params);
	new playerid2 = GetPlayerVehicleID(playerid);
	if(sscanf(params, "ud", playerid2, montant)) return SendClientMessage(playerid, -1, "USAGE: /reparer [ID] [montant]");
	{
	if(IsPlayerInAnyVehicle(playerid2))
		{
  		GetPlayerName(playerid, string,sizeof(montant));
  		format(string, sizeof(string), "%s à réparé le véhicule du client pour $%d.",playerid, GivePlayerMoney(playerid, montant));
  		SendClientMessage(playerid, COLOR_ORANGE, string);
 		GetPlayerName(playerid2, string, sizeof(montant));
  		format(string, sizeof(string), "Le mécanicien a réparé votre véhicule pour -$%d.", GivePlayerMoney(playerid2, -montant));
  		SendClientMessage(playerid2, COLOR_ORANGE, string);
  		RepairVehicle(GetPlayerVehicleID(playerid2));
		}
	else return SendClientMessage(playerid, COLOR_RED,"ERREUR: Le client n'est pas dans son véhicule ou vous n'êtes pas mécanicien!");
	}
	if(GetPlayerMoney(playerid2) < montant)
		{
		return SendClientMessage(playerid, COLOR_RED,"ERREUR: Vous n'avez pas asser d'argent sur vous!");
		}
	}
	return 1;
}
tekass is offline   Reply With Quote