SA-MP Forums Archive
Recheck On My Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Recheck On My Script (/showthread.php?tid=183581)



Recheck On My Script - Crayon - 16.10.2010

Hey guys,

I'm new to zcmd, if you guys can just check over my code for changing the time of day, because I don't think it's functioning properly Thanks!

pawn Код:
command(tod, playerid, params[])
{
    new hour;
    if(PlayerStatistics[playerid][pAdminLevel] >= 5) return 1;
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tod [timeofday] (0-23)");
    if(!IsPlayerConnectedEx(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to login first before you can use this command!");
    SetWorldTime(hour);
    format(string, sizeof(string), "The weather has been set by Administrator %s.", hour);
    SendClientMessageToAll(COLOR_DORANGE, string);
    return 1;
}



Re: Recheck On My Script - Rachael - 16.10.2010

I think you need to add a line or two
pawn Код:
hour = strval(params);
if(hour < 0 || hour > 23) return SendClientMessage(playerid,COLOR_GREY,"Invalid hour ( 0 - 23 )");