From 452243e8c2ca997f22537f095347052b455a47e2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 16:18:59 +0100 Subject: [PATCH] Added GetWeapon function --- common/functions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/functions.lua b/common/functions.lua index ba6ab61b..755ae468 100644 --- a/common/functions.lua +++ b/common/functions.lua @@ -18,6 +18,17 @@ ESX.GetConfig = function() return Config end +ESX.GetWeapon = function(weaponName) + weaponName = string.upper(weaponName) + local weapons = ESX.GetWeaponList() + + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + return i, weapons[i] + end + end +end + ESX.GetWeaponList = function() return Config.Weapons end