[HELP] What is wrong with this?
#3

Quote:
Originally Posted by OmeRinG
Problems are in the function SendCopMessage...
When you did GetPlayerTeam you used playerid instead of i
You used 1 more bracket than you needed to
Now I have:

Код:
	if(strcmp(cmdtext , "/radio", true) == 0)
	{
    	if(GetPlayerTeam(playerid) != 5) return SendClientMessage(playerid,COLOR_RED, "Identification Error - You need rank 1 to do this.");
			{
				if ((strlen(cmdtext) >= 1)&&(strlen(cmdtext) <= 3))
					{
            new string[128];
						new playername[MAX_PLAYER_NAME];
						GetPlayerName(playerid,playername,sizeof(playername));
						format(string,sizeof(string),"Police Radio: %s:%s",playername,cmdtext[128]);
						SendCopMessage(COLOR_BLUE, string);
						return 1;
					}
			}
	}
	return 0;
}
Код:
SendCopMessage(color, text[]) {
	for(new i = 0; i < MAX_PLAYERS; i ++) {
  if(IsPlayerConnected(i)) {
  if(GetPlayerTeam(i) != 5)
      SendClientMessage(i, color, text);
      }
    }
  }
But when I type /radio, it says Unknown Command..., nothing more
Reply


Messages In This Thread
[HELP] What is wrong with this? - by FreddeN - 15.06.2009, 12:46
Re: [HELP] What is wrong with this? - by OmeRinG - 15.06.2009, 12:48
Re: [HELP] What is wrong with this? - by FreddeN - 15.06.2009, 12:52

Forum Jump:


Users browsing this thread: 1 Guest(s)