[HELP] /setweather command
#1

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

Код:
 	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;
    }
Reply


Messages In This Thread
[HELP] /setweather command - by [MKD]Max - 28.06.2011, 11:36
Re: [HELP] /setweather command - by iPLEOMAX - 28.06.2011, 11:42
Re: [HELP] /setweather command - by [MKD]Max - 28.06.2011, 12:01
Re: [HELP] /setweather command - by [MKD]Max - 28.06.2011, 15:40
Re: [HELP] /setweather command - by Shadoww5 - 28.06.2011, 15:48
Re: [HELP] /setweather command - by [MKD]Max - 28.06.2011, 18:07
Re: [HELP] /setweather command - by iPLEOMAX - 28.06.2011, 18:12
Re: [HELP] /setweather command - by [MKD]Max - 28.06.2011, 18:47
Re: [HELP] /setweather command - by Shadoww5 - 28.06.2011, 18:57
Re: [HELP] /setweather command - by [MKD]Max - 28.06.2011, 19:04

Forum Jump:


Users browsing this thread: 1 Guest(s)