player.force_into_vehicle

Force a player into a vehicle if any seat is available.

Arguments

vehicle

The vehicle to force the player into.

Example

--
-- Force players into Sabres.
--
for each player do
   --
   -- First, let's make sure the player is actually spawned on the map.
   --
   if current_player.biped != no_object then
      global.object[0] = current_player.get_vehicle()
      if global.object[0] == no_object then
         global.object[0] = current_player.biped.place_at_me(sabre, none, none, 0, 0, 0, none)
         current_player.force_into_vehicle(global.object[0])
      end
   end
end

Notes

See also