SA-MP Forums Archive
Team PM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team PM (/showthread.php?tid=174731)



Team PM - DragonBlaster50 - 06.09.2010

Hey guys, Could you Please Give me some kind of Team Chat or Team Pm? I tried to search but I have not ben able to find it

((I use Gteam))


Re: Team PM - Ironboy500[TW] - 06.09.2010

You should use search. There were so many examples of team chat. I'll give you mine.

Код:
dcmd_t(playerid, params[])
{
	new string[256], message;
	if(sscanf(params, "z", message)) return SendClientMessage(playerid, ORANGE, "Usage: /T [Text]");
	format(string, sizeof(string), "[Team Chat] %s (%d): %s", Name(playerid), playerid, message);

	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		 	if(IsPlayerConnected(i))
			{
		 		if(GetPlayerTeam(i) == GetPlayerTeam(playerid))	SendClientMessage(i, YELLOW, string);
			}
	}
	return 1;

}



Re: Team PM - iggy1 - 06.09.2010

Heres a way for gang chat that might work and no need for a command (but its not pm just gang chat).
Not tested should work. Anything after a player types '#' (without quotes) will be sent to that players team only. If they are not in a team nothing will be sent.

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        new str[128],playername[24];
        for(new i; i < MAX_PLAYERS; i++)
        {
            if(gTeam[playerid] == gTeam[i])
            {
                GetPlayerName(playerid,playername,sizeof(playername));
                format(str,sizeof(str),"Gang(%s): %s",playername,text[1]);
                SendClientMessage(i,0x7fff00FF,str);
            }
        }
        return 0;
    }
    //rest of player text stuff here.
    return 1;
}



Re: Team PM - DragonBlaster50 - 15.09.2010

Nevermind.