03.11.2016, 22:48
So I got a cooldown for my command, I want it to be hours:minutes, for example if you have to wait 24 hours then it'll be like >> 24:00, after 1 minute >> 23:59, after 1 more minute >> 23:58, etc.
How to do that? Here's my code;
How to do that? Here's my code;
PHP код:
new iString[120];
new currenttime = gettime();
new cooldown = (Cooldown[playerid] + 86400) - currenttime;
format(iString, sizeof(iString),"You have to wait %02d:%02d:%02d", cooldown / 60, cooldown / 60, cooldown % 60);
if(currenttime < (Cooldown[playerid] + 120)) return SendClientMessage(playerid, -1, iString);
Cooldown[playerid] = gettime();