Just wondering if there is a server side script out there or anyone can make that locks camera horizontal or vertical just like the lambda menu.
Looking at the code of Lambda, this can be directly ported from lambda to lua.
// Relative horizontal locak float relhor = CAM::GET_GAMEPLAY_CAM_RELATIVE_HEADING(); CAM::SET_GAMEPLAY_CAM_RELATIVE_HEADING(relhor); //Relative vertical lock float relvert = CAM::GET_GAMEPLAY_CAM_RELATIVE_PITCH(); CAM::SET_GAMEPLAY_CAM_RELATIVE_PITCH(relvert, 0.0f);
If we would convert to Lua it would look something like this:"
local lockHorizontal = false local lockVertical = false Citizen.CreateThread(function() while true do if lockHorizontal then local heading = GetGameplayCamRelativeHeading() SetGameplayCamRelativeHeading(heading) end if lockVertical then local pitch = GetGameplayCamRelativePitch() SetGameplayCamRelativePitch(pitch, 0.0f) end Citizen.Wait(1) end end)
Up to you on how to set the “lockVertical” and “lockHorizontal” variables, set to true will cause the desired axis to be locked.
The code was writting without being tested, may have some errors*
i have used this to make a script and even add it to exsisting and it doesnt seem to work