Chat 'channels'
#1

How can i make something like chat-channels?like if youre a cop you type /c bla bla, and all the cops see 'bla bla'?
Reply
#2

You need to create a player standard variable
pawn Код:
new pChannel[MAX_PLAYERS];
to store the players channel - then you need to create the "Send Message" command - i personally would create my own functions for this, but it can be done in the command sections itself...

Heres the command functions that i would use:

pawn Код:
stock SendClientMessageToChannel(channel, msg[])
{
     for(new i; i < MAX_PLAYERS; i++)
     {
          if(pChannel[i] == channel)
          {
               SendClientMessage(playerid, COLOUR, msg);
          }
     }
}

//Usage: SendClientMessageToChannel(channel, msg[])
If you want a change channel command - just do
pawn Код:
pChannel[playerid] = (the channel they picked)
Reply
#3

Thanks mate!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)