help with team
#7

Here is an example using OnPlayerText Callback. Anything after '#' is typed will be sent to that players gang.

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        new
            szStr[128],
            szPName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, szPName, MAX_PLAYER_NAME);
        format(szStr, sizeof(szStr), "|TEAM| (%d)%s: %s", playerid, szPName, text[1]);
       
        for(new i; i < MAX_PLAYERS; i++)//if you use foreach use that, if you don't - then you should start.
            if(IsPlayerConnected(i))
                if(gTeam[playerid] == gTeam[i])//swap "gTeam" for the var you use to store the players gang/team.
                    SendClientMessage(playerid, 0x00FF00AA, szStr);
        return 0;
    }
    return 1;
}
EDIT: I forgot to return zero, that's fixed now.
Reply


Messages In This Thread
help with team - by Setkus - 25.08.2011, 15:49
Re: help with team - by Setkus - 25.08.2011, 16:07
Re: help with team - by knackworst - 25.08.2011, 16:09
Re: help with team - by Dragony92 - 25.08.2011, 16:12
Re: help with team - by Setkus - 25.08.2011, 16:22
Re: help with team - by Setkus - 25.08.2011, 16:48
Re: help with team - by iggy1 - 25.08.2011, 17:00
Re: help with team - by Setkus - 25.08.2011, 20:20
Re: help with team - by knackworst - 25.08.2011, 20:46
Re: help with team - by iggy1 - 25.08.2011, 22:07

Forum Jump:


Users browsing this thread: 3 Guest(s)