Remove crosshair?

Have the same issue, do you have any idea how to fix this?

I never got around to testing this I’ve been busy for the last few weeks.
@Benni0902

Tried it, but is not working :confused:

I’ll try this out thanks for posting that fix.

Anyone found a fix it only functioning correctly on the first client?

Same here, I’ve tried multiple things and lines, but it rather works only for the first client or the other ones doesn’t support the Scope of snipers

@Khlowd @Benni0902
Yeah this has been fixed and it’s working fine for all clients on my server for a while now.
There was another thread where someone posted the fix, if I could remember their name or find the thread I’d give them the credit they deserve. But this worked for us, the original author of the script is @WolfKnight179
This does remove the reticle to the sniper rifle, you can still zoom in on the scope but there is no dot crosshair.

--[[------------------------------------------------------------------------
    Remove Reticle on ADS (Third Person)
------------------------------------------------------------------------]]--
local scopedWeapons = 
{
    100416529,  -- WEAPON_SNIPERRIFLE
    205991906,  -- WEAPON_HEAVYSNIPER
    3342088282  -- WEAPON_MARKSMANRIFLE
}

function HashInTable( hash )
    for k, v in pairs( scopedWeapons ) do 
        if ( hash == v ) then 
            return true 
        end 
    end 

    return false 
end 

function ManageReticle()
    local ped = GetPlayerPed( -1 )

    if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
        local _, hash = GetCurrentPedWeapon( ped, true )

        if ( GetFollowPedCamViewMode() ~= 4 and IsPlayerFreeAiming() and not HashInTable( hash ) ) then 
            HideHudComponentThisFrame( 14 )
        end 
    end 
end 

Citizen.CreateThread( function()
    while true do 
	
		HideHudComponentThisFrame( 14 )		
		Citizen.Wait( 0 )

    end 
end )

is there a way to make this so you can not remove it if there hex id is in the list so i can have it avalible to law enforcement but not to players.

How to install this?

So I’m a complete idiot to this stuff, how do I install this script into my server? I assume I put it in a txt file and place it somewhere? Where do I place it?

See here, You have got complete script. :wink:

It works fine, but it remove crosshair for sniper rifle too. I copied script but “scoped weapons” still doesn’t have crosshair.

@PietREKT - Try this. I remember how over complicated I was trying to make it when I wrote this and ended up with this very short simple script that hides cross hair in all cases except when aiming down a scope.

Citizen.CreateThread(function()
    while true do
        if not IsAimCamActive() or not IsFirstPersonAimCamActive() then
            HideHudComponentThisFrame(14)
        end
        Citizen.Wait(0)
    end
end)
3 Likes

Hey guys. I’ve tried to implement the codes you have shared but there was no effect in game. The stupid dot was still appearing and yet I am trying to install it on server-side as I do not want it client-sided. Any ideas ?

As these are client natives you can only run this from a client script. I actually see no use case for the server to need to be granting permission to the client or even becoming aware that a client is running this.

I see scripts everywhere, but dont know how to use these, should i put this in a resource folder named _resource.lua & add the name on the server.cfg ?

Hello or should I add the script plz

could you walk me trough those steps , im kind of new in this and i dont have that much knowledge

where do i put this code?

Use (setr cl_customCrosshair false) in server.cfg to disable crosshair