if(strcmp(cmd, "/setweather", true) == 0 && PlayerAdminLevel[playerid] == 2) // Gives a player money { 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; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); return 1; } new sendername[24]; new receivername[24]; GetPlayerName(playerid,sendername, 24); GetPlayerName(giveplayerid,receivername, 24); 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; } if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "ID (%d) Is not an active player",giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); return 1; } new weather = strval(tmp); if(weather < 0 || weather > 50){ SendClientMessage(playerid,COLOR_ERROR,"WeatherID Cant Be Less Than 0 And More Than 50"); return 1; } new s[128]; new pname[24]; GetPlayerName(giveplayerid,pname,24); 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(s, sizeof(s),"You Have Set Server WeatherID To %d",weather); SendClientMessage(giveplayerid,COLOR_RED,s); return 1; }
if(!IsPlayerConnected(giveplayerid)) {
format(string, sizeof(string), "ID (%d) Is not an active player",giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
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;
}
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;
}