22.03.2012, 05:24
i want to add 2 minute timer in my '/repair' after the 2 minute timer their will be
'Mechanic Engineer %s has sucessfully repaired %s's vehicle engine'
and the owner of the vehicle engine will give the Mechanic Engineer, $5,000. also how to check if the mechanic engineer is riding the vehicle of selected id, if player is not in selected id vehicle he cannot fix the engine.
CODE:
'Mechanic Engineer %s has sucessfully repaired %s's vehicle engine'
and the owner of the vehicle engine will give the Mechanic Engineer, $5,000. also how to check if the mechanic engineer is riding the vehicle of selected id, if player is not in selected id vehicle he cannot fix the engine.
CODE:
pawn Код:
CMD:repair(playerid, params[])
{
new string[120], id;
if(pInfo[playerid][JobMember] == 2 || pInfo[playerid][JobLeader] == 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /repair [playerid]");
if(IsPlayerInAnyVehicle(playerid)) {
if(GetPlayerMoney(id) > 5000) return SendClientMessage(id, COLOR_GREY, "You do not have enough money to pay the mechanic engineer!");
format(string, sizeof(string), "Mechanic Engineer %s is fixng %s's vehicle engine...", GetName(playerid), GetName(id));
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "Mechanic Engineer %s will gonna fix your vehicle engine...", GetName(playerid));
SendClientMessage(id, COLOR_YELLOW, string);
format(string, sizeof(string), "You fixing %s's vehicle engine", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
SetVehicleHealth(GetPlayerVehicleID(id), 1000);
RepairVehicle(GetPlayerVehicleID(id));
format(string, sizeof(string), "Mechanic Engineer %s has sucessfully fix %s's vehicle engine", GetName(playerid), GetName(id));
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "Mechanic Engineer %s has fix your vehicle engine, you will pay 5,000$", GetName(playerid));
SendClientMessage(id, COLOR_YELLOW, string);
format(string, sizeof(string), "You sucessfully fix %s's vehicle engine, he/she pays you 5,000$", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
GivePlayerMoney(playerid, 5000);
GivePlayerMoney(id, -5000);
} else {
SendClientMessage(playerid, COLOR_GREY, " You are not Mechanic Engineer! ");
}
}
return 1;
}