Never014 Posted July 28, 2018 Share Posted July 28, 2018 local aVehicle = getPedOccupiedVehicle( plr ) if ( not aVehicle ) then return end local aPlayersInVehicle = getVehicleOccupants ( aVehicle ) for i = 0 , #aPlayersInVehicle do if ( aPlayersInVehicle [ i ] and getElementType( aPlayersInVehicle [ i ] ) == "player" ) then removePlayerFromVehicle ( aPlayersInVehicle [ i ] ) I want to write a thing, drive a player out of a car.. Link to comment
Berko Posted July 28, 2018 Share Posted July 28, 2018 addCommandHandler('out', function ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then for i = 0,getVehicleMaxPassengers ( vehicle ) do local getPlayer = getVehicleOccupant( vehicle, i ) if thePlayer and getPlayer and getPlayer ~= thePlayer then removePedFromVehicle( getPlayer ) end end end end ) 1 Link to comment
Never014 Posted August 4, 2018 Author Share Posted August 4, 2018 On 28/07/2018 at 19:51, Berko said: addCommandHandler('out', function ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then for i = 0,getVehicleMaxPassengers ( vehicle ) do local getPlayer = getVehicleOccupant( vehicle, i ) if thePlayer and getPlayer and getPlayer ~= thePlayer then removePedFromVehicle( getPlayer ) end end end end ) Expand Thanks bro 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