Hey there, me again
i’m searching a way to turn the spawn direction of the vehicle i Spawn with this script :
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
DrawMarker(1, 2394.40, 4983.22, 44.21, 0, 0, 0, 0, 0, 0, 2.001, 2.0001, 0.5001, 0, 155, 255, 200, 0, 0, 0, 0)
if GetDistanceBetweenCoords(2394.40, 4983.22, 44.21, GetEntityCoords(LocalPed())) < 1 then
drawTxt('Press ~g~H~s~ to spawn a ~b~Truck', 2, 1, 0.5, 0.8, 0.6, 255, 255, 255, 255)
if IsControlJustPressed(1, Keys["H"]) then
InitMenuHelico()
Menu.hidden = not Menu.hidden
end
end
Menu.renderGUI()
end
end)
RegisterNetEvent('farmg:c_classic')
AddEventHandler('farmg:c_classic', function()
Citizen.Wait(0)
local myPed = GetPlayerPed(-1)
local player = PlayerId()
local vehicle = GetHashKey('trailers3')
RequestModel(vehicle)
while not HasModelLoaded(vehicle) do
Wait(1)
end
local plate = math.random(100, 900)
local coords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0, 15.0, 0)
local spawned_car = CreateVehicle(vehicle, coords, 2407.10864257813, 4958.5146484375, 44.6461868286133, true, false)
SetVehicleOnGroundProperly(spawned_car)
--SetPedIntoVehicle(myPed, spawned_car, - 1)
SetModelAsNoLongerNeeded(vehicle)
Citizen.InvokeNative(0xB736A491E64A32CF, Citizen.PointerValueIntInitialized(spawned_car))
end)
Any Idea on how i can turn the spawn or make a more sharp/exact spawn of vehicle ?
Thanks for help.