06.06.2011, 12:23
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/weather", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdminLevel] < 3)
{
SendClientMessage(playerid, COLOR_RED, "** you are not authorized to use that command!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /weather [weatherid]");
return 1;
}
new weather;
weather = strval(tmp);
if(weather < 0||weather > 45) { SendClientMessage(playerid, COLOR_RED, " Weather ID can't be below 0 or above 45!"); return 1; }
SetWeather(weather);
format(string, sizeof(string), "[ADMIN] %s has changed everyone's weather to %d.", sendername,weather);
ABroadCast(COLOR_LIGHTRED,string, 5);
format(string, sizeof(string), "World's Weather Has Been Changed to %d",weather);
SendClientMessageToAll(COLOR_GOLD,string);
DefaultWeather = weather;
}
return 1;
}
if(strcmp(cmd, "/changeweather", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < changeme)
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command.");
return 1;
}
ChangeWeather();
format(string, sizeof(string), "[ADMIN]: %s has Forced the Weather Change!.", sendername);
ABroadCast(COLOR_GOLD,string, 5);
}
return 1;
}
return 0;
}
I dont undersatnd ive started to script a brand new script ive had no errors so far i add weather and i get this
pawn Code:
(435) : error 017: undefined symbol "cmd"
(444) : error 017: undefined symbol "tmp"
(444) : error 017: undefined symbol "strtok"
(445) : error 017: undefined symbol "tmp"
(451) : error 017: undefined symbol "tmp"
(454) : error 017: undefined symbol "string"
(454) : error 017: undefined symbol "string"
(454) : error 029: invalid expression, assumed zero
454) : fatal error 107: too many error messages on one line