Jump to content

[HELP]Brake the Vehicle on Marker


Recommended Posts

hi, guys, i have tried all night long about this bug in my code... :(

I need the player trouch the marker with car and brake immediately , that is my code:

marker = createMarker(1219,-1812,13, "cylinder" , 4.0, 255, 255, 0, 170)

blip = createBlipAttachedTo(marker, 55)

addEventHandler("onClientMarkerHit",marker, action)

function action()

-- Action

end

the player's car touchs the marker and brake the car.

please, i need you help!, some function in wiki, or example thats help me a lot

thank you!

Link to comment

Server Side:

marker = createMarker(1219,-1812,13, "cylinder" , 4.0, 255, 255, 0, 170) 
blip = createBlipAttachedTo(marker, 55) 
  
addEventHandler("onMarkerHit", marker, 
function(hitElement) 
    if getElementType(hitElement) == "vehicle" then 
        blowVehicle(hitElement) 
    end 
end) 

Link to comment

You can set the velocity to zero, and freeze the vehicle or turn off the engine of the vehicle.

setElementVelocity(hitElement, 0, 0, 0) 

setElementFrozen(hitElement, true) 

setVehicleEngineState(hitElement, false) 

Link to comment

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