
Resource Configuration
This page provides comprehensive information about our configuration files, assisting in the setup of the resource.
cfg.autoDetectTaser
If enabled, this configuration field will allow the resource to automatically detect whether the user has a configured taser, eliminating the need to manually provide one.
This feature can be particularly beneficial for servers that utilize inventory systems or similar resource management tools. Although z_taser does not include a built-in check-out system, you can easily create your own by leveraging the extensive range of exports available, should you wish to implement a more realistic collection or check-out process.
---@section autoDetectTaser
cfg.autoDetectTaser = false
cfg.allowReloadKeybind
If enabled, this configuration option allows the user to reload the taser using a keybind input. The keybind is specified within the cfg.Keybinds section of the configuration file. If you prefer users to reload their taser from a specific area or during a particular task, you can disable this option and utilize the provided exports.
If you wish to integrate an inventory system into this process, you can do so within the Bridge.reloadKeybind
function located in the Bridge.lua
file. This function allows you to perform various checks and actions prior to the reload, such as verifying if the user possesses a specific item and removing it, or checking for the necessary permissions.
---@section allowReloadKeybind
cfg.allowReloadKeybind = false
cfg.advancedProngRemoval (Temporarily Removed)
If enabled, this configuration option will activate a more advanced and detailed prong removal process. Users will need to manually interact with each prong using their mouse to remove it. If a simpler and quicker method is preferred, you may leave this feature disabled.
If you would like to add minigames or skill checks to the prong removal process, whether advanced or simple, you can do so within the unlocked Bridge.removalMinigame
function located in the Bridge.lua
file.
---@section advancedProngRemoval
cfg.advancedProngRemoval = false
cfg.ragdollTime
This variable allows for the customization of the duration that peds and users remain in ragdoll state after being tasered. The measurement is in seconds; therefore, the default ragdoll time is 6.5 seconds.
---@section ragdollTime
cfg.ragdollTime = 6.5
cfg.TaserModels
This table includes all configured weapon models compatible with the resource. Each model can be individually configured to exhibit different behaviors from others. Instructions for setting up a new taser model are provided in greater detail here.
---@section TaserModels
cfg.TaserModels = {
[`WEAPON_STUNGUN`] = {
model_name = "ZEATASER",
cartridge_count = 2,
barbs_per_cartridge = 2,
prong_penetration_chance = 100,
max_fire_distance = 10.0,
has_safety_switch = true,
sound_effects = {
firing_sound = {
file_name = "taser-fire.wav",
distance = 15.0,
volume = 1.0
},
shock_sound = {
file_name = "taser-effect.wav",
distance = 15.0,
volume = 0.7
},
spark_sound = {
file_name = "drive_stun.wav",
distance = 15.0,
volume = 0.7
},
},
lasers = {
[1] = {
colour = vector4(255, 0, 0, 255)
},
[2] = {
colour = vector4(255, 0, 0, 255),
offset_from_previous = vector3(0.0, 0.0, -0.3)
}
},
flashlight = {
has_flashlight = true,
distance = 25.0,
brightness = 5.0
}
},
}
cfg.ClothingPenetrationChance
This table enables the configuration of specific male and female clothing items to have either a reduced or increased penetration chance than other items. Clothing with a lower penetration chance will result in tasers being less effective, possibly due to thick fabrics or armour. This feature allows for enhanced realism within your server. If you choose not to configure all clothing items, the penetration chance will default to the value set in the cfg.TaserModels
section of the configuration.
Within the table, you will first find male and female character models. Each character model includes various clothing categories, which are defined in the Enumerators.lua
file under Enum.eClothingCategories
. You are free to add as many or as few categories to each character as you wish.
Within each configured category, you can assign your drawable numbers. These represent the specific identifier for the clothing item within the category. The drawable number corresponds to the penetration probability for that particular item. The examples provided below are intended to help clarify this process.
The example below demonstrates how to set drawable number 35 within the body armour category to a 50% penetration chance.
["body_armor"] = {
[35] = 50,
},
We can further develop this category by adding drawable number 25 and assigning it a 70% penetration chance. Each category can accommodate an unlimited number of clothing drawable options.
["body_armor"] = {
[35] = 50,
[25] = 70
},
The default table provided for this configuration section is as follows.
---@section ClothingPenetrationChances
cfg.ClothingPenetrationChances = {
--> Male
mp_m_freemode_01 = {
["body_armor"] = {
[85] = 90,
},
["shirt_overlay"] = {
[50] = 90,
}
},
--> Female
mp_f_freemode_01 = {
["body_armor"] = {
[1] = 90,
},
["shirt_overlay"] = {
[50] = 90,
}
},
}
cfg.Animations
This table enables the customization of animations within the resource. You can control whether these animations play by using the play_anim
option. Additionally, you can edit and update the specific animations that are triggered within the animation
table.
---@section Animations
cfg.Animations = {
--> Safety
safety_switch = {
play_anim = true,
animation = {
dictonary = "anim@weapons@pistol@revolver",
name = "fire_med"
}
},
--> Reload
reload_taser = {
play_anim = true,
animation = {
dictonary = "anim@weapons@first_person@aim_rng@generic@pistol@machine_pistol@str",
name = "reload_aim"
}
}
}
cfg.WireSettings
This table enables customization of the wire connecting the taser to the prong. You can adjust the wire thickness by changing the numerical value—higher numbers correspond to thicker wires, while lower numbers indicate thinner ones. Additionally, you can modify the wire's texture and its associated normal map.
---@section WireSettings
cfg.WireSettings = {
thickness = 0.0008,
texture = "steel_cable",
texture_normal = "steel_cable_n"
}
cfg.Keybinds
This table allows for the customization of all the keybindings utilized by the resource. These keybindings include a combination of keymaps and standard key inputs. Keymaps can be modified within the client’s personal keybind settings, whereas standard key inputs cannot.
All configurable keybindings can be found within the Enumerators.lua
file located in the Enum.eUserInputs
directory.
---@section Keybinds
cfg.Keybinds = {
toggle_laser = "L",
toggle_flashlight = "J",
arc_switch = "N",
safety_switch = "X",
reload_taser = "R",
inspect_prongs = "E",
remove_prongs = "E",
third_eye_interaction = "LEFT_ALT"
}
cfg.InteractionSystem
This table enables customization of the built-in default interaction system. Within the table, you can determine whether the interaction system is enabled or disabled by adjusting the use
variable. Additionally, you can specify whether the interaction system utilizes a keybind. This means the user will need to hold a configured key to access interactions. You can also choose whether the interaction system displays hints or not. Hints are indicators that appear at the interaction point prior to revealing the actual interaction.
If you are experiencing difficulty locating the interactions on the screen, you can adjust the camera_distance
variable. Increasing this value will enlarge the viewing radius, making interactions more visible, while decreasing it will do the opposite.
If you would like to update the colour scheme or theme of the interaction system, you can do so within the themes
table.
The interaction creation code has been unlocked to facilitate your own integrations. For example, you may wish to utilize your own interaction system or add customizations. This can be found within the Bridge.createInteraction
function in the Bridge.lua
file.
---@section InteractionThemes
cfg.InteractionSystem = {
use = true,
use_keybind = false,
use_hints = true,
camera_distance = 0.05,
themes = {
main_theme = "rgba(0, 168, 255, 0.7)",
text_theme = "#f8f8f8",
stroke_theme = "#f8f8f8",
}
}
Last updated