razvan2299 Posted July 17, 2014 Share Posted July 17, 2014 Hello! So I wanted to make a image(badge, like GM's have) for admin duty. I can't....I know it's pretty easy but can I get some help? Link to comment
tosfera Posted July 17, 2014 Share Posted July 17, 2014 It's easy, loop trough all the players that are around you, get the distance, if they are close AND on the screen ( isElementOnScreen or something like that ) then get it's position, add something to the Z axis and done. ^^ Link to comment
razvan2299 Posted July 17, 2014 Author Share Posted July 17, 2014 Well, I tried. Nothing realy happend except a few errors. If I could get a beggining that would be awesome. Link to comment
tosfera Posted July 17, 2014 Share Posted July 17, 2014 addEventHandler ( "onClientRender", root, function () local x, y, z = getElementPosition ( getLocalPlayer() ); local dim = getElementDimension ( getLocalPlayer() ); for key, player in ipairs ( getElementsByType ( "player" ) ) do if ( ( isElement ( player ) ) and ( getElementDimension ( player ) == dim ) ) then local px, py, pz = getElementPosition ( player ); local distance = getDistanceBetweenPoints3D ( x, y, z, px, py, pz ); if ( isElementOnScreen ( player ) and ( distance < 20 ) ) then end end end end ); There you go, a small start. 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