Tokio Posted December 9, 2017 Share Posted December 9, 2017 ..this is not the full code from my nametag: Spoiler local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if thePlayer == getLocalPlayer() then local DataUpText = getElementData(thePlayer,"char:upText") local imageSize = dxGetFontHeight ( textscale*NAMETAG_TEXTSIZE2, srfont ) nameWidth = dxGetTextWidth ( playerName, textscale*NAMETAG_TEXTSIZE, srfont ) teamWidth = nameWidth if DataUpText == "" then -- dxDrawImage(x - 25 / (distance/10),y - 100 / (distance/10),50 / (distance/10),50 / (distance/10),getElementData(thePlayer, "char:admin")..".png") else dxDrawImage(sx - math.max(nameWidth/2) - imageSize - -18*scale, sy - imageSize - 8*scale, imageSize, imageSize,"keyboard.png") end end end function handleChanging() if isChatBoxInputActive() then setElementData(getLocalPlayer(),"char:chatting", true) chatti = "#FFFFFF" else setElementData(getLocalPlayer(),"char:chatting", false) chatti = "" end upText = chatti..""..network setElementData(getLocalPlayer(),"char:upText", upText) end addEventHandler ( "onClientRender", root, handleChanging ) when i press 'T', the chaticon appear on everybody.. how to fix this? i want, when a player, or me press 'T', the ballon show just on the player, or on me, not on everyplayers... sorry for my terrible english .. :c Link to comment
Scripting Moderators thisdp Posted December 9, 2017 Scripting Moderators Share Posted December 9, 2017 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if getElementData(thePlayer,"char:chatting") then local DataUpText = getElementData(thePlayer,"char:upText") local imageSize = dxGetFontHeight ( textscale*NAMETAG_TEXTSIZE2, srfont ) nameWidth = dxGetTextWidth ( playerName, textscale*NAMETAG_TEXTSIZE, srfont ) teamWidth = nameWidth if DataUpText == "" then -- dxDrawImage(x - 25 / (distance/10),y - 100 / (distance/10),50 / (distance/10),50 / (distance/10),getElementData(thePlayer, "char:admin")..".png") else dxDrawImage(sx - math.max(nameWidth/2) - imageSize - -18*scale, sy - imageSize - 8*scale, imageSize, imageSize,"keyboard.png") end end end 1 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