Jump to content

help nametag


Jacobob14

Recommended Posts

Posted
                    local r,g,b = getPlayerNametagColor(player) 
                    local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 
            local w = dxGetTextWidth(getPlayerNameR(player), textscale * NAMETAG_TEXTSIZE, srfont) / 2 
                    dxDrawText ( getPlayerNameR(player), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) 
                    dxDrawColorText ( getPlayerName(player), sx-w, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) 
                    dxDrawText ( "nivel:".. tostring ( getElementData ( localPlayer, "level" ) ), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) 
                    dxDrawColorText ("nivel:".. tostring ( getElementData ( localPlayer, "level" ) ), sx-w, sy - offset, sx, sy - offset, tocolor(255,0,0,255), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) 
                    local drawX = sx - NAMETAG_WIDTH*scale/2 
                    drawY = sy + offset 
                    local width,height =  NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale 
                    dxDrawRectangle ( drawX, drawY, width, height, tocolor(0,0,0,50) ) 

I have a problem I want to see the level name on the nametag but instead of watching the level of the player is mine someone help me :(

Posted

On lines 6 and 7, your first argument to getElementData is incorrect. It should be 'player' (as in the player whose nametag is being shown) instead of 'localPlayer' (which is always your own player element).

  • Moderators
Posted

You have to fix it, when the player is logging in, the server should set his level.

Search in server side for something like this:

... 
local lvl = --get his level in database  
setElementData(thePlayer, "level", lvl) 
outputChatBox("You have been successfully logged in !", thePlayer) 
... 

And try to check if the value of level is correct for all players.

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