Wert Weapon Racks (Deployable, Advanced)

You can access the setup information you need about this product

INSTALLATION

1 - Upload the script folder to the location of your resources

2 - Check config file for your own settings

3 - Please add the items to your list in the items section below

4 - Add the data inside the SQL extension file to your database.

5 - Installation successful, have a good funs

ITEMS

-- Default items

["rack_1"] = {
		["name"] = "rack_1",
		["label"] = "Gun Rack",
		["weight"] = 0,
		["type"] = "item",
		["image"] = "rack_1.png",
		["unique"] = true,
		["useable"] = true,
		["shouldClose"] = true,
		["combinable"] = nil,
		["description"] = ""
},
["rack_2"] = {
		["name"] = "rack_2",
		["label"] = "Gun Rack",
		["weight"] = 0,
		["type"] = "item",
		["image"] = "rack_2.png",
		["unique"] = true,
		["useable"] = true,
		["shouldClose"] = true,
		["combinable"] = nil,
		["description"] = ""
},

OX LIB OPTION

There are many ox settings available in the files, if you want, you can configure them.

If you want to use ox_lib, please check if this link is enabled on fxmanifest.check it out from inside lua. this must be turned on before you can use ox_lib. After opening it, it will be enough to use the refresh and ensure commands.

EXPORTS

Client side exports

-- # Current rack
local currentRack = exports['wert-gunrack']:GetCurrentRack()
-- Output : rack id like (default_rack_1, default_rack_2, default_rack_3 ... or others)

-- # Armed active
local isArmed = exports['wert-gunrack']:ArmedActive()
-- You can check whether the player is at the stage of placing the weapon on the rack
-- Output : isArmed = wep object (entity) | If you want control you can use like this if isArmed then print("Player armed") else print("Player not armed") end

-- # Placement Active
local inPlacement = exports['wert-gunrack']:PlacementActive()
-- You can check whether the player is at the stage of placing a rack
-- Output : boolean

-- # IN Rack ui
local inPlacement = exports['wert-gunrack']:InRackUI()
-- You can check whether the player is in the weapon rack interface.
-- Output : boolean

OPEN FILES

Config = {}

Config.OxInventory = true -- If you use ox inventory please set true
Config.OxLib = true
Config.UseTarget = true
Config.RackTargetDistance = 1.5
Config.DebugPoly = false
Config.PutWeaponDistance = 1.8
Config.EnableOutline = true
Config.OutlineColor = {255, 255, 255, 255}
Config.InRackOutlineColor = {69, 250, 61, 255}
Config.DefaultRotation = {0.0, -90.0, 0.0}
Config.WhenRemoveRackGiveBackItem = true

Config.ChangeSlotKeys = {
    left = 174,
    right = 175,
}
Config.PutRackkey = 38
Config.NoTargetInteractKey = 47 -- Default [G]

Config.DefaultIcon = 'fa-regular fa-hand'
Config.RemoveRackIcon = "fa-regular fa-trash-can"

Config.RackSettings = {
    [`prop_cs_gunrack`] = {
        slots = {
            {-0.572, 0.0, 0.06},
            {-0.445, 0.0, 0.06},
            {-0.317, 0.0, 0.06},
            {-0.190, 0.0, 0.06},
            {-0.063, 0.0, 0.06},
            {0.064, 0.0, 0.06},
            {0.195, 0.0, 0.06},
            {0.322, 0.0, 0.06},
            {0.449, 0.0, 0.06},
            {0.576, 0.0, 0.06}
        },
        special = {
            -- Through this table, you can provide visual completeness by editing the y and z offset values of weapons that do not fit perfectly on the shelf.
            groups = {
                -- Gun groups, You can set specific y and z offset value for each weapon group 
                -- Gun Groups : https://docs.fivem.net/natives/?_0xC3287EE3050FB74C
                -- Example :
                [`GROUP_PISTOL`] = {y = 0.0, z = -0.18},
            },
            models = {
                -- Gun hashes, You can set spesific y and z offset value for each weapon
                -- Note : Even if a pistol group is entered above, it will use it because a special value is specified for the model here.
                -- [`weapon_pistol`] = {y = 0.0, z = -0.18},
                [`weapon_stungun`] = {y = 0.0, z = -0.22},
            }
        },
    },
    [`xm_prop_xm_gunlocker_01a`] = {
        slots = {
            {-0.400, 0.0, 0.9},
            {-0.290, 0.0, 0.9},
            {-0.170, 0.0, 0.9},
            {-0.060, 0.0, 0.9},
            {0.055, 0.0, 0.9},
        },
        special = {
            -- Through this table, you can provide visual completeness by editing the y and z offset values of weapons that do not fit perfectly on the shelf.
            groups = {
                -- Gun groups, You can set specific y and z offset value for each weapon group 
                -- Gun Groups : https://docs.fivem.net/natives/?_0xC3287EE3050FB74C
                -- Example :
                [`GROUP_PISTOL`] = {y = 0.0, z = 0.7},
                [`GROUP_RIFLE`] = {y = 0.0, z = 0.78},
            },
            models = {
                -- Gun hashes, You can set spesific y and z offset value for each weapon
                -- Note : Even if a pistol group is entered above, it will use it because a special value is specified for the model here.
                -- [`weapon_pistol`] = {y = 0.0, z = -0.18},
                [`weapon_stungun`] = {y = 0.0, z = 0.65},
            }
        },
    },
}

Config.DefaultRacks = {
    -- If you want add default racks here like example template
    -- Polices
    {
        id = "default_rack_1", -- IMPORTANT = If you want save weapons for after restart (server or script) you need set correct this (Each rack must have different id)
        model = `prop_cs_gunrack`,
        coord = vector4(480.43, -996.76, 30.0, 91.0),
        job = "police", -- | If you want to make everyone remove this line or set nil
        label = "Police Station Gun Rack",
        icon = "fa-solid fa-shield"
    },
    {
        id = "default_rack_2",
        model = `xm_prop_xm_gunlocker_01a`,
        coord = vector4(487.66, -1015.29, 29.69, 181.0),
        job = "police", -- | If you want to make everyone remove this line or set nil
        label = "Police Station Polygon Rack",
        icon = "fa-solid fa-shield"
    },
    {
        id = "default_rack_3", -- IMPORTANT = If you want save weapons for after restart (server or script) you need set correct this (Each rack must have different id)
        model = `prop_cs_gunrack`,
        coord = vector4(439.67, -998.09, 34.28, 90.0),
        job = "police", -- | If you want to make everyone remove this line or set nil
        label = "Police Station Monitor Rack",
        icon = "fa-solid fa-shield"
    },
    {
        id = "default_rack_4", -- IMPORTANT = If you want save weapons for after restart (server or script) you need set correct this (Each rack must have different id)
        model = `prop_cs_gunrack`,
        coord = vector4(465.39, -982.4, 43.0, 0),
        job = "police", -- | If you want to make everyone remove this line or set nil
        label = "Police Station Helicopter Rack",
        icon = "fa-solid fa-shield"
    },
    -- Ambulances
    {
        id = "default_rack_5", -- IMPORTANT = If you want save weapons for after restart (server or script) you need set correct this (Each rack must have different id)
        model = `prop_cs_gunrack`,
        coord = vector4(309.94, -602.97, 42.60, 250),
        job = "ambulance", -- | If you want to make everyone remove this line or set nil
        label = "Hospital Rack",
        icon = "fa-regular fa-hand-back-fist"
    },
}

-- # Image Settings
Config.UseInventoryImages = true
Config.InventoryImageLocation = 'ox_inventory/web/images'
Config.CustomImages = {
    -- Hash = png
    [`weapon_pistol`] = "customurl.png",
}

-- # Items
Config.RackItems = {
    -- If you want create more placable item in config
    {item = "rack_1", model = `prop_cs_gunrack`},
    {item = "rack_2", model = `xm_prop_xm_gunlocker_01a`},
}

-- If you want add here more weapon
Config.WhitelistedWeapons = {
    -- PISTOLS
    `weapon_pistol`, 		
    `weapon_pistol_mk2`,
    `weapon_combatpistol`,
    `weapon_appistol`,
    `weapon_stungun`,
    `weapon_pistol50`,
    `weapon_snspistol`,
    `weapon_snspistol_mk2`,
    `weapon_heavypistol`,
    `weapon_vintagepistol`,
    `weapon_flaregun`,
    `weapon_marksmanpistol`,
    `weapon_revolver`,
    `weapon_revolver_mk2`,
    `weapon_doubleaction`,
    `weapon_raypistol`,
    `weapon_ceramicpistol`,
    `weapon_navyrevolver`,
    `weapon_gadgetpistol`,
    `weapon_stungun_mp`,

    -- SMG
    `weapon_microsmg`,
    `weapon_smg`,		
    `weapon_smg_mk2`, 		
    `weapon_assaultsmg`, 	
    `weapon_combatpdw`,	
    `weapon_machinepistol`, 
    `weapon_minismg`,
    `weapon_raycarbine`,
    
    -- RIFLE
    `weapon_assaultrifle`,
    `weapon_assaultrifle_mk2`, 
    `weapon_carbinerifle`,
    `weapon_carbinerifle_mk2`, 
    `weapon_advancedrifle`,	
    `weapon_specialcarbine`, 	
    `weapon_specialcarbine_mk2`,
    `weapon_bullpuprifle`,
    `weapon_bullpuprifle_mk2`,	
    `weapon_compactrifle`,
    `weapon_militaryrifle`,	
    `weapon_heavyrifle`,
    
    -- SHOTGUN
    `weapon_pumpshotgun`,
    `weapon_pumpshotgun_mk2`,	
    `weapon_sawnoffshotgun`,	
    `weapon_assaultshotgun`, 	
    `weapon_bullpupshotgun`, 	
    `weapon_musket`,	
    `weapon_heavyshotgun`, 	
    `weapon_dbshotgun`,		
    `weapon_autoshotgun`, 		
    `weapon_combatshotgun`,
    
    -- SNIPER
    `weapon_sniperrifle`,	
    `weapon_heavysniper`, 		
    `weapon_heavysniper_mk2`,	
    `weapon_marksmanrifle`,	
    `weapon_marksmanrifle_mk2`,
    `weapon_remotesniper`,
}

Config.Weapons = {
    -- // WEAPONS
	-- Melee
	[`weapon_unarmed`] 				 = {['name'] = 'weapon_unarmed', 		['label'] = 'Fists', 			['image'] = 'weapon_unarmed.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil, ['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_dagger`] 				 = {['name'] = 'weapon_dagger', 		['label'] = 'Dagger', 			['image'] = 'weapon_dagger.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_bat`] 					 = {['name'] = 'weapon_bat', 			['label'] = 'Bat', 				['image'] = 'weapon_bat.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_bottle`] 				 = {['name'] = 'weapon_bottle', 		['label'] = 'Broken Bottle', 	['image'] = 'weapon_bottle.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_crowbar`] 				 = {['name'] = 'weapon_crowbar', 		['label'] = 'Crowbar', 			['image'] = 'weapon_crowbar.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_flashlight`] 			 = {['name'] = 'weapon_flashlight', 	['label'] = 'Flashlight', 		['image'] = 'weapon_flashlight.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_golfclub`] 			 = {['name'] = 'weapon_golfclub', 		['label'] = 'Golfclub', 		['image'] = 'weapon_golfclub.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_hammer`] 				 = {['name'] = 'weapon_hammer', 		['label'] = 'Hammer', 			['image'] = 'weapon_hammer.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_hatchet`] 				 = {['name'] = 'weapon_hatchet', 		['label'] = 'Hatchet', 			['image'] = 'weapon_hatchet.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_knuckle`] 				 = {['name'] = 'weapon_knuckle', 		['label'] = 'Knuckle', 			['image'] = 'weapon_knuckle.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_knife`] 				 = {['name'] = 'weapon_knife', 			['label'] = 'Knife', 			['image'] = 'weapon_knife.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_machete`] 				 = {['name'] = 'weapon_machete', 		['label'] = 'Machete', 			['image'] = 'weapon_machete.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_switchblade`] 			 = {['name'] = 'weapon_switchblade', 	['label'] = 'Switchblade', 		['image'] = 'weapon_switchblade.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_nightstick`] 			 = {['name'] = 'weapon_nightstick', 	['label'] = 'Nightstick', 		['image'] = 'weapon_nightstick.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_wrench`] 				 = {['name'] = 'weapon_wrench', 		['label'] = 'Wrench', 			['image'] = 'weapon_wrench.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_battleaxe`] 			 = {['name'] = 'weapon_battleaxe', 		['label'] = 'Battle Axe', 		['image'] = 'weapon_battleaxe.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},
	[`weapon_poolcue`] 				 = {['name'] = 'weapon_poolcue', 		['label'] = 'Poolcue', 			['image'] = 'weapon_poolcue.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_briefcase`] 			 = {['name'] = 'weapon_briefcase', 		['label'] = 'Briefcase', 		['image'] = 'weapon_briefcase.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_briefcase_02`] 		 = {['name'] = 'weapon_briefcase_02', 	['label'] = 'Briefcase', 		['image'] = 'weapon_briefcase_02.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_garbagebag`] 			 = {['name'] = 'weapon_garbagebag', 	['label'] = 'Garbage Bag', 		['image'] = 'weapon_garbagebag.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_handcuffs`] 			 = {['name'] = 'weapon_handcuffs', 		['label'] = 'Handcuffs', 		['image'] = 'weapon_handcuffs.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_bread`] 				 = {['name'] = 'weapon_bread', 			['label'] = 'Baquette', 		['image'] = 'weapon_bread.png',	    ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered'},
	[`weapon_stone_hatchet`] 		 = {['name'] = 'weapon_stone_hatchet', 	['label'] = 'Stone Hatchet',    ['image'] = 'weapon_stone_hatchet.png',       ['weapontype'] = 'Melee',	['ammotype'] = nil,	['damagereason'] = 'Knifed / Stabbed / Eviscerated'},

    -- Handguns
	[`weapon_pistol`] 				 = {['name'] = 'weapon_pistol', 		['label'] = 'Pistol', 				    ['image'] = 'weapon_pistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_pistol_mk2`] 			 = {['name'] = 'weapon_pistol_mk2', 	['label'] = 'Pistol Mk2', 			    ['image'] = 'weapon_pistol_mk2.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_combatpistol`] 		 = {['name'] = 'weapon_combatpistol', 	['label'] = 'Combat Pistol', 			['image'] = 'weapon_combatpistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_appistol`] 			 = {['name'] = 'weapon_appistol', 		['label'] = 'AP Pistol', 				['image'] = 'weapon_appistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_stungun`] 				 = {['name'] = 'weapon_stungun', 		['label'] = 'Taser', 					['image'] = 'weapon_stungun.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_STUNGUN',	['damagereason'] = 'Died'},
	[`weapon_pistol50`] 			 = {['name'] = 'weapon_pistol50', 		['label'] = 'Pistol .50 Cal', 			['image'] = 'weapon_pistol50.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_snspistol`] 			 = {['name'] = 'weapon_snspistol', 		['label'] = 'SNS Pistol', 				['image'] = 'weapon_snspistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_snspistol_mk2`] 	     = {['name'] = 'weapon_snspistol_mk2', 	['label'] = 'SNS Pistol MK2', 			['image'] = 'weapon_snspistol_mk2.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',   ['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_heavypistol`] 			 = {['name'] = 'weapon_heavypistol', 	['label'] = 'Heavy Pistol', 			['image'] = 'weapon_heavypistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_vintagepistol`] 		 = {['name'] = 'weapon_vintagepistol', 	['label'] = 'Vintage Pistol', 			['image'] = 'weapon_vintagepistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_flaregun`] 			 = {['name'] = 'weapon_flaregun', 		['label'] = 'Flare Gun', 				['image'] = 'weapon_flaregun.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_FLARE',	['damagereason'] = 'Died'},
	[`weapon_marksmanpistol`] 		 = {['name'] = 'weapon_marksmanpistol', ['label'] = 'Marksman Pistol', 			['image'] = 'weapon_marksmanpistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_revolver`] 			 = {['name'] = 'weapon_revolver', 		['label'] = 'Revolver', 				['image'] = 'weapon_revolver.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_revolver_mk2`] 		 = {['name'] = 'weapon_revolver_mk2', 	['label'] = 'Revolver MK2', 		    ['image'] = 'weapon_revolver_mk2.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_doubleaction`] 	     = {['name'] = 'weapon_doubleaction', 	['label'] = 'Double Action Revolver',	['image'] = 'weapon_doubleaction.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_raypistol`]			 = {['name'] = 'weapon_raypistol',		['label'] = 'Ray Pistol',			    ['image'] = 'weapon_raypistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_ceramicpistol`]		 = {['name'] = 'weapon_ceramicpistol', 	['label'] = 'Ceramic Pistol',		    ['image'] = 'weapon_ceramicpistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_navyrevolver`]        	 = {['name'] = 'weapon_navyrevolver', 	['label'] = 'Navy Revolver',		    ['image'] = 'weapon_navyrevolver.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_gadgetpistol`] 		 = {['name'] = 'weapon_gadgetpistol', 	['label'] = 'Gadget Pistol',		    ['image'] = 'weapon_gadgetpistol.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Pistoled / Blasted / Plugged / Bust a cap in'},
	[`weapon_stungun_mp`] 			 = {['name'] = 'weapon_stungun_mp', 	['label'] = 'Taser', 				  	['image'] = 'weapon_stungun_mp.png',    ['weapontype'] = 'Pistol',	['ammotype'] = 'AMMO_STUNGUN',	['damagereason'] = 'Died'},

    -- Submachine Guns
	[`weapon_microsmg`] 			 = {['name'] = 'weapon_microsmg', 		['label'] = 'Micro SMG', 		['image'] = 'weapon_microsmg.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_smg`] 				 	 = {['name'] = 'weapon_smg', 			['label'] = 'SMG', 				['image'] = 'weapon_smg.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_smg_mk2`] 				 = {['name'] = 'weapon_smg_mk2', 		['label'] = 'SMG MK2', 			['image'] = 'weapon_smg_mk2.png',     ['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_assaultsmg`] 			 = {['name'] = 'weapon_assaultsmg', 	['label'] = 'Assault SMG', 		['image'] = 'weapon_assaultsmg.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_combatpdw`] 			 = {['name'] = 'weapon_combatpdw', 		['label'] = 'Combat PDW', 		['image'] = 'weapon_combatpdw.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_machinepistol`] 		 = {['name'] = 'weapon_machinepistol', 	['label'] = 'Tec-9', 			['image'] = 'weapon_machinepistol.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_PISTOL',	['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_minismg`] 				 = {['name'] = 'weapon_minismg', 		['label'] = 'Mini SMG', 		['image'] = 'weapon_minismg.png', 	['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},
	[`weapon_raycarbine`]	         = {['name'] = 'weapon_raycarbine', 	['label'] = 'Raycarbine',	    ['image'] = 'weapon_raycarbine.png',     ['weapontype'] = 'Submachine Gun',	['ammotype'] = 'AMMO_SMG',		['damagereason'] = 'Riddled / Drilled / Finished / Submachine Gunned'},

    -- Shotguns
	[`weapon_pumpshotgun`] 			 = {['name'] = 'weapon_pumpshotgun', 	 	['label'] = 'Pump Shotgun', 		   ['image'] = 'weapon_pumpshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_pumpshotgun_mk2`]		 = {['name'] = 'weapon_pumpshotgun_mk2',	['label'] = 'Pump Shotgun MK2', 	   ['image'] = 'weapon_pumpshotgun_mk2.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_sawnoffshotgun`] 		 = {['name'] = 'weapon_sawnoffshotgun', 	['label'] = 'Sawn-off Shotgun', 	   ['image'] = 'weapon_sawnoffshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_assaultshotgun`] 		 = {['name'] = 'weapon_assaultshotgun', 	['label'] = 'Assault Shotgun', 		   ['image'] = 'weapon_assaultshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_bullpupshotgun`] 		 = {['name'] = 'weapon_bullpupshotgun', 	['label'] = 'Bullpup Shotgun', 		   ['image'] = 'weapon_bullpupshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_musket`] 			     = {['name'] = 'weapon_musket', 			['label'] = 'Musket', 				   ['image'] = 'weapon_musket.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_heavyshotgun`] 		 = {['name'] = 'weapon_heavyshotgun', 	 	['label'] = 'Heavy Shotgun', 		   ['image'] = 'weapon_heavyshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_dbshotgun`] 			 = {['name'] = 'weapon_dbshotgun', 		 	['label'] = 'Double-barrel Shotgun',   ['image'] = 'weapon_dbshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_autoshotgun`] 			 = {['name'] = 'weapon_autoshotgun', 	 	['label'] = 'Auto Shotgun', 		   ['image'] = 'weapon_autoshotgun.png', 	    ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},
	[`weapon_combatshotgun`]		 = {['name'] = 'weapon_combatshotgun', 		['label'] = 'Combat Shotgun',		   ['image'] = 'weapon_combatshotgun.png',      ['weapontype'] = 'Shotgun',	    ['ammotype'] = 'AMMO_SHOTGUN',	['damagereason'] = 'Devastated / Pulverized / Shotgunned'},

    -- Assault Rifles
	[`weapon_assaultrifle`] 		 = {['name'] = 'weapon_assaultrifle', 	 	['label'] = 'Assault Rifle', 		    ['image'] = 'weapon_assaultrifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_assaultrifle_mk2`] 	 = {['name'] = 'weapon_assaultrifle_mk2', 	['label'] = 'Assault Rifle MK2', 	    ['image'] = 'weapon_assaultrifle_mk2.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_carbinerifle`] 		 = {['name'] = 'weapon_carbinerifle', 	 	['label'] = 'Carbine Rifle', 		    ['image'] = 'weapon_carbinerifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
    [`weapon_carbinerifle_mk2`] 	 = {['name'] = 'weapon_carbinerifle_mk2', 	['label'] = 'Carbine Rifle MK2', 	    ['image'] = 'weapon_carbinerifle_mk2.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_advancedrifle`] 		 = {['name'] = 'weapon_advancedrifle', 	 	['label'] = 'Advanced Rifle', 		    ['image'] = 'weapon_advancedrifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_specialcarbine`] 		 = {['name'] = 'weapon_specialcarbine', 	['label'] = 'Special Carbine', 		    ['image'] = 'weapon_specialcarbine.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_specialcarbine_mk2`]	 = {['name'] = 'weapon_specialcarbine_mk2',	['label'] = 'Specialcarbine MK2',	    ['image'] = 'weapon_specialcarbine_mk2.png',     ['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_bullpuprifle`] 		 = {['name'] = 'weapon_bullpuprifle', 	 	['label'] = 'Bullpup Rifle', 		    ['image'] = 'weapon_bullpuprifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_bullpuprifle_mk2`]		 = {['name'] = 'weapon_bullpuprifle_mk2', 	['label'] = 'Bull Puprifle MK2',	    ['image'] = 'weapon_bullpuprifle_mk2.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_compactrifle`] 		 = {['name'] = 'weapon_compactrifle', 	 	['label'] = 'Compact Rifle', 		    ['image'] = 'weapon_compactrifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
	[`weapon_militaryrifle`]		 = {['name'] = 'weapon_militaryrifle', 		['label'] = 'Military Rifle',   	    ['image'] = 'weapon_militaryrifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},
    [`weapon_heavyrifle`] 			 = {['name'] = 'weapon_heavyrifle', 	 	['label'] = 'Heavy Rifle', 			    ['image'] = 'weapon_heavyrifle.png',		['weapontype'] = 'Assault Rifle',	['ammotype'] = 'AMMO_RIFLE',	['damagereason'] = 'Ended / Rifled / Shot down / Floored'},

    -- Light Machine Guns
	[`weapon_mg`] 					 = {['name'] = 'weapon_mg', 			['label'] = 'Machinegun', 		['image'] = 'weapon_mg.png',	    ['weapontype'] = 'Light Machine Gun',	['ammotype'] = 'AMMO_MG',	['damagereason'] = 'Machine gunned / Sprayed / Ruined'},
	[`weapon_combatmg`] 			 = {['name'] = 'weapon_combatmg', 		['label'] = 'Combat MG', 		['image'] = 'weapon_combatmg.png',	    ['weapontype'] = 'Light Machine Gun',	['ammotype'] = 'AMMO_MG',	['damagereason'] = 'Machine gunned / Sprayed / Ruined'},
	[`weapon_combatmg_mk2`]	 		 = {['name'] = 'weapon_combatmg_mk2', 	['label'] = 'Combat MG MK2',	['image'] = 'weapon_combatmg_mk2.png',     ['weapontype'] = 'Light Machine Gun',	['ammotype'] = 'AMMO_MG',	['damagereason'] = 'Machine gunned / Sprayed / Ruined'},
	[`weapon_gusenberg`] 			 = {['name'] = 'weapon_gusenberg', 		['label'] = 'Thompson SMG', 	['image'] = 'weapon_gusenberg.png',	    ['weapontype'] = 'Light Machine Gun',	['ammotype'] = 'AMMO_MG',	['damagereason'] = 'Machine gunned / Sprayed / Ruined'},

    -- Sniper Rifles
	[`weapon_sniperrifle`] 			 = {['name'] = 'weapon_sniperrifle', 	 	['label'] = 'Sniper Rifle', 		['image'] = 'weapon_sniperrifle.png',	['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER',			['damagereason'] = 'Sniped / Picked off / Scoped'},
	[`weapon_heavysniper`] 			 = {['name'] = 'weapon_heavysniper', 	 	['label'] = 'Heavy Sniper', 		['image'] = 'weapon_heavysniper.png',	['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER',			['damagereason'] = 'Sniped / Picked off / Scoped'},
	[`weapon_heavysniper_mk2`]		 = {['name'] = 'weapon_heavysniper_mk2', 	['label'] = 'Heavysniper MK2',	    ['image'] = 'weapon_heavysniper_mk2.png',    ['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER',			['damagereason'] = 'Sniped / Picked off / Scoped'},
	[`weapon_marksmanrifle`] 		 = {['name'] = 'weapon_marksmanrifle', 	 	['label'] = 'Marksman Rifle', 		['image'] = 'weapon_marksmanrifle.png',	['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER',			['damagereason'] = 'Sniped / Picked off / Scoped'},
	[`weapon_marksmanrifle_mk2`]	 = {['name'] = 'weapon_marksmanrifle_mk2',	['label'] = 'Marksman Rifle MK2',	['image'] = 'weapon_marksmanrifle_mk2.png',    ['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER',			['damagereason'] = 'Sniped / Picked off / Scoped'},
	[`weapon_remotesniper`] 		 = {['name'] = 'weapon_remotesniper', 	 	['label'] = 'Remote Sniper', 		['image'] = 'weapon_remotesniper.png',	['weapontype'] = 'Sniper Rifle',	['ammotype'] = 'AMMO_SNIPER_REMOTE',	['damagereason'] = 'Sniped / Picked off / Scoped'},

    -- Heavy Weapons
	[`weapon_rpg`] 					 = {['name'] = 'weapon_rpg', 			      	['label'] = 'RPG', 						['image'] = 'weapon_rpg.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_RPG',				['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_grenadelauncher`] 		 = {['name'] = 'weapon_grenadelauncher', 	  	['label'] = 'Grenade Launcher', 		['image'] = 'weapon_grenadelauncher.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_GRENADELAUNCHER',	['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_grenadelauncher_smoke`] = {['name'] = 'weapon_grenadelauncher_smoke',	['label'] = 'Smoke Grenade Launcher',	['image'] = 'weapon_grenadelauncher_smoke.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_GRENADELAUNCHER',	['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_minigun`] 				 = {['name'] = 'weapon_minigun', 		      	['label'] = 'Minigun', 					['image'] = 'weapon_minigun.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_MINIGUN',			['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_firework`] 			 = {['name'] = 'weapon_firework', 		 	  	['label'] = 'Firework Launcher', 		['image'] = 'weapon_firework.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = nil,						['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_railgun`] 				 = {['name'] = 'weapon_railgun', 		 	  	['label'] = 'Railgun', 					['image'] = 'weapon_railgun.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = nil,						['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_hominglauncher`] 		 = {['name'] = 'weapon_hominglauncher', 	 	['label'] = 'Homing Launcher', 			['image'] = 'weapon_hominglauncher.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_STINGER',			['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_compactlauncher`] 		 = {['name'] = 'weapon_compactlauncher',  	  	['label'] = 'Compact Launcher', 		['image'] = 'weapon_compactlauncher.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = nil,						['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_rayminigun`]			 = {['name'] = 'weapon_rayminigun', 		 	['label'] = 'Ray Minigun',		        ['image'] = 'weapon_rayminigun.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_MINIGUN',			['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
    [`weapon_emplauncher`] 			 = {['name'] = 'weapon_emplauncher', 			['label'] = 'EMP Launcher', 			['image'] = 'weapon_emplauncher.png',    ['weapontype'] = 'Heavy Weapons',	['ammotype'] = 'AMMO_EMPLAUNCHER',		['damagereason'] = 'Died'},

    -- Throwables
	[`weapon_grenade`] 		        = {['name'] = 'weapon_grenade', 		['label'] = 'Grenade', 			 ['image'] = 'weapon_grenade.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Bombed / Exploded / Detonated / Blew up'},
	[`weapon_bzgas`] 		        = {['name'] = 'weapon_bzgas', 			['label'] = 'BZ Gas', 			 ['image'] = 'weapon_bzgas.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Died'},
	[`weapon_molotov`] 		        = {['name'] = 'weapon_molotov', 		['label'] = 'Molotov', 			 ['image'] = 'weapon_molotov.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Torched / Flambeed / Barbecued'},
	[`weapon_stickybomb`] 	        = {['name'] = 'weapon_stickybomb', 	    ['label'] = 'C4', 				 ['image'] = 'weapon_stickybomb.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Bombed / Exploded / Detonated / Blew up'},
	[`weapon_proxmine`] 	        = {['name'] = 'weapon_proxmine', 		['label'] = 'Proxmine Grenade',  ['image'] = 'weapon_proxmine.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Bombed / Exploded / Detonated / Blew up'},
	[`weapon_snowball`] 	        = {['name'] = 'weapon_snowball', 		['label'] = 'Snowball', 		 ['image'] = 'weapon_snowball.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Died'},
	[`weapon_pipebomb`] 	        = {['name'] = 'weapon_pipebomb', 		['label'] = 'Pipe Bomb', 		 ['image'] = 'weapon_pipebomb.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Bombed / Exploded / Detonated / Blew up'},
	[`weapon_ball`] 		        = {['name'] = 'weapon_ball', 			['label'] = 'Ball', 			 ['image'] = 'weapon_ball.png',   ['weapontype'] = 'Throwable',	['ammotype'] = 'AMMO_BALL',		['damagereason'] = 'Died'},
	[`weapon_smokegrenade`]         = {['name'] = 'weapon_smokegrenade', 	['label'] = 'Smoke Grenade', 	 ['image'] = 'weapon_smokegrenade.png',   ['weapontype'] = 'Throwable',	['ammotype'] = nil,				['damagereason'] = 'Died'},
	[`weapon_flare`] 		        = {['name'] = 'weapon_flare', 			['label'] = 'Flare pistol', 	 ['image'] = 'weapon_flare.png',   ['weapontype'] = 'Throwable',	['ammotype'] = 'AMMO_FLARE',	['damagereason'] = 'Died'},

    -- Miscellaneous
	[`weapon_petrolcan`] 			= {['name'] = 'weapon_petrolcan', 		 	['label'] = 'Petrol Can', 				['image'] = 'weapon_petrolcan.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = 'AMMO_PETROLCAN',		['damagereason'] = 'Died'},
	[`gadget_parachute`] 			= {['name'] = 'gadget_parachute', 		 	['label'] = 'Parachute', 				['image'] = 'gadget_parachute.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_fireextinguisher`] 	= {['name'] = 'weapon_fireextinguisher',	['label'] = 'Fire Extinguisher',		['image'] = 'weapon_fireextinguisher.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_hazardcan`]			= {['name'] = 'weapon_hazardcan',			['label'] = 'Hazardcan',			    ['image'] = 'weapon_hazardcan.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = 'AMMO_PETROLCAN',		['damagereason'] = 'Died'},
    [`weapon_fertilizercan`]		= {['name'] = 'weapon_fertilizercan',		['label'] = 'Fertilizer Can',			['image'] = 'weapon_fertilizercan.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = 'AMMO_FERTILIZERCAN',	['damagereason'] = 'Died'},
	[`weapon_barbed_wire`]			= {['name'] = 'weapon_barbed_wire',			['label'] = 'Barbed Wire',				['image'] = 'weapon_barbed_wire.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Prodded'},
	[`weapon_drowning`]				= {['name'] = 'weapon_drowning',			['label'] = 'Drowning',					['image'] = 'weapon_drowning.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_drowning_in_vehicle`]	= {['name'] = 'weapon_drowning_in_vehicle',	['label'] = 'Drowning in a Vehicle',	['image'] = 'weapon_drowning_in_vehicle.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_bleeding`]				= {['name'] = 'weapon_bleeding',			['label'] = 'Bleeding',					['image'] = 'weapon_bleeding.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Bled out'},
	[`weapon_electric_fence`]		= {['name'] = 'weapon_electric_fence',		['label'] = 'Electric Fence',			['image'] = 'weapon_electric_fence.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Fried'},
	[`weapon_explosion`]			= {['name'] = 'weapon_explosion',			['label'] = 'Explosion',				['image'] = 'weapon_explosion.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated'},
	[`weapon_fall`]					= {['name'] = 'weapon_fall',				['label'] = 'Fall',						['image'] = 'weapon_fall.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Committed suicide'},
	[`weapon_exhaustion`]			= {['name'] = 'weapon_exhaustion',			['label'] = 'Exhaustion',				['image'] = 'weapon_exhaustion.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_hit_by_water_cannon`]	= {['name'] = 'weapon_hit_by_water_cannon',	['label'] = 'Water Cannon',				['image'] = 'weapon_hit_by_water_cannon.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Died'},
	[`weapon_rammed_by_car`]		= {['name'] = 'weapon_rammed_by_car',		['label'] = 'Rammed - Vehicle',			['image'] = 'weapon_rammed_by_car.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Flattened / Ran over / Ran down'},
	[`weapon_run_over_by_car`]		= {['name'] = 'weapon_run_over_by_car',		['label'] = 'Run Over - Vehicle',		['image'] = 'weapon_run_over_by_car.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Flattened / Ran over / Ran down'},
	[`weapon_heli_crash`]			= {['name'] = 'weapon_heli_crash',			['label'] = 'Heli Crash',				['image'] = 'weapon_heli_crash.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Helicopter Crash'},
	[`weapon_fire`]					= {['name'] = 'weapon_fire',				['label'] = 'Fire',						['image'] = 'weapon_fire.png',    ['weapontype'] = 'Miscellaneous',	['ammotype'] = nil,						['damagereason'] = 'Torched / Flambeed / Barbecued'},

	-- Animals
    [`weapon_animal`]               = {['name'] = 'weapon_animal',	['label'] = 'Animal',	['image'] = 'weapon_animal.png',    ['weapontype'] = 'Animals',	['ammotype'] = nil,	['damagereason'] = 'Mauled'},
    [`weapon_cougar`]               = {['name'] = 'weapon_cougar',	['label'] = 'Cougar',	['image'] = 'weapon_cougar.png',    ['weapontype'] = 'Animals',	['ammotype'] = nil,	['damagereason'] = 'Mauled'},

}
local ESX = exports["es_extended"]:getSharedObject()

function CustomNotifVariation(text, style, time)
    if not style then style = "info" end
    if not time then time = 3000 end
    ESX.ShowNotification(text, style, time)
end

function CustomTargetAddRackInteraction(data)
    local options = {}
    options[#options+1] = {
        event = data.event,
        icon = data.icon,
        label = data.label,
        rackid = data.id,
        job = data.job
    }
    if data.owner then
        options[#options+1] = {
            event = "wert-gunrack:client:remove-rack",
            icon = Config.RemoveRackIcon,
            label = LANG.remove_rack,
            rackid = data.id,
        }
    end
    exports["qb-target"]:AddTargetEntity(data.obj, {options = options, distance = Config.RackTargetDistance})
end

function ShowPlaceInput()
    if Config.OxLib then
        local dialog = lib.inputDialog(LANG.input.title, {
            {type = 'input', label = LANG.input.label, description = LANG.input.description, required = true},
        })
        return dialog
    else
        local dialog = exports['qb-input']:ShowInput({
            header = LANG.input.title,
            submitText = LANG.input.confirm,
            inputs = {
                {
                    text = LANG.input.label,
                    name = "label",
                    type = "text",
                    isRequired = true
                },
            },
        })
        return dialog
    end
end

function ShowTextUI(text, icon)
    if Config.OxLib then
        lib.showTextUI(text, {position = 'left-center', icon = icon})
    else
        exports['qb-core']:DrawText(text, 'left')
    end
end

function HideTextUI()
    if Config.OxLib then
        lib.hideTextUI()
    else
        exports['qb-core']:HideText()
    end
end

RegisterNetEvent('wert-gunrack:client:custom-notif', function(text, style, time)
    CustomNotifVariation(text, style, time)
end)
local ESX = exports["es_extended"]:getSharedObject()

function GetWeaponComponentDescriptions(info)
    local result = ""
    if info and info.attachments then
        for k,v in pairs(info.attachments) do
            if v and v.label then
                if result == "" then
                    result = v.label
                else
                    result = result .. ", " .. v.label
                end
            end
        end
    end
    if result == "" then result = LANG.not_found_attachment end
    return result
end


-- # Items
for i=1, #Config.RackItems do
    local item = Config.RackItems[i]
    ESX.RegisterUsableItem(item.item, function(src)
        TriggerClientEvent("wert-gunrack:client:start-placament", src, i)
    end)
end
LANG = {
	error = {
        rack_full = "Rack Full!",
        rack_not_found = "Rack Not Found!",
        slot_not_found = "Slot Not Found!",
        slot_busy = "This slot busy!",
        labelerror = "Please Set Correct Label!",
    },
    left_arrow_icon = '<i class="fa-solid fa-arrow-left"></i>',
    right_arrow_icon = '<i class="fa-solid fa-arrow-right"></i>',
    put_rack_key = "E",
    change_place = "Change Place",
    putrack = "Put Rack",
    placement = {
        header = "Placement Keyboard",
        arrow_up = '<i class="fa-solid fa-arrow-up"></i>',
        arrow_left = '<i class="fa-solid fa-arrow-left"></i>',
        arrow_right = '<i class="fa-solid fa-arrow-right"></i>',
        arrow_desc = "MOVE",
        zkey = "Z",
        z_desc = "Reduce Height",
        qkey = "Q",
        ekey = "E",
        rotate = "Rotate",
        ctrl = "CTRL",
        shift = "SHIFT",
        right_dip = "Right Dip",
        left_dip = "Left Dip",
        fixground = "Fix Ground",
        finish = "Finish",
        cancel = "Cancel",
        space = "SPACE",
        enter = "ENTER",
        backspace = "BACKSPACE"
    },
    input = {
        title = "Complete Rack Placement",
        label = 'Rack Label',
        description = 'Set label here',
        confirm = "Confirm",
    },
    remove_rack = "Remove Rack",
    rack_removed = "Rack Succcesfuly Removed!",
    default_rack_label = "Gun Rack",
    no_target_interaction_preset = "[G]",
    take_weapon = "Take Weapon",
    not_found_attachment = 'Weapon not have any attachment!',
}

Last updated