add this in any client side lua
I put mine in qbx smallresources
makes the player go into first person POV when shooting from a vehicle
if on a motorcycle they go FP and can not use the throttle
I didnt create this saw it a long time ago and figured id share it here too
--first person vehicle shooting
local VehicleFP = true
local BikeFP = true
if VehicleFP then
CreateThread(function()
while true do
sleep = 1000
if IsPedInAnyVehicle(PlayerPedId()) then
sleep = 1
if IsControlJustPressed(0, 25) then
SetFollowVehicleCamViewMode(3)
elseif IsControlJustReleased(0, 25) then
SetFollowVehicleCamViewMode(0)
end
end
Wait(sleep)
end
end)
end
if BikeFP then
CreateThread(function()
while true do
sleep = 1000
local _, weapon = GetCurrentPedWeapon(PlayerPedId())
local unarmed = `WEAPON_UNARMED`
if IsPedOnAnyBike(PlayerPedId()) and weapon ~= unarmed then
sleep = 1
if IsPlayerFreeAiming(PlayerId()) then
--HideHudComponentThisFrame(14)
DisableControlAction(1, 71, true) --Key: W (veh_accelerate)
end
else
sleep = 1000
end
Wait(sleep)
end
end)
end```