SA-MP Forums Archive
Help please - 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 please (/showthread.php?tid=91274)



Help please - Mr_0wnage - 13.08.2009

Hey, I have this team chat but when I try to use it it just sends the message to the player who sent it and to id 0 but no one else? Any thoughts on whats wrong? heres the code:

Код:
public OnPlayerText(playerid, text[]) 
{
    new PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	if(text[0] == ';')
    {
      new string[256];
      format(string, sizeof(string), "[Team] %s(ID:%d):%s", PlayerName, playerid, text);
      for(new i = 0; i <= MAX_PLAYERS; i++ )
      {
        if(gTeam[i] == gTeam[playerid])
        {
          SendClientMessage(i, TEAMCHATCOLOR, string);
        }
      }
      return 0;
    }
  return 1;
}



Re: Help please - Mr_0wnage - 13.08.2009

anyone?


Re: Help please - wilcock33 - 13.08.2009

is that for an
Код:
public onplayercomandtext



Re: Help please - Mr_0wnage - 13.08.2009

no OnPlayerText, can't u see it?


Re: Help please - wilcock33 - 13.08.2009

ok ok just trying to help

youre not going to get any help with an attitude like that

anyway, i would chage gang chat to a command or a DCMD comand instead

just because its easier!


Re: Help please - Mr_0wnage - 13.08.2009

I wasn't trying to sound like I had an attitude lol, but thanks anyway


Re: Help please - wilcock33 - 13.08.2009

ok
if you need mor ehelp just ask


Re: Help please - Mr_0wnage - 13.08.2009

yea i do, see its only working for ID 0, I need to to work for any ID that is on the same team


Re: Help please - wilcock33 - 13.08.2009

ok, give me a min



Re: Help please - _Vortex - 13.08.2009

http://pastebin.com/f6635b3ad

Enjoy.