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

I can't help with much but, I recreated the command that " iorp " created.


Код:
CMD:repaircar(playerid, params[]) 
{ 
if(gettime() - GetPVarInt(playerid,"last_time_repaircar") < 200000) return SendClientMessage(playerid, 0xAA3333AA, "[SERVER]: You can use this command only one time every 20 minutes!");
SetPVarInt(playerid,"last_time_repaircar",gettime( ));
if(GetPlayerMoney(playerid) < 850) return SendClientMessage(playerid, 0xAA3333AA, "[SERVER]: You don't have enough money to repair your car!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xAA3333AA, "[SERVER]: You must be in vehicle to use this command!");

RepairVehicle(playerid); // No need to add ' new 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: 4 Guest(s)