xXMADEXx Posted June 7, 2013 Share Posted June 7, 2013 Hi guys, im making staff texts, but i get some gay error. When i am moving ( Running, walking, jumping, etc..) it spams debugscript. But, if im standing still, it works perfect Screen: http://imageshack.us/a/img14/9074/mtasc ... 210724.png Code: function dxNameTags ( ) for i, v in ipairs ( getElementsByType ( "player" ) ) do if ( v ~= localPlayer ) then local job = getElementData ( v, "Job" ) if ( job == "New Staff" or job == "Trained Staff" or job == "Trusted Staff" or job == "High Staff" or job == "Full Staff" ) then local x, y, z = getElementPosition ( localPlayer ) local x2, y2, z2 = getElementPosition ( v ) if ( type( x ) == "number" and type ( y ) == "number" and type ( z ) == "number" ) then if ( type ( x2 ) == "number" and type ( y2 ) == "number" and type ( z2 ) == "number" ) then local dist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) local defdd = 6 if ( dist < 6 ) then local scx, scy = getScreenFromWorldPosition ( x2, y2, z2 + 1 ) if isLineOfSightClear ( x, y, z, x2, y2, z2, true, false, false, false ) then local scale = 2 * ( ( defdd - dist ) / defdd ) local level = getElementData ( v, "Job" ) exports["SRNJobs"]:dxDrawBorderedText( level, scx, scy, scx, scy, tocolor ( 255, 255, 0, 255 ), scale, "default-bold", "center", "center", false, false, false ) end end end end end end end end Link to comment
K4stic Posted June 7, 2013 Share Posted June 7, 2013 Just Idea because error saying line 12 local defdd = 6 if ( dist < 6 ) then make it like 10 no 6 Link to comment
xXMADEXx Posted June 7, 2013 Author Share Posted June 7, 2013 Just Idea because error saying line 12 local defdd = 6 if ( dist < 6 ) then make it like 10 no 6 6 is just the max distance you can see it... Its something do do with "local x, y, z = getElementPosition ( localPlayer )' 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