20.04.2013, 14:08
Im having issues with this command, i do not receive any errors when i try to compile, but once i get in-game and try to set the server time, it's always sending me the error message "You may only set valid hours between 0 and 23" instead of setting the server time, help plz.
There's the code!
pawn Код:
CMD:settime(playerid, params[])
{
new pTI, string[128];
if(pInfo[playerid][Level] < 1) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR]You are not authorized to use this command.");
if(sscanf(params, "u", pTI)) return SendClientMessage(playerid, 0xFF0000AA, "[USAGE]: /settime <time>.");
if(pTI > 24 || pTI > 0) return SendClientMessage(playerid, 0xFF0000AA, "You may only set valid hours between 0 and 23");
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerTime(i, pTI, 0);
}
format(string, sizeof(string), "World time has been set to %d", pTI);
SendClientMessageToAll(0x10F441AA, string);
return 1;
}