19.08.2016, 02:59
Here you go, sorry btw, I'm not using zcmd I have so much troubles with it idk why.
pawn Код:
//------------------------------Set time----------------------------------------
if(strcmp(cmdtext, "/asettime") == 0)
{
tmp = strtok(cmdtext, idx);
new time = strval(tmp);
if(logged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use that command!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not admin.");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /asettime [hour]");
return 1;
}
if(time < 0 || time > 23)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "Time must be between 0 and 23 hours!");
return 1;
}
else if(logged[playerid] == 1)
{
SetWorldTime(time);
format(string, sizeof(string), "Time has been changed for %d hour(s).", time);
SendClientMessage(giveplayerid, COLOR_ORANGE, string);
}
return 1;
}