A problem on setweather
#1

if(strcmp(cmdtext, "/setweather", true) == 0)
{

tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"/setweather [weather id]");
new weather=strval(tmp);
new ppName[24];
if(weather > 45 || weather < 0) return SendClientMessage(playerid,COLOR_RED,"Invalid weather number!");
SetWeather(weather);
GetPlayerName(playerid, ppName, sizeof(ppName));
format(string, sizeof(string), "Mod Message: %s has changed weather to id %d.", ppName, weather);
SendModMsg(mwhite, string);

return 1;
}


when i type /weather, "/setweather [weather id]" appears, but when i type /setweather x, it says "SERVER: Unknow cmd". i cant see any wrong think here, can some1 help me?
Reply
#2

You should use ZCMD & sscanf 2.0. much much much easier.






tyre fucker
Reply
#3

Quote:
Originally Posted by _❼_
tyre fucker
/q

well, i'll check for it.
Reply
#4

Does anyone helP??
Reply
#5

Check your code and see what happens:

Код:
new weather = strval("x")
This returns 0 or -1, or it may not work at all.
Reply
#6

Quote:
Originally Posted by Vince0789
Check your code and see what happens:

Код:
new weather = strval("x")
This returns 0 or -1, or it may not work at all.
nah, still the same
Reply
#7

Could you post your /weather command?
Reply
#8

Quote:
Originally Posted by |>Daniel<|
Could you post your /weather command?
I do believe its at the top..
Reply
#9

Quote:
Originally Posted by ♂ Antonio [G-RP
]
Quote:
Originally Posted by |>Daniel<|
Could you post your /weather command?
I do believe its at the top..
That's /setweather.
Quote:

when i type /weather, "/setweather [weather id]" appears, but when i type /weather x, it says "SERVER: Unknow cmd". i cant see any wrong think here, can some1 help me?

Reply
#10

sorry, my fault, its not /Weather >> /setweather, im so sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)