SA-MP Forums Archive
[HELP]Team chat - 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: [HELP]Team chat (/showthread.php?tid=101976)



[HELP]Team chat - mr.b - 13.10.2009

hi
how can i make a team chat without gteam?
thanks


Re: [HELP]Team chat - virspector - 13.10.2009

Can't u should do something like this:

pawn Код:
new gClass[MAX_PLAYERS];
Then

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    //SOMETHING HERE...
    gClass[playerid] = classid;
    //SOMETHING HERE...
    return 1;
}
And to make Team Chat, like this:

pawn Код:
OnPlayerCommandText(playerid, cmdtext)
{
if(!strcmp("/samplechat", cmdtext, true))
{
new PlayerName[MAX_PLAYERS];
new string[128];
GetPlayerName(playerid, playername, sizeof(playername));
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string, sizeof(string), "Team Chat [%s]: Just a sample! HAVE FUN!", playername)
if(gClass[playerid] == gClass[i])
{
SendClientMessage(i, #color_hex_here#, string);
}
return 1;
}
return 0;
}