Advanced Holster Script with EUP Support for Pistol, Taser, etc

Advanced Holster Script for FiveM

GitHub release (with filter) GitHub All Releases download count
5m_holster.zip (18.2 KB)

This is a server-side resource (executed on client only) for the Grand Theft Auto V Multiplayer FiveM.
It automatically changes e.g. holster models whether the pistol, taser, baton, flashlight or whatever you like is drawn or holstered.

There are already holster scripts available, however they’ve not met my requirements. I wanted more…
So I created this resource which supports every type of weapon and equipment.

Thanks to its powerful and highly modular config it’s super easy to configure to your likings!
Even if you run into issues, this resource gives you detailed error messages and solutions to the issues at hand.

Features

Supports every ped drawable and weapon loaded in game. Including EUP.
Basically everything you dreamt of, you can configure it.
Draw a taser from the belt or vest, works. Wonna draw pepper spray from your duty belt? Sure, set ids in the config and enjoy!

Installation

  1. Download the latest release as a zip file, or clone the repository using Git.
  2. Put it in your resources folder.
  3. Add ensure 5m_holster to your server.cfg to ensure it is run on start-up.

Configuration

The configuration file can be found in the src folder of the resource. It’s called config.lua. All configurations will take place in this file.
The first few lines contain functions which help make the configuration process more streamline. You can ignore these.

Adding Peds

Both multiplayer peds are already integrated. To add a new character simply create a new entry registerPed below the already existing ones. Ped models can be found here.

registerPed("mp_f_freemode_01")
registerPed("mp_m_freemode_01")

When this is done, you can go ahead and add equipment to this ped. The ped is available via REGISTERED_PEDS.{ped_name}.

Removing Peds

Simply remove the corresponding registerPed line. Ensure there is no equipment left requiring the ped.

Adding Weapons

A number of weapons are already integrated. To add new weapons simply create a new entry registerWeapon below the already existing ones. Weapon models can be found here.

registerWeapon("weapon_combatpistol")   -- Combat Pistol
registerWeapon("weapon_revolver")       -- Heavy Revolver
registerWeapon("weapon_revolver_mk2")   -- Heavy Revolver Mk II
registerWeapon("weapon_doubleaction")   -- Double Action Revolver
registerWeapon("weapon_navyrevolver")   -- Navy Revolver

When this is done, you can go ahead and add equipment using your new weapon. The weapon is available via REGISTERED_WPNS.{weapon_name}.

Removing Weapons

Simply remove the corresponding registerWeapon line. Ensure there is no equipment left requiring the weapon.

Adding Equipment

A number of holsters are already integrated. To add a holster or belt simply create a new entry registerEquipment below the already existing ones. Clothes can be found here. The easiest way to configure for a mp character is by using a resource like the eup-ui. Then simply select the body part and component id. You can also set a texture if there is one available.

Eup vMenu example The picture below shows the default eup ui. The red circle marks the holster, the id is 149 and has 1 texture.

Example for weapon holster as see:
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 150, 149)

Example for taser holster as seen:
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 260, 262, 1)

Examples can also be found down below in example config.

Body parts are already pre-defined as COMPONENTS. More info’s can be found on lspdfr wiki.

local COMPONENTS = {
    ["head"] = 0,
    ["berd"] = 1, -- masks
    ["hair"] = 2, -- hair styles
    ["uppr"] = 3, -- torso: shirt etc [MIGHT BE HANDS]
    ["lowr"] = 4, -- legs: pants
    ["jbib"] = 5, -- Bags and Parachutes
    ["feet"] = 6, -- shoes
    ["teef"] = 7, -- holster
    ["accs"] = 8, -- belt
    ["task"] = 9, -- vests or body armor
    ["decl"] = 10, -- overlays like text and emblems.
    ["hand"] = 11 -- hands and arms
}

The registerEquipment function requires multiple parameters. The first three are PED, COMPONENT and WEAPON.

registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 3, 1)

The 3 represents the holstered id of the variation and the 1 the drawn id.

name type accessible via required description
ped hash REGISTERED_PEDS yes refers to the ped model, defined with ‘registerPed’
component int COMPONENTS yes refers to a peds component, defined in ‘COMPONENTS’
weapon hash REGISTERED_WPNS yes refers to a weapon model, defined with ‘registerWeapon’
holstered id int none yes refers to the drawable component of the ped
drawn id int none yes refers to the drawable component of the ped
texture holstered int none no refers to the texture of the holster
texture drawn int none no refers to the texture of the holster

Example config for drawable taser, flashlight and baton

Spoiler contains example config for extended use of different weapons and components
-- see https://docs.fivem.net/docs/game-references/ped-models/ for more ped models
registerPed("mp_f_freemode_01")
registerPed("mp_m_freemode_01")
-- Add more peds as needed

-- see https://vespura.com/fivem/weapons/stats/
registerWeapon("weapon_pistol_mk2")
registerWeapon("weapon_combatpistol")
registerWeapon("weapon_stungun")
registerWeapon("weapon_nightstick")
registerWeapon("weapon_revolver")
registerWeapon("weapon_revolver_mk2")
registerWeapon("weapon_doubleaction")
registerWeapon("weapon_navyrevolver")
registerWeapon("weapon_flashlight")
-- Add more weapons as needed


registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 1, 3)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 9, 3)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 29, 3)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 81, 82)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 88, 89)
registerEquipmentRange(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 146, 176, -1)

registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 6, 5)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 8, 2)


registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 245, 246, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 249, 250, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 255, 256, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 257, 258, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 260, 261, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 267, 268, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 271, 272, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 277, 278, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 279, 280, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 282, 283, 1, 0)

registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 245, 247, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 249, 251, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 257, 259, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 260, 262, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 263, 264)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 267, 269, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 271, 273, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 279, 281, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 282, 284, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 285, 286)

registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 245, 248, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 249, 252, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 253, 254)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 263, 265)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 267, 270, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 271, 274, 1)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 275, 276)
registerEquipment(REGISTERED_PEDS.mp_f_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 285, 287)


registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 1, 3)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 9, 7)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 42, 43)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 110, 111)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 119, 120)
registerEquipmentRange(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_pistol_mk2, 176, 206, -1)

registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 6, 5)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_combatpistol, 8, 2)

registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_revolver, 122, 121)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_revolver_mk2, 122, 121)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_doubleaction, 122, 121)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.teef, REGISTERED_WPNS.weapon_navyrevolver, 122, 121)


registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 199, 200, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 203, 204, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 209, 210, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 211, 212, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 214, 215, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 221, 222, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 225, 226, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 231, 232, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 233, 234, 1, 0)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_stungun, 236, 237, 1, 0)

registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 199, 201, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 203, 205, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 211, 213, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 214, 216, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 217, 218)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 221, 223, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 225, 227, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 233, 235, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 236, 238, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_nightstick, 239, 240)

registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 199, 202, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 203, 206, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 207, 208)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 217, 219)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 221, 224, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 225, 228, 1)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 229, 230)
registerEquipment(REGISTERED_PEDS.mp_m_freemode_01, COMPONENTS.accs, REGISTERED_WPNS.weapon_flashlight, 239, 240)
-- Add more equipment as needed

Support

Please open the console with F8 and check for error messages.

This example shows an error with the texture id, it’s 1 however 0 textures are available; The variable responsible for the error is always marked with exclamation marks!

If you experience bugs or want to request features, please open an issue on GitHub.

FAQ

How does this work?

Peds in GTA have variations of duty belts with and without guns in their holster. This script puts these variations to use by automatically changing components when the player draws or holsters a weapon. It’s fully configurable and supports an unlimited combination of peds, weapons and components.

Does this support EUP?

Yes, in fact, it’s already preconfigured to work for the default pistol holsters for female and male mp characters.

Does this have custom animations?

No, this resource does not have custom animations.

Does this work in Singleplayer for LSPDFR?

No, this is a cfx resource for FiveM only.

License

GNU General Public License v3.0


Code is accessible Yes (GitHub repo)
Subscription-based No
Lines (approximately) 80 + Config File
Requirements Cfx Server
Support No
6 Likes

Can you do Like /Holster 0-4 and If Like Holster 1 you Equip An EUP For that??

Dude, I just did the installation, put it in my resources, ensure in server.cfg. However, I put on T-shirt number 130 and pulled out the combat pistol and it didn’t work for the gun to come out of the holster, can you help me? the animation only worked

1 Like

sommigen holsters laten dit wel toe andere niet het light aan je kleding

Can you do Like /Holster 0-4 and If Like Holster 1 you Equip An EUP For that??

I am afraid not, there is no support for commands what so ever.
If you find this to be a valuable addition, please go ahead and open a new issue with a feature request.

Dude, I just did the installation, put it in my resources, ensure in server.cfg. However, I put on T-shirt number 130 and pulled out the combat pistol and it didn’t work for the gun to come out of the holster, can you help me? the animation only worked

You need to add a new entry in the config file as described for not yet registered component variants to work. You will always need both variant id’s, the holstered one and the un-holstered one.

However, I’ve just checked with default eup-stream, there is no variant with an empty holster available for that component.

Pistol holsters should ideally be a teef component, try using these instead. Nevertheless it is possible with this resource to be any component, you just need to set them in the config.

sommigen holsters laten dit wel toe andere niet het light aan je kleding

Please comment/reply in English, as the op’s (my) chosen language is English as well.

does this work with ox_inventory?

does this work with ox_inventory?

I don’t see why it should not work. I haven’t tried with the current version yet, however a older variant worked just fine.

Does it work for EUP that has been made addon for example using the Durty Cloth Tool?

Does it work for EUP that has been made addon for example using the Durty Cloth Tool?

Yes it does, simply set the corresponding ids in the config.

Thanks for the help, but also in vMenu there is 2 ways to get the ids which way should i use?

Thanks for the help, but also in vMenu there is 2 ways to get the ids which way should i use?

That is a great question, so far I’ve only tested with the MP characters, and there I’ve used the MP Customization option.

Hi. This is a very cool and useful mod and I have been using it on my server for a long time. I have encountered one unpleasant problem. You made it possible to replace holster(belt) only one color. That is, what I mean.

For example, I have a detective holster # 16 with a gun in it, which when I select a gun should change to # 18 detective holster without a gun for visual effect. But the holster itself has 3 different colors (1 color black - standard, 2 color brown and 3 color for example pink), and the main problem is that in your mod I can set only 1 color for the holster. I can specify for example brown, and always when I will draw a weapon, the holster will become brown, even if I choose the same holster black or pink, it does not matter, in the configuration can be prescribed only 1 color holster.

It would be very cool if you would make in your mod the ability to bind not only the number of the holster itself, but also make it possible to use any color for the holster to work. Remove the binding on the color for example, so that it was so that if my character is wearing a pink holster, then when taking the gun in his hands, it did not become black or brown. I hope you get the point.

Sorry for the large amount of text, I don’t know much English and I’m writing to you with the help of a translator.

Thanks for your feedback! Glad to your hear my small mod is serving you well.
Indeed it is currently not possible to define more than one color per ID.
I’ve also played with the thought to add the ability to memorize the colors to remove the need to actually define them in a config.
As I am currently very buys, I can not say when I will be able to look into it.
There actually is a workaround for this issue, altho not very efficient tbh. If it is necessary to have multiple working colors, add the same holster multiple times to the game so each color can have it’s own ID.

1 Like

Is it possible to place long weapons on the front of the character? in this image style?

No it’s not possible unless it’s some sort of ped equipment/clothing with a valid component variation.

and do you make this version of the long guns on the front? I would pay for that

No, I am not doing that version.

This script was pretty easy to install but I am running into an issue. When the weapon is drawn, the weapon is still being drawn from the back even through you can see the weapon move in and out the holster.