Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warping peds into falling vehicle not working server side #2971

Open
aka-lucifer opened this issue Nov 30, 2024 · 0 comments
Open

Warping peds into falling vehicle not working server side #2971

aka-lucifer opened this issue Nov 30, 2024 · 0 comments
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action

Comments

@aka-lucifer
Copy link

aka-lucifer commented Nov 30, 2024

What happened?

No matter how many times it's called, peds will not spawn or warp into entities on the server side that are in free fall (only tested with ServerSetter) vehicles created, essentially falling from the sky which you would do to randomly handling spawning planes

The logic works on client, but not server calls.

Client Code

RegisterCommand("entitytest", function()
    local coords = vec4(-309.05, 7903.28, 1418.78, 170.4)
    RequestModel(`sultan2`)
    while not HasModelLoaded(`sultan2`) do
        RequestModel(`sultan2`)
        Wait(100)
    end
    
    local ped = CreatePed(1, `s_m_y_pilot_01`, coords.x, coords.y, coords.z, coords.w, true, false)
    local entity = CreateVehicle(`sultan2`, coords.x, coords.y, coords.z, coords.w, true, false)
    while not DoesEntityExist(entity) do Wait(0) end
    while GetPedInVehicleSeat(entity, -1) ~= ped do -- Works on first call as expected
        TaskWarpPedIntoVehicle(ped, entity, -1)
        print("send into seat")
        Wait(100)
    end
end, false)

Server Code (only works once entity is on level ground)

local config = { spawnCoords = vec4(-309.05, 7903.28, 1418.78, 170.4) }
local ped = CreatePed(1, `s_m_y_pilot_01`, config.spawnCoords.x, config.spawnCoords.y, config.spawnCoords.z, config.spawnCoords.w, true, false)
local entity = CreateVehicleServerSetter(`sultan2`, "automobile", config.spawnCoords.x, config.spawnCoords.y, config.spawnCoords.z, config.spawnCoords.w)
while not DoesEntityExist(entity) do Wait(0) end
-- Tried SetPedIntoVehicleSeat and CreatePedInsideVehicle
while GetPedInVehicleSeat(entity, -1) ~= ped do -- Just constantly loops as it doesn't process it
    TaskWarpPedIntoVehicle(ped, entity, -1)
    print("send into seat")
    Wait(100)
end

Expected result

Should place ped into vehicle upon call

Reproduction steps

Just use the code I provided running game build 3095 and server build (b10573)

Importancy

Slight inconvenience

Area(s)

FiveM, FXServer, OneSync, Natives

Specific version(s)

FiveM Server Windows (b10573)

Additional information

No response

@aka-lucifer aka-lucifer added bug triage Needs a preliminary assessment to determine the urgency and required action labels Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

1 participant