TheGrimReaper Posted May 28, 2018 Share Posted May 28, 2018 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
MIKI785 Posted May 28, 2018 Share Posted May 28, 2018 Use isLineOfSightClear; first set of coordinates would be the vehicle and the second would be z+100 as in your code. You may also have to disable vehicle check. 1 Link to comment
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