Overkillz Posted July 27, 2015 Posted July 27, 2015 Hey dear community, Im here with a new problem that I got. Im trying to dxDrawing a text which will show the Team of a player. It works well, but if the player isn't in a Team, DebugScript drops a lot of Warning Script: local playerTeamA = getPlayerTeam(player) local playerTeamB = getTeamName(playerTeamA) if not (playerTeamB ) then dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end When the player hasn't a team: I hope you can help me. Thanks and Regards.
GTX Posted July 27, 2015 Posted July 27, 2015 local playerTeamA = getPlayerTeam(player) local playerTeamB = getTeamName(playerTeamA) if playerTeamA then dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end
Overkillz Posted July 27, 2015 Author Posted July 27, 2015 local playerTeamA = getPlayerTeam(player) local playerTeamB = getTeamName(playerTeamA) if playerTeamA then dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end Still ocurring the same thing. I need to add that It drops the Warn Mensagges when I see to the player, when my camera is seeing to another place where the player doesn't stay It stops. Regards.
GTX Posted July 27, 2015 Posted July 27, 2015 Oh, I see. I'm sorry, this should work: local playerTeamA = getPlayerTeam(player) if playerTeamA then local playerTeamB = getTeamName(playerTeamA) dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end
Overkillz Posted July 27, 2015 Author Posted July 27, 2015 Oh, I see. I'm sorry, this should work: local playerTeamA = getPlayerTeam(player) if playerTeamA then local playerTeamB = getTeamName(playerTeamA) dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end Thanks so much, it works perfectly ^^
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