ODutii Posted July 27, 2019 Share Posted July 27, 2019 I can't make the script, so when the player dies, the vehicle is destroyed, it helps! Link to comment
' A F . Posted July 27, 2019 Share Posted July 27, 2019 local plrV = { } addEventHandler ( "onResourceStart" , resourceRoot , function ( ) for k,v in ipairs ( getElementsByType ( "player" ) ) do if ( getPedOccupiedVehicle ( v ) and getVehicleController ( getPedOccupiedVehicle ( v ) ) == v ) then plrV[v] = getPedOccupiedVehicle(v) end end end ) ; addEventHandler ( "onVehicleStartEnter",root,function(player,seat) if ( seat == 0 ) then plrV[player] = source end end) addEventHandler("onPlayerVehicleExit",root,function(player,seat) if ( seat == 0 ) then plrV[player] = nil end end ) addEventHandler ( "onPlayerWasted" , root , function ( ) if ( plrV[source] and isElement(plrV[source]) ) then destroyElement ( plrV[source] ) ; plrV[source] = nil end end ) ; 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