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

SetPedAnalogControlState vehicle_left/right #1026

Open
tomasz-mizak opened this issue Jul 16, 2019 · 0 comments
Open

SetPedAnalogControlState vehicle_left/right #1026

tomasz-mizak opened this issue Jul 16, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@tomasz-mizak
Copy link

tomasz-mizak commented Jul 16, 2019

When you set to ped SetPedAnalogControlState(ped, "vehicle_left", 0) you can use only vehicle left control state, right control state not work.

sample code for testing (vehicle don't turn right if vehicle_left control is the first setting to 0):

local controls = { "vehicle_left", "vehicle_right", "steer_forward", "steer_back", "accelerate", "brake_reverse", "handbrake" }


function tracking()
    local veh = Vehicle(getVehicleIDFromName("elegy"), Vector3(localPlayer.position))
    veh:setRotation(Vector3(localPlayer.rotation))

    local ped = Ped(0, 0, 0, 0)
    warpPedIntoVehicle(ped, veh)

    addEventHandler("onClientRender", root, function()
    
        for i, v in ipairs(controls) do
            setPedAnalogControlState(ped, v, getAnalogControlState(v))
        end

    end)

end

bindKey("b", "down", tracking)
@tomasz-mizak tomasz-mizak added the bug Something isn't working label Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant