📜 Installation

Installation

  1. Install the script in your resource folder.

  2. Configure the script in your config.lua file.

  3. Start the script in your server.cfg.

  4. Insert the SQL into your database.

  5. Restart the server now.

Configuration:

Config.lua Preview:

```lua
Config = {}

-- How high should the delay be? (The optimization)
Config.Optimization = 1000 -- For while true, do not edit if you dont have programming expierience
Config.DevMode = true
Config.Identifier = "license" -- license, steam..

-- Current holster
Config.CommandActive = true -- only affects holster command
Config.Command = "holster"
Config.CommandChangeHandOnAnim = "changehandonanim"
Config.UseUI = true
Config.UICommand = "holsterMenu"

-- Hand on Holster
Config.HandOnHolster = true
Config.HandOnButton = "K" 

-- Save component
Config.SaveComponent = true -- Saves the current component when entering the server and replaces it when you enter /holster 0.

-- Framework
Config.Framework = "qb" --  qb, esx /(legacy)/ and standalone 
Config.FWSettings = {
    needJob = false, -- only qb, esx /(legacy)/
    jobName = {
        "police", 
        "fbi", 
    },
}


-- Notify System
Config.NotifyActive = true
Config.Notify = {
    notify = "codem", -- possibillities: codem, gta5, chat and custom
    length = 5000, -- only for codem rn
    header = "Holster", -- only codem rn
    style = "info" -- only for codem rn
}


-- Holster-Configuration
Config.Holster = { -- Add how many you want
    HandOnHolsterFaster = true, -- Only for given animations
    holster0 = { -- DO NOT DELETE
        holsterName = "Kein Holster",
        holsterSound = "",
        holsterVol = 1.0,
        holsterAnim = {
            GivenAnim = "Back",
            useCustomAnim = false,
            animDictionary = "",
            animationName = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim) 
        tazerAnim = {
            GivenAnim = "Back",
            useCustomAnim = false,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,
        peds = {
            ["1885233650"] = {},
            ["2627665880"] = {},
            ["1762753038"] = {},
        }
    },
    holster1 = {
        holsterName = "Rechtshänder mit Glock 17 (Gürtel)",
        holsterSound = "Holster1", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "Right Hand",
            useCustomAnim = false,
            animDictionary = "",
            animationName = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        tazerAnim = {
            GivenAnim = "Front",
            useCustomAnim = false,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,

        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 8, -- drawableID
                pistolInactive = 5, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 5, -- drawableID
                pistolInactive = 4, -- drawableID
            },     
            ["1581098148"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "s_m_y_cop_01",

                pistolComponentId  = 9, 
                pistolTexture = 0,
                pistolActive = 1, -- drawableID
                pistolInactive = 0, -- drawableID
            },
        },
    },
    holster2 = {
        holsterName = "Rechtshänder Beinholster mit Glock 17 (Gürtel)",
        holsterSound = "Holster2", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "Right Hand",
            useCustomAnim = false,
            animDictionary = "",
            animationName = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        tazerAnim = {
            GivenAnim = "Front",
            useCustomAnim = false,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,

        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 1, -- drawableID
                pistolInactive = 3, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 6, -- drawableID
                pistolInactive = 3, -- drawableID
            },     
        },
    },
    holster3 = {
        holsterName = "Rechtshänder mit Glock 17",
        holsterSound = "Holster1", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "Right Hand",
            useCustomAnim = false,
            animDictionary = "",
            animationName = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,
        tazerAnim = {
            GivenAnim = "",
            useCustomAnim = false,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)

        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 8, -- drawableI
                pistolInactive = 5, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 5, -- drawableID
                pistolInactive = 4, -- drawableID
            },   
        },
    },
    holster4 = {
        holsterName = "Rechtshänder Beinholster mit Glock 17",
        holsterSound = "Holster2", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "Right Hand",
            useCustomAnim = false,
            animDictionary = "",
            animationName = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,
        tazerAnim = {
            GivenAnim = "",
            useCustomAnim = false,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)


        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 1, -- drawableI
                pistolInactive = 3, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 6, -- drawableID
                pistolInactive = 3, -- drawableID
            },   
        },
    },
    holster5 = {
        holsterName = "Rechtshänder mit Glock 17 (Gürtel)",
        holsterSound = "", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "",
            useCustomAnim = false,
            animDictionaryTakeOut = "",
            animationNameTakeOut = "",
            animDictionaryPutIn = "",
            animationNamePutIn = "",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        tazerAnim = {
            GivenAnim = "",
            useCustomAnim = false,
            animDictionaryTakeOut = "reaction@intimidation@cop@unarmed",
            animationNameTakeOut = "intro",
            animDictionaryPutIn = "reaction@intimidation@cop@unarmed",
            animationNamePutIn = "outro",
            duration = -1,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)

        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 8, -- drawableID
                pistolInactive = 5, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 5, -- drawableID
                pistolInactive = 4, -- drawableID
            },     
            ["1581098148"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "s_m_y_cop_01",

                pistolComponentId  = 9, 
                pistolTexture = 0,
                pistolActive = 1, -- drawableID
                pistolInactive = 0, -- drawableID
            },
        },
    },
    holster6 = {
        holsterName = "Rechtshänder mit Glock 17 (Gürtel)",
        holsterSound = "", -- Add or edit at Interact Sounds
        holsterVol = 0.7,
        holsterAnim = {
            GivenAnim = "",
            useCustomAnim = true,
            animDictionaryTakeOut = "reaction@intimidation@cop@unarmed",
            animationNameTakeOut = "intro",
            animDictionaryPutIn = "reaction@intimidation@cop@unarmed",
            animationNamePutIn = "outro",
            duration = -1,
        }, -- Available Right Hand, or choose an other anim..  (leave free for no anim)
        tazerAnim = {
            GivenAnim = "",
            useCustomAnim = true,
            animDictionaryTakeOut = "reaction@intimidation@cop@unarmed",
            animationNameTakeOut = "intro",
            animDictionaryPutIn = "reaction@intimidation@cop@unarmed",
            animationNamePutIn = "outro",
            duration = -1,
        }, -- Available Front, Back, or choose an other anim..  (leave free for no anim)
        holsterWaitToShoot = 0.6,

        peds = {
            ["1885233650"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_m_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 8, -- drawableID
                pistolInactive = 5, -- drawableID
            },
            ["2627665880"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "mp_f_freemode_01",
                tazerComponentId  = 8, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                tazerTexture = 1,
                tazerInactive = 9, -- drawableID
                tazerActive = 1,-- drawableID

                pistolComponentId  = 7, -- https://docs.fivem.net/natives/?_0x262B14F48D29DE80
                pistolTexture = 0,
                pistolActive = 5, -- drawableID
                pistolInactive = 4, -- drawableID
            },     
            ["1581098148"] = { -- Activate dev mode and then use /holster:getPedNum
                pedName = "s_m_y_cop_01",

                pistolComponentId  = 9, 
                pistolTexture = 0,
                pistolActive = 1, -- drawableID
                pistolInactive = 0, -- drawableID
            },
        },
    },
}

Config.Guns = {
    pistolList = {
        "weapon_pistol",
        "weapon_pistol_mk2",
        "weapon_combatpistol",
        "weapon_appistol",
        "weapon_pistol50",
        "weapon_snspistol",
        "weapon_snspistol_mk2",
        "weapon_heavypistol",
        "weapon_vintagepistol",
        "weapon_revolver",
        "weapon_revolver_mk2",
        "weapon_doubleaction",
        "weapon_ceramicpistol",
        "weapon_pistolxm3",
        "weapon_sig"
    },
    tazerList = {
        "weapon_stungun",
        "weapon_stungun_mp",
    },
}


Config.Locale = {
    currentHolster = "Aktuelles Holster: ",
    donthasJob = "Du hast nicht den erforderten Job",
    holsterCommand1 = "Change your holster",
    holsterCommand2 = "Use: 1, 2, 3, 4 or 0",
    changeCommand1 = "Use to change hand on hoster anim",
    changeCommand2 = "Use: normal, normal2, advanced",
    handOnHolster = "Hand auf Holster",
    numberToHigh = "Dieses Holster existiert nicht",
    pedDontExist = "Dieses Ped kann kein Holster tragen",
}



RegisterNetEvent("thxvz_holster:holster_notify")
AddEventHandler("thxvz_holster:holster_notify", function(text)
    if Config.Notify.notify == "chat" then
        TriggerEvent("chatMessage", "", {255,0,0}, text)
    elseif Config.Notify.notify == "gta5" then
        SetNotificationTextEntry("STRING")
        AddTextComponentString(text)
        DrawNotification(false, false)
    elseif Config.Notify.notify == "codem" then
        TriggerEvent('codem-notification:Create', text, Config.Notify.style, Config.Notify.header, Config.Notify.length)
    elseif Config.Notify.notify == "custom" then
        -- Your code
    end
end)
```

Last updated