How do I make this cmd only work once every 20 minutes?
#2

use gettime to check the time passed like

Quote:

CMD:repaircar(playerid, params[])
{
if(gettime() - GetPVarInt(playerid,"last_time_repaircar") < 20*60*1000) return 0;
SetPVarInt(playerid,"last_time_repaircar",gettime( ));
new vehid = GetPlayerVehicleID(playerid);

RepairVehicle(vehid);
GivePlayerMoney(playerid, -850);

return 1;
}
Reply


Messages In This Thread
How do I make this cmd only work once every 20 minutes? - by aKnoxx - 26.12.2018, 12:47
Re: How do I make this cmd only work once every 20 minutes? - by iorp - 26.12.2018, 12:52
Re: How do I make this cmd only work once every 20 minutes? - by Logic_ - 26.12.2018, 13:10
Re: How do I make this cmd only work once every 20 minutes? - by DaryltheCoder - 26.12.2018, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)