How to do so when I write...
#1

How to do so when I write /tod 200, appears to me that "You can not set a time before 0 and after 23 hours"? Thanks in advance

Код:
	if(strcmp(cmd, "/tod", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /tod [0-23]");
				return 1;
			}
			new hour;
			hour = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
	            SetWorldTime(hour);
				format(string, sizeof(string), "Weather is set to %d hours.", hour);
				SendClientMessageToAll(COLOR_GRAD1, string);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "You are not an admin!");
			}
		}
		return 1;
	}
Reply
#2

After
pawn Код:
hour = strval(tmp);
Add:
pawn Код:
if(!(0 <= hour <= 23)) return SendClientMessage(playerid, COLOR_GRAD1, "Invalid Use");
This forum requires that you wait 120 seconds between posts. Please try again in 15 seconds. -.-
Reply
#3

Thank you! ))))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)