Argom Posted September 2, 2020 Posted September 2, 2020 Hello, I have played a server in which you can place a modification in a car, which is to put certain images in motion and I wanted to know what is needed to be able to create moving images in a car
Moderators IIYAMA Posted September 2, 2020 Moderators Posted September 2, 2020 (edited) @Argom These are more or less the basic components for a not moving image, which can be enhanced with a moving image later on. (order matters): https://wiki.multitheftauto.com/wiki/DxCreateTexture function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end <function start> https://wiki.multitheftauto.com/wiki/GetLocalPlayer https://wiki.multitheftauto.com/wiki/GetPedOccupiedVehicle https://wiki.multitheftauto.com/wiki/GetElementMatrix x1, y1, z1 = getPositionFromElementOffset(vehicle, 0, 0, 0) x2, y2, z2 = getPositionFromElementOffset(vehicle, 3, 0, 0) https://wiki.multitheftauto.com/wiki/DxDrawMaterialLine3D <function end> https://wiki.multitheftauto.com/wiki/OnClientPreRender Edited September 2, 2020 by IIYAMA 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
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