28.06.2011, 11:36
Help i need this command to be only like this /setweatger (weatherid) but when i got in game and type
/serweather 50 ---> its tell me ID (50) is not an active player i need to give me the weather not ID only weather no player ID help
/serweather 50 ---> its tell me ID (50) is not an active player i need to give me the weather not ID only weather no player ID help
Код:
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; }