Weapon handling, degradation & repair for RSG Framework.
Degradation over time, damage modifiers, repair workflow with a usable repair kit, and an admin
/infinityammotoggle.
Includes an ammo type map for bows, thrown weapons and firearms.
- rsg-core (framework)
- ox_lib (locales, notifications)
Locales included: en, fr, es, it, pt-br, el, ro
License: GPL‑3.0
- 🧰 Repair Kit item (
weapon_repair_kit) → progress bar + server‑side repair. - 📉 Weapon degradation (
Config.DegradeRate) and damage modifiers (ranged/melee). - 🧭 Weapon components toggle (
Config.WeaponComponents) for custom component flow. - ♾️ Admin command
/infinityammo→ server checks permission, toggles infinite ammo on client. - 🎯 Ammo type mapping (
AmmoWeaponTypes) for bows, thrown weapons, revolvers, rifles, repeaters, shotguns, etc. - 🌍 Multi‑language via
ox_lib.locale()andlocales/*.json.
Config = {}
Config.Debug = false
-- If false, you can use /loadweapon for equipped weapon (as noted in code)
Config.WeaponComponents = true
-- Timings & degradation
-- Config.UpdateAmmo = 10000 -- (commented in repo)
Config.RepairTime = 30000
Config.DegradeRate = 0.01
-- Damage modifiers
Config.WeaponDmg = 0.65
Config.MeleeDmg = 1.0
-- Ammo mapping (excerpt)
AmmoWeaponTypes = {
['weapon_bow'] = 'AMMO_ARROW',
['weapon_bow_improved'] = 'AMMO_ARROW',
['weapon_thrown_throwing_knives'] = 'AMMO_THROWING_KNIVES',
['weapon_thrown_tomahawk'] = 'AMMO_TOMAHAWK',
['weapon_melee_hatchet'] = 'AMMO_HATCHET',
-- ... (see full table in this repo)
}| Command | Access | Description |
|---|---|---|
/infinityammo |
Admin | Toggles infinite ammo for the current weapon (server permission checked). |
The client event is rsg-weapons:toggle; the server validates with RSGCore.Functions.HasPermission(src, 'admin') before triggering it.
Add to your items file (RSG inventory format):
weapon_repair_kit = { name = 'weapon_repair_kit', label = 'Weapon Repair Kit', weight = 200, type = 'item', image = 'weapon_repair_kit.png', unique = false, useable = true, decay = 0, delete = true, shouldClose = true, description = 'Tools and oil to repair a worn weapon.' },This item is registered server‑side as usable and calls the client repair flow:
RSGCore.Functions.CreateUseableItem('weapon_repair_kit', function(source, item)
TriggerClientEvent('rsg-weapons:client:repairweapon', source)
end)- Player uses
weapon_repair_kit. - Client locks inventory, shows progress bar for
Config.RepairTime. - Server removes the kit and repairs the held weapon (by serial).
- Inventory unlocks and a localized notification is shown.
- Exports available on client:
exports('weaponInHands', ...)→ returns table with current weapon data/serial.exports('UsedWeapons', ...)→ access cache of used weapons by serial.
- Client applies
SetPlayerWeaponDamageModifierandSetPlayerMeleeWeaponDamageModifiercontinuously based on config. - The resource uses
lib.locale(); editlocales/en.json(and others) to customize UI text.
- Add
rsg-weaponstoresources/[rsg]. - Ensure
rsg-coreandox_libare running before it. - Add the inventory item above and an icon if desired.
- In
server.cfg:ensure ox_lib ensure rsg-core ensure rsg-weapons
- Restart your server.
Included SQL files:
player_weapons.sqlplayer_weapons_2.1_update.sql
Apply them if you plan to persist weapon information as designed by this resource.
- https://github.com/qbcore-redm-framework/qbr-weapons
- https://github.com/QRCore-RedM-Re/qr-weapons
- RSG / Rexshack-RedM — framework integration & localization support
- Community translators
- License: GPL‑3.0