[Help] Iron Sights

Hi Guys,

Will hope to receive some guidance on how to force players to use iron sights whenever they aim.
Is there any specific native that enforces that?

you just want to force people into first person when they aim. Would need to do a check for IsPlayerFreeAiming and if true change to first person. Will need to check if already in first person or not.

hope this points you in the right direction.

Actually i helped someone do this exact thing for his server… let me get his name and you can see if he would be willing to send the script over or not.

Send a msg to Exelsio. I helped him create a toggle for the script that I think you are looking for.

SpikE

hmm i already set everyone to be in first person just that i want to force them to use iron sights/scope when aiming.

ok… you mean only fire while aiming… not hip fire? or take away the dot?

Whenever players right click it goes to this instead of having to SCROLWHEEL

Just looking at the natives i would assume that SetPlayerForcedZoom to true would make it to always zoomed in… but then would need to know when player is aiming and i found IsFirstPersonAimCamActive which might help with that… but haven’t not done any teseting. Just some options for you to look into

Just looked ingame at the key bindings and it seems like what you want set is the Sniper / Camera Zoom it set to always true. so they can’t zoom out… but im not finding any native for camera zoom… might be under SetPlayerControl but very limited documentation on what the flags do for that native.

just have to keep trying i guess

Anyone able to help with this?

Did you manage to get this to work? I am working on a script where as people are only alowed to shoot when they aim down sight so I would need to check if they do so.

did anyone find a fix for this?

If you are trying to find a fix for this now you can find it here, simply go into your weapons.meta of the weapon find ‘weaponflags’ and paste FirstPersonScope DisableFPSAimForScope just how it is there into the flags, if you don’t know how to get a weapons.meta for custom weapons refer to GitHub - Hxrv3y/FiveM-Addon-Weapon-Tool-Kit: A tool that allows the creation of add-on weapons & add-on components with ease in GTA V/FiveM. or if you are using vanilla weapons create a new folder and drag any .meta file from snags resource at GitHub - CyCoSnag/snag_weapon_metas: A FiveM resource that allows server owners to change game weapon's metadata. This can be used to change damage, damage types, ammo count, defaults, camera angles, aiming, recoil, weapon effects, smoke effects, etc., I hope this helped.