Jump to content

[Help] Restrict Ejecting while the area Above has an object.


Recommended Posts

Hi guys here is my basic eject script, it doesnt exactly sling shot the player up but warps the player by increasing his z value o his current coordinates,, and the movement of camera makes it look like the person has ejected from the vehicle, but the problem is as its getting warped sometimes if some roof or etc is above u , it looks as if u are going through a wall, so i need a way to restrict eject when the area above is not clear. :)

function eject( player )
    local vehicle = getPedOccupiedVehicle(player)
    local driver = getVehicleOccupant(vehicle, 0)
    local x,y,z = getElementPosition( vehicle )
    setElementVelocity(driver, 5, 5, 5)
    removePedFromVehicle(driver)
    setElementPosition ( driver,x, y, z + 100 )
    giveWeapon ( driver, 46, 1 )          
    end
addCommandHandler("eject", eject)
 

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