28.06.2011, 19:04
i will give you btw i try to do in 2 ways SetWeather and SetPlayerWeather and still the same
PHP код:
if(strcmp(cmd, "/setweather", true) == 0 && PlayerAdminLevel[playerid] == 2) // Gives a player money
{
new weather, str[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setweather (weatherid)");
return 1;
}
if(!IsNumeric(tmp)){
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setweather (weatherid) WeatherID Must be a number");
return 1;
}
weather = strval(tmp);
tmp = strtok(cmdtext, idx);
if(weather < 0 || weather > 50){
SendClientMessage(playerid,COLOR_ERROR,"WeatherID Cant Be Less Than 0 And More Than 50");
return 1;
}
for(new i=0;i<MAX_PLAYERS;i++)
SetPlayerWeather(i,weather);
format(string, sizeof(string), "Server %s Has Set Server WeatherID To %d",AdminRanks[PlayerAdminLevel[playerid]], weather);
SendClientMessageToAll(0xB22222AA, string);
format(str, sizeof(str),"You Have Set Server WeatherID To %d",weather);
SendClientMessage(playerid,COLOR_GREEN,str);
return 1;
}