09.04.2015, 09:15
(
Последний раз редактировалось Muhammad78; 09.04.2015 в 09:57.
)
Hi, i got a command for players, but that command always used for abusing, so i decide to make it with cooldown, i have tested the command and didn't work theres no error while compiling but didn't work in game. Heres my code
Код:
new WaitTime[MAX_PLAYERS];
Код:
CMD:fixvme(playerid,params[]) {
if((GetTickCount()- WaitTime[playerid])> 6000) return SendClientMessage(playerid,red,"ERROR: You need to wait 1 minutes before you can /fixvme again!");
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(GetPlayerWantedLevel(playerid) >= 4) {
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command while you have a warrant (Orange/Red)");
return 1;
}
if(PlayerInfo[playerid][team] != TEAM_MECHANIC) {
SendClientMessage(playerid,COLOR_ERROR,"You are not a mechanic");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) {
SendClientMessage(playerid,COLOR_ERROR,"You are not in a vehicle");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
new tofix = GetPlayerVehicleID(playerid);
SetVehicleHealth(tofix, 1000);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Vehicle Engine Repaired_|");
SendClientMessage(playerid, 0x00C7FFAA, "You have fixed your vehicle engine");
fixedcarrecent[playerid] =60;
}
else
SendClientMessage(playerid, COLOR_ERROR, "You need to be driver to fix your own car");
return 1;
}

