28.06.2011, 15:48
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))
return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setweather (weatherid)");
if(!IsNumeric(tmp))
return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setweather (weatherid) WeatherID Must be a number");
weather = strval(tmp);
if(weather < 0 || weather > 50)
return SendClientMessage(playerid,COLOR_ERROR,"WeatherID Cant Be Less Than 0 And More Than 50");
SetWeather(weather);
new sendername[24];
GetPlayerName(playerid,sendername, 24);
format(str, sizeof(str), "%s Has Set Server WeatherID To %d",sendername, weather);
SendClientMessageToAll(0xB22222AA, string);
format(str, sizeof(str),"You Have Set Server WeatherID To %d",weather);
SendClientMessage(playerid,COLOR_RED,str);
return 1;
}