SA-MP Forums Archive
set time - 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)
+--- Thread: set time (/showthread.php?tid=551229)



set time - Jhony_Blaze - 17.12.2014

How can I create a command which sets the time of the server, so I can switch from night to day. I'd like to use zcmd, since that's easier.


Re: set time - Sawalha - 17.12.2014

pawn Код:
CMD:settime(playerid, params[])
{
     new time;
     if(sscanf(params, "i", time)) return SendClientMessage(playerid, -1 , "ERROR: use /settime [Hour]");
     if(time > 23 || time < 0) return SendClientMessage(playerid, -1, "ERROR: must be more than 0 and less than 24");
     SetWorldTime(time);
     return 1;
}



Re: set time - Jhony_Blaze - 17.12.2014

Thanks, and this gonna change time for every player ? Or only for me ?


Re: set time - Banana_Ghost - 17.12.2014

It changes the world time on the server. So yes, it's going to change the time for everyone.


Re: set time - Jhony_Blaze - 17.12.2014

Alright. Thanks again !