View Single Post
Old 06/06/2017, 11:32 PM   #1
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post I need help for /repair and /acceptrepair please

Hi all i would need help for a commands with job mechanic.
Here's how I started (you'll notice I'm new to the script):

Code:
//===============================Reparer======================================//
dcmd_reparer(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 1)
	{
	new string[128];
	new montant = GivePlayerMoney(playerid, montant);
	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), "Vous avez réparé le véhicule de %s pour $%d.", GetPlayerVehicleID(playerid2), 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;
}

Last edited by tekass; 20/06/2017 at 02:11 PM. Reason: New title
tekass is offline   Reply With Quote