11.05.2016, 19:23
Set a timer with a variable ? Like :
If you need some explications, say it. I don't think it's the best way to do what you want. :$
EDIT : Alright, they too fast for me. Wow.
PHP код:
/* At the top of the script */
new Bool:allowedRepair[MAX_PLAYERS];
//------------------------------------------------------------------------------------------------
/* In your command */
if(!allowedRepair[playerid]) return SendClientMessage(playerid, X11_MEDIUM_ORCHID_3, "You can't repair this vehicle. You have to wait 1 minute!");
/* If the player can repair the vehicle, set this after RepairVehicle(vehicleid) */
allowedRepair[playerid] = false;
SetTimerEx("timerAllowedRepair", 60000, false, "i", playerid);
/* End of the command */
//------------------------------------------------------------------------------------------------
/* Timer allowed repair a vehicle : */
forward timerAllowedRepair(playerid);
public timerAllowedRepair(playerid)
{
allowedRepair[playerid] = true;
SendClientMessage(playerid, X11_MEDIUM_ORCHID_3, "You can repair vehicles");
return 1;
}
EDIT : Alright, they too fast for me. Wow.
