I added them to the IsDead check, where it disables your controls when you die.
As well as to the use item functionality, since it seems to be disabling your controls when applying a bandage or medkit.
Those two lines will re-enable the camera for when using the items.
But not when you’re dead.
So I’m starting to think this may be a deeper game related thing? And not related to any script? Or like a core script or something?
To allow a player to rotate the camera when dead you need to revive the player then force them to either play an animation or ragdoll so that they look like they are “dead” and make them invincible so they cannot get killed again while being “dead”
By default, in FiveM, dead players are not able to rotate their camera. However, you can modify the game’s behavior to allow dead players to rotate their camera by adding a small piece of code to your FiveM server script.
Here’s an example of how you could modify the camera behavior for dead players in your FiveM server script:
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = GetPlayerPed(-1)
if IsEntityDead(playerPed) then
SetFollowPedCamViewMode(4)
end
end
end)
This code creates a new thread that runs continuously while the game is running. Inside the thread, it checks whether the player’s character is dead by calling the IsEntityDead function. If the player is dead, the camera’s follow mode is set to mode 4, which allows the player to rotate their camera freely.
To use this code in your own FiveM server, simply add it to your server script and restart your server. Note that this modification may affect the gameplay balance and may need to be adjusted depending on your server’s rules and gameplay mechanics.