Exports
Client-side
HideWeapon
This export will forcefully hide the current player's weapon.
exports.px_weapons:HideWeapon();
UpdateWeaponIndex
This export will update the client with the weapon inventory index position.
exports.px_weapons:UpdateWeaponIndex(newIndex --[[int]]);
GetSelectedWeapon
This export will return the currently selected weapon object.
local weapon --[[table]] = exports.px_weapons:GetSelectedWeapon();
GetCurrentWeaponCategory
This export will return the category of the player's current weapon. Returns false
if not holding a weapon, or a category is not found.
local category --[[string/bool]] = exports.px_weapons:GetCurrentWeaponCategory();
SetRecoilMultiplier
This export will set the recoil multipler for all weapons. The base multipler is 1.0
.
exports.px_weapons:SetRecoilMultiplier(value --[[float]]);
IsHolstering
This export will return whether the player is currently in between holstering animations.
local holstering --[[bool]] = exports.px_weapons:IsHolstering();
RemoveAttachment
This export will remove the attachment from the current player's weapon by (item) name.
exports.px_weapons:RemoveAttachment(type --[[string]]);
UpdateRecoilFactor
This export will update the weapon recoil factor based on current player stance.
exports.px_weapons:UpdateRecoilFactor(stance --[[int]]);
IsWeaponSuppressed
This export will return whether the current player's weapon is suppressed.
local suppressed --[[bool]] = exports.px_weapons:IsWeaponSuppressed();
GetAmmoTypes
This export will return all weapon ammo types from config file.
local ammoTypes --[[table]] = exports.px_weapons:GetAmmoTypes();
Server-side
RecentlyThrownWeapon
This export will return whether the thrown weapon specified has recently been used by the player.
local recentlyUsed --[[bool]] = exports.px_weapons:RecentlyThrownWeapon(src --[[int]], item --[[string]]);
GetPlayerWeapon
This export will return the currently selected weapon object of a player.
local weapon --[[table]] = exports.px_weapons:GetPlayerWeapon(src --[[int]]);
SetAmmo
This export will set the ammo of the currently selected weapon object of a player.
exports.px_weapons:SetAmmo(src --[[int]], ammo --[[int]]);