Turbe$Z

Why show in global chat the teamsay?

Recommended Posts

local function ujteamsay(message, messageType)
	if messageType == 2 then
        cancelEvent()
		outputChatBox("(CSOPORT) "..getPlayerName(source)..": #FFffFF"..message, root, red, green, blue, true )
	end
end
addEventHandler("onPlayerChat", root, ujteamsay)

how to fix this? i want just team mates see the message.. :S

 

*sorry for my very bad English :c*

Edited by Turbo777

Share this post


Link to post
1 minute ago, nikitafloy said:

There must be another argument

root - applies to all

And what applies just to team mates?

Share this post


Link to post
1 minute ago, nikitafloy said:

how do u define 'team mates'?

players in the my gang

 

Share this post


Link to post
57 minutes ago, nikitafloy said:
  1. if getTeamName ( player ) == 'there ur name of team' then
  2. outputChatBox(..., player, ...)
  3. end

 

if getTeamName ( player ) == getTeamName( source ) then
  outputChatBox(..., player, ...)
end

I don't think you want people from other teams to be talking in the same team lol

Share this post


Link to post
local function ujteamsay(message, messageType)
	if messageType == 2 then
        cancelEvent()
    	local team = getPlayerTeam(source)
    	if(team) then
      		for i,player in pairs(getPlayersInTeam(team)) do
				outputChatBox("(CSOPORT) "..getPlayerName(source)..": #FFffFF"..message, player, red, green, blue, true )
        	end
      	end
	end
end
addEventHandler("onPlayerChat", root, ujteamsay)

 

  • Like 1

Share this post


Link to post
1 hour ago, Hornet said:

local function ujteamsay(message, messageType)
	if messageType == 2 then
        cancelEvent()
    	local team = getPlayerTeam(source)
    	if(team) then
      		for i,player in pairs(getPlayersInTeam(team)) do
				outputChatBox("(CSOPORT) "..getPlayerName(source)..": #FFffFF"..message, player, red, green, blue, true )
        	end
      	end
	end
end
addEventHandler("onPlayerChat", root, ujteamsay)

 

Thaanks :DD

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.