Repair command [help]
#5

Set a timer with a variable ? Like :
PHP код:
/* At the top of the script */
new Bool:allowedRepair[MAX_PLAYERS];
//------------------------------------------------------------------------------------------------
/* In your command */
    
if(!allowedRepair[playerid]) return SendClientMessage(playeridX11_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"60000false"i"playerid);
    
/* End of the command */
//------------------------------------------------------------------------------------------------
/* Timer allowed repair a vehicle : */
forward timerAllowedRepair(playerid);
public 
timerAllowedRepair(playerid)
{
    
allowedRepair[playerid] = true;
    
SendClientMessage(playeridX11_MEDIUM_ORCHID_3"You can repair vehicles");
    return 
1;

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.
Reply


Messages In This Thread
Repair command [help] - by Diabloa - 11.05.2016, 19:14
Re: Repair command [help] - by Sew_Sumi - 11.05.2016, 19:20
Re: Repair command [help] - by jlalt - 11.05.2016, 19:22
Re: Repair command [help] - by Sew_Sumi - 11.05.2016, 19:23
Re: Repair command [help] - by Dayrion - 11.05.2016, 19:23

Forum Jump:


Users browsing this thread: 1 Guest(s)