MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  1. Scripts

MSK Weaponammo

Documentation for msk_weaponammo

Last updated 5 months ago

You need msk_core! -

Common Errors

If you use ESX 1.8.5 and get the following error, then replace the following code in ESX.

SCRIPT ERROR: @es_extended/common/functions.lua:54: bad argument #1 to 'upper' (string expected, got table)

So if you get this error when adding a Weapon Component go to es_extended/server/classes/player.lua and search for function self.addWeaponComponent(weaponName, weaponComponent).

Replace this functions with this one:

function self.addWeaponComponent(weaponName, weaponComponent)
    local loadoutNum, weapon = self.getWeapon(weaponName)

    if weapon then
        local component = ESX.GetWeaponComponent(weaponName, weaponComponent)

        if component then
            if not self.hasWeaponComponent(weaponName, weaponComponent) then
                self.loadout[loadoutNum].components[#self.loadout[loadoutNum].components + 1] = weaponComponent
                GiveWeaponComponentToPed(GetPlayerPed(self.source), joaat(weaponName), component.hash)
                self.triggerEvent('esx:addInventoryItem', component.label, false, true)
            end
        end
    end
end
Download it here