C_WeaponCSBaseGun
Fields
Name | Type | Description |
---|---|---|
m_vecOrigin | Vector | |
m_angRotation | QAngle | |
m_nModelIndex | short | |
m_fEffects | int | |
m_iTeamNum | int | |
m_iPendingTeamNum | int | |
m_flElasticity | float | |
m_flShadowCastDistance | float | |
m_hOwnerEntity | CBaseHandle | |
moveparent | CBaseHandle | |
m_iParentAttachment | int | |
m_MoveType | int | |
m_bSpotted | bool | |
m_flMaxFallVelocity | float |
Functions
GetCSWpnData
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | CCSWeaponInfo* |
local weapon = local_player:GetActiveWeapon()
print(weapon:GetCSWpnData())
CanFire
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | bool |
local weapon = local_player:GetActiveWeapon()
print(weapon:CanFire())
GetSpread
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | float |
local weapon = local_player:GetActiveWeapon()
print(weapon:GetSpread())
GetInaccuracy
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | float |
local weapon = local_player:GetActiveWeapon()
print(weapon:GetInaccuracy())
EntIndex
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | int | Entity index |
local local_player = EntityList.GetLocalPlayer()
print(local_player:EntIndex())
IsDormant
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | bool | Is entity dormant |
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsDormant())
IsPlayer
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | bool | Is entity a player |
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsPlayer())
IsWeapon
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | bool | Is entity a weapon |
local local_player = EntityList.GetLocalPlayer()
local weapon = local_player:GetActiveWeapon()
print(weapon:IsWeapon())
ToPlayer
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | C_CSPlayer* | Pointer to player |
local entity = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
local local_player = entity:ToPlayer()
print(weapon:IsWeapon())
ToWeapon
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | C_WeaponCSBaseGun* | Pointer to weapon |
local weapon = entity:ToWeapon()
GetRenderAngles
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | QAngle | Render angles |
local local_player = EntityList.GetLocalPlayer()
local angles = local_player:GetRenderAngles()
print(angles.pitch, angles.yaw, angles.roll)
GetRenderOrigin
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | Vector | Render origin |
local local_player = EntityList.GetLocalPlayer()
local origin = local_player:GetRenderOrigin()
print(origin.x, origin.y, origin.z)
GetModelName
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | string | Model name of the entity |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetModelName())
SetModelIndex
Name | Type | Description |
---|---|---|
value | int | New model index |
local local_player = EntityList.GetLocalPlayer()
local_player:SetModelIndex(-1)
GetTeamNumber
Name | Type | Description |
---|---|---|
value | int | Entity team number |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetTeamNumber())
GetClassID
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | int | Entity class ID |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetClassId()) -- 40
GetMins
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | Vector | Mins of the entity. |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetMins())
GetMaxs
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | Vector | Maxs of the entity. |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetMaxs())
GetClassName
This function has no parameters.
Return value
Name | Type | Description |
---|---|---|
value | string | Entity class name |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetClassName()) -- CCSPlayer
SetProp
For better interaction with netvars, would be great to include the table name. If you do not specify table name, we will use the network name of the entity.
Name | Type | Description |
---|---|---|
class | string | Table name |
netvar | string | Netvar name |
value | mixed | New netvar value |
local local_player = EntityList.GetLocalPlayer()
print(local_player:SetProp("m_bIsScoped", false)) -- same as local_player:SetProp("CCSPlayer", "m_bIsScoped", false)
GetProp
For better interaction with netvars, would be great to include the table name. If you do not specify table name, we will use the network name of the entity.
Name | Type | Description |
---|---|---|
class | string | Table name (not required) |
netvar | string | Netvar name |
Return value
Name | Type | Description |
---|---|---|
value | mixed | Netvar value |
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetProp("m_bIsScoped")) -- same as local_player:GetProp("CCSPlayer", "m_bIsScoped")