itHyperoX Posted June 27, 2019 Share Posted June 27, 2019 Hi, there is an object which is attached to a player cache['objectAttach'][client] = createObject(id, myX, myY, myZ) attachElements(cache['objectAttach'][client], client, 0, 0, 0) My question is, how can i change the Z cord if it's attached ? i was trying like local x, y, z = getElementPosition(client) newZ = z - 0.05 setElementPosition(cache['objectAttach'][client], x, y, newZ) but i don't think that i can change the attached object pos; any help thanks Link to comment
Moderators IIYAMA Posted June 27, 2019 Moderators Share Posted June 27, 2019 2 minutes ago, itHyperoX said: My question is, how can i change the Z cord if it's attached ? https://wiki.multitheftauto.com/wiki/SetElementAttachedOffsets 1 Link to comment
itHyperoX Posted June 27, 2019 Author Share Posted June 27, 2019 You are the best mate, one more question. How can i decrease / increase with 0.1 the Z player position after the player scrolling ? Link to comment
Moderators IIYAMA Posted June 27, 2019 Moderators Share Posted June 27, 2019 2 minutes ago, itHyperoX said: How can i decrease / increase with 0.1 the Z player position after the player scrolling ? By getting your previous values:https://wiki.multitheftauto.com/wiki/GetElementAttachedOffsets With bindkey: https://wiki.multitheftauto.com/wiki/BindKey Link to comment
itHyperoX Posted June 29, 2019 Author Share Posted June 29, 2019 Nice one thanks. Another question , is there any function, or something to check that is the object is still visible ? I mean when i change the Z pos (to down - ) of the object, i want to stop to the object go under the world Link to comment
Moderators IIYAMA Posted July 1, 2019 Moderators Share Posted July 1, 2019 The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size. The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size. 1 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