02.05.2012, 10:25
Try with this
//----------------------------------[TOD]-----------------------------------------------
if(strcmp(cmd, "/tod", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /tod [timeofday] (0-23)");
return 1;
}
new hour;
hour = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
SetWorldTime(hour);
format(string, sizeof(string), " Time set to %d:00.", hour);
BroadCast(COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
return 1;
}
//----------------------------------[TOD]-----------------------------------------------
if(strcmp(cmd, "/tod", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /tod [timeofday] (0-23)");
return 1;
}
new hour;
hour = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
SetWorldTime(hour);
format(string, sizeof(string), " Time set to %d:00.", hour);
BroadCast(COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
return 1;
}