Jump to content

Nametag error!


Recommended Posts

Hi, on this time i want to show player team over nick, but what is wrong, if dont get the player team, should appear a random phrase how to do it?


local team = getElementData(player, "team") or " " 
dxDrawText (team.." \n"..getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, raceInterface.font, "center", "bottom", false, false, false, true ) 


addEventHandler( 'onPlayerLogin', root, 
    function ( ) 
        team = getPlayerTeam(source) 
        setElementData(source, "team", team)             
addEventHandler( 'onPlayerQuit', root, 
function ( ) 
local team = getElementData(source, "team") 
    if team then 

How to do it?

Link to comment
I dont like to leave him in dark i like to help others

... I never said anything about something about or even something referring to this.


Anyway, I posted a wrong code. I meant just use this:

local team = getPlayerTeam(player) 
if (team ~= false) and (team ~= nil) then 
    team = getTeamName(team) 
if (team == false) or (team == nil) then 
    team = "N/A" 

As soon as a player gets placed into a team, it will draw the team above the nickname.

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...