09.09.2014, 07:21
pawn Код:
CMD:repair(playerid,params[])
{
if(!IsPlayerConnected(playerid)) return 1;
if(playerVariables[playerid][pJob] != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not a mechanic.");
new userID, moneys;
if(sscanf(params, "ui", userID, moneys)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/repair [playerid] [money]");
if(!(0 < moneys < 15001)) return SendClientMessage(playerid, COLOR_GREY, "The money must be between $1 and $15000.");
if(!IsPlayerConnected(userID) || userID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "User is not connected.");
if(userID == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot offer services to yourself.");
if(!IsPlayerInAnyVehicle(userID)) return SendClientMessage(playerid, COLOR_GREY, "This player is not in a vehicle.");
new giveplayer[MAX_PLAYER_NAME], string[110];
GetPlayerName(userID, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "You offered to fix %s's car for $%d.", giveplayer, moneys);
SendClientMessage(playerid, COLOR_WHITE, string);
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), " Car Mechanic %s wants to repair your car for $%d,(type /accept repair to accept).", giveplayer, moneys);
SendClientMessage(userID, COLOR_WHITE, string);
RepairOffer[userID] = playerid;
RepairPrice[userID] = moneys;
return 1;
}
pawn Код:
if(userID == playerid)