rytrak.fr Documentation
  • 🛡️FiveM Assets Escrow
    • You lack the required entitlement
    • Failed to verify protected resource
    • Error parsing script / Failed to load script
  • ❓Store FAQ
    • Do you accept orders to create a custom script
    • Do you give decrypted scripts
    • What payment methods are accepted for the purchase of your scripts?
    • Do you offer discounts or special offers on your scripts?
    • Can I modify or customize your scripts to meet my needs
    • Are your scripts compatible with frameworks
    • Do you provide development assistance?
  • FiveM Scripts
    • 🚒Firefighter SCBA System
      • General Configuration
      • Adapt your EUP
      • General Exports
      • General Events
      • ❓FAQ
        • No such export IsFireNearby in resource SmartFires
      • Test it now
    • 👮‍♂️Advanced Police Grab Ped
      • General Configuration
      • General Exports
      • General Events
      • Compatibility with esx_policejob
      • Test it now
    • 🚿Advanced Pepper Spray
      • General Configuration
      • General Exports
      • Anticheat
      • Test it now
    • 📣Advanced Megaphone System
      • General Configuration
      • General Exports
      • Compatibility with pma-voice
      • Compatibility with mumble-voip
      • Compatibility with saltychat
      • ❓FAQ
        • I can't hear my voice through the megaphone
      • Test it now
    • 🚁Advanced Helicopter Bucket
      • General Configuration
      • Adapt our script with ToxicFire
      • General Exports
      • 🔐Test it now
    • 🔗Advanced Remote Restraint
      • General Configuration
      • General Exports
      • Test it now
    • 🚗Advanced Extrication System
      • General Configuration
      • General Exports
      • Adapt a vehicle to the roof system
      • List of vehicles compatible with the roof system
      • 🔐Test it now
    • 🔗Advanced Handcuffs System
      • General Configuration
      • General Exports
      • Make ESX compatible
      • Make QBCore compatible
      • Make OX-Inventory compatible
      • 🔐Test it now
    • ✈️Advanced Aerial Firefighting
      • General Configuration
      • Adapt our script with ToxicFire
      • General Exports
      • 🔐Test it now
    • 💣Advanced Tactical Gas System
      • General Configuration
      • Test it now
  • RedM Scripts
    • 🤠Advanced Sheriff Grab Ped
      • General Configuration
      • General Exports
  • Framework compatibility
    • Add a custom weapon on ESX
    • Add a custom weapon on QBCore
    • Add a custom weapon on OX Inventory
  • 🚀Test our resources for free with Zap-Hosting
Powered by GitBook
On this page
  1. Framework compatibility

Add a custom weapon on OX Inventory

PreviousAdd a custom weapon on QBCoreNextTest our resources for free with Zap-Hosting

Last updated 8 days ago

Don't forget to add the weapon image to your inventory system.

The images are located in each our script file.

For all inventories, the addition of images is more or less identical.

For qb-inventory the directory is: /qb-inventory/html/images/

For ak47_qb_inventory the directory is: /ak47_qb_inventory/web/build/images/

For ox_inventory the directory is: /ox_inventory/web/images/

For esx_inventory the directory is: /esx_inventory/html/img/items/

When you've finished creating your item, don't forget to set UseFramework to true in the config.lua file of the script in question!

List of weapon names in our scripts:

Advanced Megaphone System

WEAPON_MEGAPHONE

Advanced Pepper Spray

WEAPON_PEPPERSPRAY

WEAPON_ANTIDOTE

Advanced Remote Restraint

WEAPON_BOLAWRAP

Advanced Extrication System

WEAPON_SPREADER

WEAPON_CUTTER

WEAPON_GLASSMASTER

Advanced Tactical Gas System

WEAPON_GRENADE_SMOKE

WEAPON_GRENADE_STUN

WEAPON_GRENADE_TEARGAS

If the weapon gets a bug similar to the gif below (the weapon vibrates) follow the tutorial

  1. Go to the ox_inventory/modules/weapon/client.lua directory

  2. Go to line 77 and replace the two selected lines as shown in the photo below with our code

Replace:

SetCurrentPedWeapon(playerPed, data.hash, true)
SetPedCurrentWeaponVisible(playerPed, true, false, false, false)

by this:

local weaponAddons = {
	'WEAPON_MEGAPHONE',
	'WEAPON_PEPPERSPRAY',
	'WEAPON_ANTIDOTE',
	'WEAPON_BOLAWRAP',
	'WEAPON_SPREADER',
	'WEAPON_CUTTER',
	'WEAPON_GLASSMASTER',
	'WEAPON_GRENADE_SMOKE',
	'WEAPON_GRENADE_STUN',
	'WEAPON_GRENADE_TEARGAS'
}

local function isWeaponAddons(hash)
	for _,v in pairs(weaponAddons) do
		if hash == GetHashKey(v) then
			return true
		end
	end
	return false
end

if not isWeaponAddons(data.hash) then
	SetCurrentPedWeapon(playerPed, data.hash, true)
	SetPedCurrentWeaponVisible(playerPed, true, false, false, false)
end