Quote:
Originally Posted by ★ ♫ • Littlejohny • ♫ ★
pawn Код:
dcmd_settime(playerid,params[]) { new string[256],idx,tmp[256]; if(IsPlayerAdmin(playerid)) { tmp = strtok(params,idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_RED, "ERROR: /settime [hour]"); return 1; } new h = strval(tmp); if(h < 0 || h > 24) { SendClientMessage(playerid, COLOR_RED, "ERROR: /settime [hour]"); return 1; } SetWorldTime(h); format(string,sizeof(string), "Admin %s has change the Time to %d !", GetName(playerid), h); SendAllEMessage(string); } else { SendClientMessage(playerid, COLOR_RED, "ERROR: You must be a Admin to use this Command !"); return 1; } return 1; }
|
Why are you using strtok ?