Jump to content

Need some advice here


tigerman

Recommended Posts

Posted

Hey, im trying to make freeroam script for specific car, when u hit this car you will explode and also this car is moving..

i tryed with marker, attached it and then used onmarkerhit event but dint work, maybe some more ideas what should i use for this ?

  • Moderators
Posted

Hi tigerman,

When you attach a marker on a vehicle, the marker take the position of the vehicle also if you use offsets.

So create a marker ( don't hide during the test ) which is bigger than the vehicle and attach it to the vehicle.

Try to enter in the marker and if he doesn't work, try to go on the vehicle.

Tell me if you are detected and where.

  • Moderators
Posted

So create a setTimer like that:

  
local marker = createMarker( x, y, z, ... ) 
setElementID( marker, "marker1" ) 
setTimer( updateThePosition, 50, 0 ) 
  
function updateThePosition() 
    local veh = ... 
    local marker = getElementByID( "marker1" ) 
    if veh then 
        local x, y, z= getElementPosition( veh ) 
        if marker then 
            setElementPosition( marker, x, y, z ) 
        end 
    end 
end 
  

Try that

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...