Jump to content

Warp Ped into vehicle, but near the player


Tomc0

Recommended Posts

Hello!

I have a little question. I made a script, the script teleports a ped into the player's vehicle, when the player hits the marker. But I have a problem with this. I want to teleport the ped near the player in the vehicle. Is it possible?

The code: (because maybe I made a mistake)

local ember = createPed ( 101, -1922.0999755859, 722.70001220703, 45.599998474121 ) -- ember = ped  
local ped_felvetel = createMarker ( -1921.9090576172, 724.75140380859, 44.81519317627, "corona", 1 ) -- the point where we need to pick up the ped (marker) 
  
function szallitas( thePlayer ) 
   local auto = getPedOccupiedVehicle ( thePlayer )  
   if auto then  
      warpPedIntoVehicle ( ember, auto )  
   else  
      outputChatBox("Szerezz egy autót!")  -- Szerezz egy autót means "Get a car!" (Hungarian languagE)  
   end  
end  
addEventHandler( "onMarkerHit", ped_felvetel, szallitas )  

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