Having problems with sequences

I have tried a dozen times to get this sequence to work but it just never does. I have pretty much copied code directly from native scripts but it still doesn’t want to work.

Citizen.CreateThread(function()
    local seq = 0

    OpenSequenceTask(seq)
    TaskJump(0, 1)
    CloseSequenceTask(seq)

    TaskPerformSequence(GetPlayerPed(-1), seq)
    ClearSequenceTask(seq)
end)

Note: 0 is suppose to replace peds if you are creating a sequence but it throws an error when I do set it to 0.

[  20016562] fx::TestScriptHost::InvokeNative: execution failed: Error executing native 0x0ae4086104e067b1 at address 0x140a2d96e.
[  20016562] Initial SpawnError resuming coroutine: Execution of native 0ae4086104e067b1 in script host failed.
[  20016562] stack traceback:
[  20016562] 	[C]: in upvalue '_in'
[  20016562] 	citizen:/scripting/lua/natives_21e43a33.lua:1747: in function 'TaskJump'
[  20016562] 	client/cl_arrest.lua:6: in function <client/cl_arrest.lua:2>

also OpenSequenceTask() is suppose to take an integer argument but in natives.lua it doesn’t say it does. Same with ClearSequenceTask()

For reference

Native script: https://paste.ofcode.org/VwtjMUZ7nw4SKf8LQJVqqW

Some other script: http://gtaforums.com/topic/819828-task-sequence/

Our natives.lua gets automatically generated from NativeDB, and that had the wrong definition at the time.

Try just mapping it by yourself:

function CustomTaskJump(ped, unused, flag1, flag2)
    return Citizen.InvokeNative(0x0AE4086104E067B1, ped, unused, flag1, flag2)
end

I can get the ped to jump without a problem, the real problem is making a sequence, it just doesn’t do anything when I run the sequence on a ped.