08.01.2015, 13:44
How do I can do a specific command, once every day?
(Every time at 12 at night can again
(Every time at 12 at night can again
new CurDay;
new Year, Month;
getdate(Year, Month, CurDay);
bool:IsCmdLocked()
{
new Year, Month, Day;
getdate(Year, Month, Day);
if(Day == CurDay) return true;
CurDay = Day;
return false;
}
if(IsCmdLocked()) return SendClientMessage(playerid,-1,"Command is blocked");
On top
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|
CMD:commandname(playerid, params[]) {
new hour, minute, second;
gettime(hour, minute, second);
if(hour == 0) {
//command code
} else {
return SendClientMessage(playerid, /*your color*/, "[ERROR]: You can use this command only at 12 AM.");
}
return 1;
}