Jacobob14 Posted February 15, 2014 Share Posted February 15, 2014 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 Link to comment
J.S. Posted February 15, 2014 Share Posted February 15, 2014 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). Link to comment
Jacobob14 Posted February 15, 2014 Author Share Posted February 15, 2014 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). already tried but does not show the level http://prntscr.com/2sqx1y Link to comment
Moderators Citizen Posted February 15, 2014 Moderators Share Posted February 15, 2014 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now