OnPlayerText
#1

Look my code:

pawn Код:
if(text[0] == '&')
   {
      new string[128],nome[30];
      GetPlayerName(playerid, nome, 30);
      format(string,sizeof(string),"%s [ID: %d]: %s", nome, playerid, text);
      foreach(Player, todos)
      {
         if(IsPlayerConnected(todos))
         {
             if(time[todos] == EMPTY) return SendClientMessage(todos, 0xFFFFFFFF, string);
             else if(time[todos] == POLICE) return SendClientMessage(todos, 0x0080FFFF, string);
             else if(time[todos] == ARMY) return SendClientMessage(todos, 0x7CAD0CFF, string);
             else if(time[todos] == RUNNER) return SendClientMessage(todos, 0xFF00FFFF, string);
             else if(time[todos] == ADMIN) return SendClientMessage(todos, 0xFFFF80FF, string);
          }
       }
    }
If a player types the simbol & + message, the message will be sent according to these defined teams above. How to do that? it's not working :S. Also tried
Код:
if(strfind(text,"&",true) =! -1)
Reply


Messages In This Thread
OnPlayerText - by blackwave - 12.12.2010, 12:45
Re: OnPlayerText - by Benjo - 12.12.2010, 13:16
Re: OnPlayerText - by Jefff - 12.12.2010, 14:13

Forum Jump:


Users browsing this thread: 2 Guest(s)