Jump to content

Some Help (;


iPrestege

Recommended Posts

addEventHandler("onPlayerChat", root,  
function (msg) 
  
 cancelEvent (true) 
  
local Tag = getPlayerNametagText ( thePlayer ) 
local Team = getPlayerTeam ( source ) 
   
if (Team) then 
outputChatBox ( "["..Team.."]"..Tag..": "..msg, getRootElement(), 255, 0, 0, true ) 
else 
outputChatBox ( "[Name]"..Tag..": "..msg, getRootElement(), 255, 0, 0, true ) 
            end 
     end 
 end 
) 
  

:oops:

#Edited

Edited by Guest
Link to comment
addEventHandler ( "onPlayerChat", root, 
    function ( msg, msgType ) 
        if ( msgType == 0 ) then 
            local Tag = getPlayerNametagText ( source ) 
            local Team = getPlayerTeam ( source ) 
            local teamName = ( Team and getTeamName ( Team ) or "Prestege" ) 
            outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) 
            cancelEvent ( true ) 
        end 
    end 
) 

Errors:

1: 'thePlayer' is not defined.

2: 'getPlayerTeam' returns a team element, not it's name.

3: The string at 'outputChatBox' was wrong.

Link to comment
addEventHandler ( "onPlayerChat", root, 
    function ( msg, msgType ) 
        if ( msgType == ) then 
            local Tag = getPlayerNametagText ( source ) 
            local Team = getPlayerTeam ( source ) 
            local teamName = ( Team and getTeamName ( Team ) or "Prestege" ) 
            outputChatBox ( "[".. teamName .."] ".. tag ..": ".. msg, root, 255, 0, 0, true ) 
            cancelEvent ( true ) 
        end 
    end 
) 

Errors:

1: 'thePlayer' is not defined.

2: 'getPlayerTeam' returns a team element, not it's name.

3: The string at 'outputChatBox' was wrong.

Warring: Loading script failed: Gangs/Server.lua:156: unexpected symbol near ')'

Warring: Loading script failed: Gangs/Client.lua:18: Bad argument @ 'guiWindowSetSizable' [Expected gui-window at argument 1,got gui-staticimage

^ debugsctript +

doesn,t work . @Server Side

Link to comment

@ Solid Snake it works but you didn,t understand me ! i want to set player name tag not prestege i want to set player name

with team name for example my name in the game prestege and i join into grove team so if i chat on the chat box my name will be like that with the name tag

[Grove] Prestege : Hi SolidSnake ,

Grove = that what i want to but it place prestege if is player in team grove or ballas or police ..bla..bla ..

i hope you understand me .. :roll:

Edited by Guest
Link to comment
addEventHandler ( "onPlayerChat", root, 
    function ( msg, msgType ) 
        if ( msgType == 0 ) then 
            local Tag = getPlayerNametagText ( source ) 
            local Team = getPlayerTeam ( source ) 
            local teamName = ( Team and getTeamName ( Team ) or "" ) 
            outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) 
            cancelEvent ( true ) 
        end 
    end 
) 

Link to comment
addEventHandler ( "onPlayerChat", root, 
    function ( msg, msgType ) 
        if ( msgType == 0 ) then 
            local Tag = getPlayerNametagText ( source ) 
            local Team = getPlayerTeam ( source ) 
            local teamName = ( Team and getTeamName ( Team ) or "" ) 
            outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) 
            cancelEvent ( true ) 
        end 
    end 
) 

thanks it works great ! :D

Link to comment

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.
×
×
  • Create New...