Jump to content

Moving images in a vehicle


Argom

Recommended Posts

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
 

Link to post

@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 by IIYAMA
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...