#RooTs Posted January 8, 2015 Share Posted January 8, 2015 I'm trying to put a distance to be displayed. someone please help me? my initial script local tx, ty, tz = 1955.03369, -1855.28638, 13.54688 addEventHandler("onClientRender", root, function() local x, y, z = getElementPosition(localPlayer) local sx, sy = getScreenFromWorldPosition(tx, ty, tz) dxDrawImage(sx, sy-50, 100, 100, "2.png") end) my final attempt and poorly organized local tx, ty, tz = 1955.03369, -1855.28638, 13.54688 addEventHandler("onClientRender", root, function() local x, y, z = getElementPosition(getLocalPlayer()) local cx, cy, cz, x, y, z, dist local x, y, z = getElementPosition( player ) local cx, cy, cz = getCameraMatrix( ) dist = math.sqrt( ( cx - x ) ^ 2 + ( cy - y ) ^ 2 + ( cz - z ) ^ 2 ) if dist < 20 then if isLineOfSightClear( cx, cy, cz, x, y, z, true, false, false, true, false, false, false,localPlayer ) then local x,y = getScreenFromWorldPosition( tx, ty, tz + 0.15 ) if x then dxDrawImage(x, y, 100, 100, "2.png", 0,0,0, tocolor(255, 255, 255, 150)) end end end end end) Link to comment
Castillo Posted January 8, 2015 Share Posted January 8, 2015 getDistanceBetweenPoints2D Link to comment
#RooTs Posted January 8, 2015 Author Share Posted January 8, 2015 getDistanceBetweenPoints2D perhaps an example can help me Link to comment
Castillo Posted January 8, 2015 Share Posted January 8, 2015 local tx, ty, tz = 1955.03369, -1855.28638, 13.54688 local maximumDistance = 50 addEventHandler ( "onClientRender", root, function ( ) local x, y, z = getElementPosition ( localPlayer ) local sx, sy = getScreenFromWorldPosition(tx, ty, tz) if ( getDistanceBetweenPoints2D ( x, y, tx, ty ) <= maximumDistance ) then dxDrawImage ( sx, sy-50, 100, 100, "2.png" ) end end ) Link to comment
#RooTs Posted January 8, 2015 Author Share Posted January 8, 2015 local tx, ty, tz = 1955.03369, -1855.28638, 13.54688 local maximumDistance = 50 addEventHandler ( "onClientRender", root, function ( ) local x, y, z = getElementPosition ( localPlayer ) local sx, sy = getScreenFromWorldPosition(tx, ty, tz) if ( getDistanceBetweenPoints2D ( x, y, tx, ty ) <= maximumDistance ) then dxDrawImage ( sx, sy-50, 100, 100, "2.png" ) end end ) Thanks man, I'm learning a lot from you .. Link to comment
#RooTs Posted January 8, 2015 Author Share Posted January 8, 2015 is normal the image increases the size as I distance myself from it? Link to comment
#RooTs Posted January 8, 2015 Author Share Posted January 8, 2015 Max distance Min Distance Link to comment
Castillo Posted January 8, 2015 Share Posted January 8, 2015 Yeah, that will happen, you need to resize it according to the distance. Link to comment
xeon17 Posted January 8, 2015 Share Posted January 8, 2015 If i remember well , i saw something like this already in a server called SAS NETWORK? Or i'm wrong? Copy will ever be a copy. Players like more to play in orginal than in a copy Link to comment
xeon17 Posted January 9, 2015 Share Posted January 9, 2015 Don't go off topic. I simply don't think it's a good idea to help someone to copy a other server, do whatever you want i'm out. Link to comment
#RooTs Posted January 9, 2015 Author Share Posted January 9, 2015 Don't go off topic. I simply don't think it's a good idea to help someone to copy a other server, do whatever you want i'm out. @XeoN- the, cool that you can practice my ideas, but do not? @Solidsnake14, I'm just naming my bases Link to comment
xeon17 Posted January 9, 2015 Share Posted January 9, 2015 I copy some your idea? hahahahaha, you are funny Grab the wiki and use some functions almost no one uses, make something different. If you look at CIT, don't copy them. If you're looking at SAUR or SAS Network, don't copy them. Not even a few details, not even ideas. Make things your own, like you're raising your own child. Remember, the most successful servers, always bring new ideas, not copies of other servers. Stop being stupid, he has said what you need to do, now do your part. I think you should try to do something, besides came up with ideas from other servers, and expect other people to do everything for you. 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