Read local and gang chat
#4

You can create a MAX_PLAYERS variable and set it to 1 when you do /localspec, and another for /gangspec.
pawn Код:
new Spec[MAX_PLAYERS][2];
Then when you send a message, loop through all players and check if that variable is set to 1, if so, send them the message too.
Example with the gang chat loop, you can do this:
pawn Код:
for(new pID; pID < MAX_PLAYERS; pID++)
{
    if(IsPlayerConnected(pID)) {
        switch(Spec[pID][0])
        {
            case 0: SendClientMessage(pID, GetPlayerColor(playerid), string);
            case 1: SendClientMessage(pID, GetPlayerColor(playerid), string);
        }
    }
}
Also, using the foreach include would be more efficient as a player loop.
Reply


Messages In This Thread
Read local and gang chat - by sirvanec - 06.02.2015, 21:19
Re: Read local and gang chat - by CalvinC - 06.02.2015, 21:25
Re: Read local and gang chat - by sirvanec - 06.02.2015, 21:58
Re: Read local and gang chat - by CalvinC - 06.02.2015, 23:10

Forum Jump:


Users browsing this thread: 1 Guest(s)