21.03.2011, 14:27
Here, without any timers
At the top of the Script:
OnPlayerCommandText:
At the top of the Script:
pawn Code:
new WaitTimeForCMD[MAX_PLAYERS];
pawn Code:
if(!strcmp("/vr", cmdtext, true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if((GetTickCount()-WaitTimeForCMD[playerid])>120000)return SendClientMessage(playerid,RED,"ERROR: Wait 2Minutes to use this CMD again!");
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
WaitTimeForCMD[playerid]=GetTickCount();
return SendClientMessage(playerid,YELLOW," Sucessfully Fixed The Vehicle ");
}
else return SendClientMessage(playerid,RED,"ERROR: You are not in a Vehicle!");
}