cs2_weapon_base_gun
This type represents a CCSWeaponBaseGun class.
get_abs_origin
Method
Returns the absolute origin (the one that is used for rendering).
Arguments
None.
Returns
Type
Description
Origin.
Example
local org = wep:get_abs_origin();get_max_speed
Method
Returns the maximal player speed when holding this weapon.
Arguments
None.
Returns
Type
Description
float
Max speed, in UPS.
Example
local spd = wep:get_max_speed();get_inaccuracy
Method
Returns the current inaccuracy value.
Arguments
Name
Type
Description
Returns
Type
Description
float
Inaccuracy value.
Example
local inacc = wep:get_inaccuracy(csweapon_mode.primary_mode);get_spread
Method
Returns the current spread value.
Arguments
Name
Type
Description
Returns
Type
Description
float
Inaccuracy value.
Example
local spread = wep:get_spread(csweapon_mode.primary_mode);get_id
Method
Returns the weapon ID.
Arguments
None.
Returns
Type
Description
Weapon ID.
Example
local wep_id = wep:get_id();get_type
Method
Returns the weapon type.
Arguments
None.
Returns
Type
Description
Weapon type.
Example
local type = wep:get_type();get_data
Method
Returns the weapon static data.
Arguments
None.
Returns
Type
Description
Weapon data.
Example
local data = wep:get_data();is_gun
Method
Returns true if this weapon is a firearm.
Arguments
None.
Returns
Type
Description
bool
true if a firearm.
Example
if wep:is_gun() then
-- ...
endis_attackable
Method
Returns true if you can attack with this weapon.
Arguments
None.
Returns
Type
Description
bool
true if can attack.
Example
if wep:is_attackable() then
-- ...
endhas_secondary_attack
Method
Returns true if this weapon has a secondary attack mode.
Arguments
None.
Returns
Type
Description
bool
true if has the secondary attack mode.
Example
if wep:has_secondary_attack() then
-- ...
endhas_spread
Method
Returns true if this weapon has spread (e.g. knives do not have any spread).
Arguments
None.
Returns
Type
Description
bool
true if has spread.
Example
if wep:has_spread() then
-- ...
endLast updated