-
Notifications
You must be signed in to change notification settings - Fork 0
Extended: CBaseCombatWeapon
How to get this userdata:
Entity()
GetWeaponByIndex()
player:GetActiveWeapon()
player:GetWeapon()
player:GetWeapons()tostring(weapon)Format weapon to a proper string "Weapon [{index}][{classname}]".
weapon:Clip2()Returns how much secondary ammo is in the magazine.
Return: number
weapon:ForceShot()Force the weapon fire a bullet, even player is not current using it.
BUG: This doesn't work on some classic pistols and grenade launchers.
Return: true or false
weapon:GetNextPrimaryFire()Gets the next time the weapon can primary fire.
Time is based on CurTime().
Return: number
weapon:GetNextSecondaryFire()Gets the next time the weapon can secondary fire.
Time is based on CurTime().
Return: number
weapon:GetOwner2()Same as original weapon:GetOwner(), but using different methods.
Return: player or nil
weapon:GetPrimaryAmmoType()Gets the primary ammo type of the given weapon.
Return: number
weapon:GetSecondaryAmmoType()Gets the ammo type of the given weapons secondary fire.
Return: number
weapon:GetWeaponID()Get the weapon item id.
Return: number
weapon:GetWeaponType()Get the weapon type (is pistol or rifle).
Return: number
weapon:GetWeaponViewModel()Returns the view model of the weapon.
Return: string
weapon:GetWeaponWorldModel()Returns the world model of the weapon.
Return: string
weapon:LastShootTime()Returns the time since this weapon last fired a bullet in seconds.
Time is based on CurTime().
Return: number
weapon:SetClip1(clip1)Lets you change the number of bullets in the given weapons primary clip.
clip1: number
weapon:SetClip2(clip2)Lets you change the number of bullets in the given weapons secondary clip.
clip2: number
weapon:SetNextPrimaryFire(time)Sets when the weapon can fire again.
Time is based on CurTime().
time: number
weapon:SetNextSecondaryFire(time)Sets when the weapon can alt-fire again.
Time is based on CurTime().
time: number
weapon:SetWeaponViewModel(model)Set the view model of weapon.
model: string
weapon:SetWeaponWorldModel(model)Set the world model of weapon.
model: string
weapon:SetWeaponPrimaryAmmo(ammo)Change the primary ammo of weapon to a amount.
For ammo in the magazine, use weapon:SetClip1().
ammo: number
weapon:SetWeaponSecondaryAmmo(ammo)Change the secondary ammo of weapon to a amount.
For ammo in the magazine, use weapon:SetClip2().
ammo: number