From cc7fd871a924d11041cac5454a38accc0dbecdb7 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:36:19 +1100 Subject: [PATCH] document getCurrentWeapon and related event --- .../Functions/Client/getCurrentWeapon.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/ox_inventory/Functions/Client/getCurrentWeapon.md diff --git a/docs/ox_inventory/Functions/Client/getCurrentWeapon.md b/docs/ox_inventory/Functions/Client/getCurrentWeapon.md new file mode 100644 index 00000000..6337ff9b --- /dev/null +++ b/docs/ox_inventory/Functions/Client/getCurrentWeapon.md @@ -0,0 +1,28 @@ +Get data for the currently equipped weapon. + +```lua +exports.ox_inventory:getCurrentWeapon() +``` + +You can also listen for changes to the current weapon using an event handler. + +```lua +AddEventHandler('ox_inventory:currentWeapon', function(currentWeapon) + CurrentWeapon = currentWeapon +end) +``` + +- currentWeapon?: `table` + - ammo?: `string` Name of the item used as ammo. + - hash: `number` + - label: `string` + - melee: `boolean` + - metadata: `table` + - ammo?: `number` Amount of ammo loaded into the weapon. + - components?: `table` Array of component item names, used to apply weapon components. + - durability?: `number` + - registered?: `string` Name of the player that bought the weapon at a shop. + - serial?: `string` + - name: `string` Name of the item. + - slot: `number` + - weight: `number`