12.10.2014, 19:09
Hello
i want make this cmd repair , when he try to repair herself can't..
+rep for help.
Thanks.
i want make this cmd repair , when he try to repair herself can't..
+rep for help.
pawn Код:
CMD:repair(playerid,params[])
{
new userID;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new moneys, string[256];
if(IsPlayerConnected(playerid))
{
if(playerVariables[playerid][pJob] != 3)
{
SendClientMessage(playerid, COLOR_GREY, "You are not a mechanic.");
return 1;
}
if(sscanf(params, "ui", userID, moneys))
{
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/repair [playerid] [money]");
}
if(moneys < 1 || moneys > 15000) { SendClientMessage(playerid, COLOR_GREY, "The money must be until 15000$."); return 1; }
if(IsPlayerConnected(userID))
{
if(userID != INVALID_PLAYER_ID)
{
if(IsPlayerInAnyVehicle(userID))
{
GetPlayerName(userID, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You offerd %s to fix his car for $%d.",giveplayer,moneys);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), " Car Mechanic %s wants to repair your car for $%d,(type /accept repair to accept).",sendername,moneys);
SendClientMessage(userID, COLOR_WHITE, string);
RepairOffer[userID] = playerid;
RepairPrice[userID] = moneys;
}
}
}
}
return 1;
}