Piorun Posted May 30, 2013 Posted May 30, 2013 Is this possible to create 3D hud? I tried with getScreenFromWorldPosition and dxDrawMaterialLine3D but it doesnt work. Any ideas?
Piorun Posted May 30, 2013 Author Posted May 30, 2013 or another question - could anyway send me here an algoritm to create something (np. marker) on the left side of a player. I think this should be made with sinus, cosinus or something like that.
Moderators IIYAMA Posted May 31, 2013 Moderators Posted May 31, 2013 most of the dx functions require the event's "onClientRender" or "onClientPreRender". 3D hud will be hard. But I don't think it will be impossible. 2: to the left side of the player or left side of the screen? There are some attachment functions, for attach things to other things. https://wiki.multitheftauto.com/wiki/AttachElements https://wiki.multitheftauto.com/wiki/Se ... hedOffsets Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Piorun Posted May 31, 2013 Author Posted May 31, 2013 To the left side of a Player. Anyway i dont want to attach element to Player but create something "near" Player. Something like i type "/create marker" and it create marker in the front of the player.
Moderators IIYAMA Posted May 31, 2013 Moderators Posted May 31, 2013 local rx,ry,rz = getElementRotation (element) local pX,pY,pZ = getElementPosition (element) rz = (rz * 3.141592653 * 2)/360; local newX,newY,newZ = pX + math.cos(rz), pY + math.sin(rz), pZ Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Piorun Posted June 1, 2013 Author Posted June 1, 2013 rz = (rz * 3.141592653 * 2)/360; - are those radians, right? I think I forget about it. Thanks dude.
50p Posted June 1, 2013 Posted June 1, 2013 Yes, you can use math.rad() instead: local newX,newY,newZ = pX + math.cos( math.rad( rz ) ), pY + math.sin( math.rad( rz ) ), pZ - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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