Does not change the time
#2

Try something like this

PHP код:
CMD:tod(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
    new 
string[128], time;
    if(
sscanf(params"d"time)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /tod [time] (0-23)");
    
SetWorldTime(time);
    
format(stringsizeof(string), "Time set to %d:00."time);
    
BroadCast(COLOR_GRAD1string);
    return 
1;

or even shorter version and more simpler to use
PHP код:
COMMAND:settime(playeridparams[])
{
    new 
time;
    if(
sscanf(params"i"time)) return SendClientMessage(playerid, -1"Usage: /settime [time]");
    if(
time 24 || time 0) return SendClientMessage(playerid, -1"Error: Invalid time!");
    
SetWorldTime(time);
    return 
1;

Reply


Messages In This Thread
Does not change the time - by raamiix - 28.03.2013, 19:19
Re: Does not change the time - by Pawnie - 28.03.2013, 19:59
Re: Does not change the time - by raamiix - 28.03.2013, 20:03
Re: Does not change the time - by Pawnie - 28.03.2013, 20:04
Re: Does not change the time - by raamiix - 28.03.2013, 20:06
Re: Does not change the time - by Konstantinos - 28.03.2013, 20:50
Re: Does not change the time - by raamiix - 29.03.2013, 12:52

Forum Jump:


Users browsing this thread: 1 Guest(s)