#RooTs Posted January 8, 2015 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)
Castillo Posted January 8, 2015 Posted January 8, 2015 getDistanceBetweenPoints2D San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#RooTs Posted January 8, 2015 Author Posted January 8, 2015 getDistanceBetweenPoints2D perhaps an example can help me
Castillo Posted January 8, 2015 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#RooTs Posted January 8, 2015 Author 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 ..
Castillo Posted January 8, 2015 Posted January 8, 2015 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#RooTs Posted January 8, 2015 Author Posted January 8, 2015 is normal the image increases the size as I distance myself from it?
Castillo Posted January 8, 2015 Posted January 8, 2015 Yeah, that will happen, you need to resize it according to the distance. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xeon17 Posted January 8, 2015 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 A unique GangWar gamemode waiting for you!Click here for more information.
Castillo Posted January 9, 2015 Posted January 9, 2015 Don't go off topic. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xeon17 Posted January 9, 2015 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. A unique GangWar gamemode waiting for you!Click here for more information.
#RooTs Posted January 9, 2015 Author 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
xeon17 Posted January 9, 2015 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. A unique GangWar gamemode waiting for you!Click here for more information.
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