Jump to content

help; removePedFromVehicle


Never014

Recommended Posts

  1. 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
  1. addCommandHandler('out'
  2.  function ( thePlayer )
  3.     local vehicle =  getPedOccupiedVehicle ( thePlayer )  
  4.         if vehicle then
  5.             for i = 0,getVehicleMaxPassengers ( vehicle ) do
  6.                 local getPlayer = getVehicleOccupant( vehicle, i )
  7.                     if thePlayer and getPlayer and getPlayer ~= thePlayer then
  8.                     removePedFromVehicle( getPlayer )
  9.                 end
  10.             end
  11.         end
  12.     end
  13. )
  14.  
  • Thanks 1
Link to comment
On 28/07/2018 at 20:51, Berko said:
  1. addCommandHandler('out'
  2.  function ( thePlayer )
  3.     local vehicle =  getPedOccupiedVehicle ( thePlayer )  
  4.         if vehicle then
  5.             for i = 0,getVehicleMaxPassengers ( vehicle ) do
  6.                 local getPlayer = getVehicleOccupant( vehicle, i )
  7.                     if thePlayer and getPlayer and getPlayer ~= thePlayer then
  8.                     removePedFromVehicle( getPlayer )
  9.                 end
  10.             end
  11.         end
  12.     end
  13. )
  14.  

Thanks bro

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