Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Only Full Auto Mode

Christopher M edited this page Apr 30, 2020 · 2 revisions

Only Full Auto Mode

Adding a custom fire mode to only have safety and full auto

  1. Open your client.lua file

  2. Find these lines near the top of the file:

-- These weapons will have their reticle enabled
Config.Weapons.Reticle = {
	'WEAPON_SNIPERRIFLE',
	'WEAPON_HEAVYSNIPER',
	'WEAPON_HEAVYSNIPER_MK2',
	'WEAPON_MARKSMANRIFLE',
	'WEAPON_MARKSMANRIFLE_MK2',
	'WEAPON_STUNGUN'
}
  1. Add these lines below the above lines, and add the weapons you want to have only safety and full auto modes:
Config.Weapons.Custom = {

}
  1. Find these lines near the middle of the file:
-- If weapon was not found in full auto loop
if not Active then
	-- Loop though all the weapons that require a reticle
	for _, Weapon in ipairs(Config.Weapons.Reticle) do
		-- If weapon is in list
		if GetHashKey(Weapon) == PedWeapon then
			-- Set weapon type to full
			Active = 'reticle'
			break
		end
	end
end
  1. Add these lines below the above lines:
if not Active then
	for _, Weapon in ipairs(Config.Weapons.Custom) do
		if GetHashKey(Weapon) == PedWeapon then
			Active = 'custom'
			break
		end
	end
end
  1. Find these lines near the middle of the file:
if Active == 'full' then
    if FireMode.Weapons[PedWeapon] <= 2 then
        ...
    elseif FireMode.Weapons[PedWeapon] >= 3 then
        ...
    end
else
    if FireMode.Weapons[PedWeapon] == 0 then
        ...
    elseif FireMode.Weapons[PedWeapon] >= 1 then
        ...
    end
end
  1. Replace those lines with these lines:
if Active == 'full' then
    if FireMode.Weapons[PedWeapon] <= 2 then
        if FireMode.Weapons[PedWeapon] == 0 then
            NewNUIMessage('NewMode', 'single')
        elseif FireMode.Weapons[PedWeapon] == 1 then
            NewNUIMessage('NewMode', 'burst')
        elseif FireMode.Weapons[PedWeapon] == 2 then
            NewNUIMessage('NewMode', 'full_auto')
        end
        PlaySoundFrontend(-1, 'Faster_Click', 'RESPAWN_ONLINE_SOUNDSET', 1)
        FireMode.Weapons[PedWeapon] = FireMode.Weapons[PedWeapon] + 1
    elseif FireMode.Weapons[PedWeapon] >= 3 then
        NewNUIMessage('NewMode', 'safety')
        PlaySoundFrontend(-1, 'Reset_Prop_Position', 'DLC_Dmod_Prop_Editor_Sounds', 0)
        FireMode.Weapons[PedWeapon] = 0
    end
elseif Active == 'custom' then
    if FireMode.Weapons[PedWeapon] == 0 then
        NewNUIMessage('NewMode', 'full_auto')
        PlaySoundFrontend(-1, 'Reset_Prop_Position', 'DLC_Dmod_Prop_Editor_Sounds', 0)
        FireMode.Weapons[PedWeapon] = 3
    elseif FireMode.Weapons[PedWeapon] >= 1 then
        NewNUIMessage('NewMode', 'safety')
        PlaySoundFrontend(-1, 'Faster_Click', 'RESPAWN_ONLINE_SOUNDSET', 1)
        FireMode.Weapons[PedWeapon] = 0
    end
else
    if FireMode.Weapons[PedWeapon] == 0 then
        NewNUIMessage('NewMode', 'single')
        PlaySoundFrontend(-1, 'Reset_Prop_Position', 'DLC_Dmod_Prop_Editor_Sounds', 0)
        FireMode.Weapons[PedWeapon] = FireMode.Weapons[PedWeapon] + 1
    elseif FireMode.Weapons[PedWeapon] >= 1 then
        NewNUIMessage('NewMode', 'safety')
        PlaySoundFrontend(-1, 'Faster_Click', 'RESPAWN_ONLINE_SOUNDSET', 1)
        FireMode.Weapons[PedWeapon] = 0
    end
end
  1. Save and close the file, restart your server, and enjoy.

If you have any troubles, suggestions, feedback, etc, please check the Wiki, create a new issue, and/or contact us on Discord.

Clone this wiki locally