Is ti possible to disable the autoaiming for the player who's playing with a controller

As the title says I would like to disable the “auto aiming” for the player who’s playing with a controller, anyone have a clue?

2 Likes

SET_PLAYER_TARGETING_MODE(int targetMode);

Maybe that will help

Sets your targeting mode.
0 = Traditional GTA
1 = Assisted Aiming
2 = Free Aim

2 Likes

Maybe with that native ? https://runtime.fivem.net/doc/natives/#_0xB1906895227793F3
Like if you do

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		SetPlayerTargetingMode(2)
	end
end)

I tried by setting to 0 (Traditional GTA) but won’t work and the 2 work

3 Likes

Nope don’t work
EDIT: I tried all of the parameters on my controller

3 Likes

// 0x29961D490E5814FD 0x74D42C03
// SetPlayerLockonRangeOverride
void SET_PLAYER_LOCKON_RANGE_OVERRIDE(Player player, float range);

Set the range to 0.0?

Gonna try it on lua wait…

1 Like

I will try it too :slight_smile: thanks guys

1 Like

Seems to work

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		SetPlayerLockonRangeOverride(PlayerId(), 0.0)
	end
end)
1 Like

Sweet.

3 Likes

I found a better way just do

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		SetPlayerLockon(PlayerId(), false)
	end
end)
6 Likes

Or just do that. What if you spam the aim button? Does it move the aim at all?

Nope it don’t move aim it work men i tried multiple time by restarting resource

2 Likes

Great I love you guys :heart:

1 Like

Awesome.

Guys you just shared an incredible native :stuck_out_tongue:

2 Likes

thx men

2 Likes

The natives people overlook are always the ones needed.

RIP you can’t hit AI with melee attack because of the lock on i modified it so when you have no weapon selected it reactivate lock on.

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if currentWeaponHash ~= -1569615261 then
        	SetPlayerLockon(PlayerId(), false)
        else
        	SetPlayerLockon(PlayerId(), true)
		end
	end
end)
4 Likes

where do I put this script sir?
I badly needed this on my server. I dont want my player to use any auto aiminng to be fair to other players

2 Likes

did you solved? i need this too