Seat Shuffle
This is a stand-alone script that allows you to jump from seat to seat. I tried to make it as clean looking as possible but without the ability to disable the native seat shuffle when there is no driver, it made it very difficult.
Just tested it. With one thread I would need to run everything every millisecond because of the keybinds. So technically this would be faster with the two.
But in the first thread you try to catch a keypress / nonkeypress too.
So you need to check it everytick too so you have to use citizen
.wait(0) instead of citizen.wait(500) otherwise your if statement with ānot controlpressā is useless because you can not catch it if you didnt check it every tick.
Actually its everytime false because you can not check if the ControlIsPressed or not.
Citizen.CreateThread(function()
while true do
if (IsControlPressed(0, 21) and IsControlJustPressed(0, 26)) then
TaskShuffleToNextVehicleSeat(GetPlayerPed(PlayerId()), GetVehiclePedIsIn(GetPlayerPed(PlayerId())))
end
if (IsControlPressed(1, 25) or IsControlPressed(1, 24)) then
if (IsShuffling()) then
SetPedIntoVehicle(GetPlayerPed(PlayerId()), GetVehiclePedIsIn(GetPlayerPed(PlayerId())), GetSeatPedIsIn(GetPlayerPed(PlayerId())))
end
end
Citizen.Wait(0)
end
end)
Btw, nice code and nice standalone release cheers.
Great job! Would be great if you can release a version that disable by default the seat shuffle when the car is empty (if i enter by the passenger seat, i should stay there.)