Esx_eden_garage how to do taskwarp


#1

how can i make esx_eden_garage do TaskWarpPedIntoVehicle(GetPlayerPed(-1), vehicle, -1) when i get my car out so it will teleport me inside my vehicle that i get out


#2

Like you said…

local playerPed = GetPlayerPed(-1)
local vehicle = CreateVehicle....
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)

The local vehicle equals the vehicle you just created


#3

that didnt work if it works for you i guess i dont know where to place it


#4

anyone of you know how to stop cars from despawning while driving them while using eden garage also. how to I make modded cars as (replace) be able to be stored in the garage, thanks for any help anyone can provide.


#5

EDIT: Resolved.

Ive been having problems with this for a few days now.

I have tried implementing TaskWarp into this code, however it doesnt seem to work.
This is the main spawn vehicle function within eden_garage’s code.

function SpawnVehicle(vehicle)

	ESX.Game.SpawnVehicle(vehicle.model, {
		x = this_Garage.SpawnPoint.Pos.x ,
		y = this_Garage.SpawnPoint.Pos.y,
		z = this_Garage.SpawnPoint.Pos.z + 1											
		},120, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		end)
	TriggerServerEvent('maingarageOutput:modifystate', vehicle, false)

end

These are the changes ive made, and somehow am not teleported into the chosen vehicle.

function SpawnVehicle(vehicle)
	local playerPed = GetPlayerPed(-1) --NEW
	ESX.Game.SpawnVehicle(vehicle.model, {
		x = this_Garage.SpawnPoint.Pos.x ,
		y = this_Garage.SpawnPoint.Pos.y,
		z = this_Garage.SpawnPoint.Pos.z + 1											
		},120, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		TaskWarpPedIntoVehicle(playerPed, vehicle, -1) --NEW
		end)
	TriggerServerEvent('maingarageOutput:modifystate', vehicle, false)

end

Could anyone help me work this out?

Thanks in advance.