Hello there, so far i’ve made significant progress on developing server from scratch. Before moving onto next steps, I would like to solve one problém, though.
I need to spawn vehicle on closest node relevant to player’s position. This is what I’ve got, but it spawns vehicle on the same position, no matter what player’s pos is.
if (yourcar) then
TaskWarpPedIntoVehicle(GetPlayerPed(-1), yourcar)
else
--PATHFIND::GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADING(position.X, position.Y, position.Z, index, &outVec, &heading, unk, 9, 3.0, 2.5);
local vecout
local headout
local node = GetClosestVehicleNodeWithHeading(x,y,z,vecout,headout,8,4,3.0,4)
yourcar = CreateVehicle(vehiclehash, vecout, headout, 1, 0)
SetVehicleOnGroundProperly(yourcar)
SetVehicleColours(yourcar, colorindex, colorindex)
SetVehicleModKit(yourcar, 0)
SetVehicleMod(yourcar,0,mod1)
SetVehicleMod(yourcar,1,mod2)
SetVehicleMod(yourcar,2,mod3)
SetVehicleMod(yourcar,3,mod4)
SetVehicleMod(yourcar,4,mod5)
SetVehicleMod(yourcar,5,mod6)
SetVehicleMod(yourcar,6,mod7)
SetVehicleMod(yourcar,7,mod8)
SetVehicleMod(yourcar,8,mod9)
SetVehicleMod(yourcar,9,mod10)
SetVehicleMod(yourcar,10,mod11)
TriggerServerEvent("playerCar",yourcar)
end
Thanks in advance.