cs2_player_pawn
This type represents a C_CSPlayerPawn
class.
should_draw
Returns true
if the game will draw this player on screen.
Arguments
None.
Returns
Type
Description
bool
true
if will.
Example
if player:should_draw() then
-- ...
end
is_left_handed
Returns true
if left-hand mode is enabled.
Arguments
None.
Returns
Type
Description
bool
true
if left-handed.
Example
if player:is_left_handed() then
-- ...
end
get_abs_origin
Returns the absolute origin (the one that is used for rendering).
Arguments
None.
Returns
Type
Description
Origin.
Example
local org = player:get_abs_origin();
get_abs_angles
Returns the absolute angles (the one that is used for rendering).
Arguments
None.
Returns
Type
Description
Angles.
Example
local ang = player:get_abs_angles();
get_abs_velocity
Method
Returns the absolute velocity.
Arguments
None.
Returns
Type
Description
Velocity.
Example
local vel = player:get_abs_velocity();
set_abs_origin
Sets the new absolute origin.
Arguments
Name
Type
Description
Returns
Nothing.
Example
player:set_abs_origin(my_vec);
set_abs_angles
Sets new absolute angles.
Arguments
Name
Type
Description
Returns
Nothing.
Example
player:set_abs_angles(my_ang);
set_abs_velocity
Method
Sets new absolute velocity.
Arguments
Name
Type
Description
Returns
Nothing.
Example
player:set_abs_velocity(my_vel);
is_alive
Returns true
if the player is alive.
Arguments
None.
Returns
Type
Description
bool
true
if alive.
Example
if player:is_alive() then
-- ...
end
is_enemy
Returns true
if this player is an enemy to the local player.
Arguments
None.
Returns
Type
Description
bool
true
if an enemy.
Example
if player:is_enemy() then
-- ...
end
is_enemy_to
Returns whether this player is an enemy to another entity.
Arguments
Name
Type
Description
Returns
Type
Description
bool
true
if an enemy.
Example
if player:is_enemy_to(other_player) then
-- ...
end
get_active_weapon
Returns the active weapon.
Arguments
None.
Returns
Type
Description
Weapon instance.
Example
local wep = player:get_active_weapon();
get_name
Returns the sanitized player name.
Arguments
None.
Returns
Type
Description
string
Player's name.
Example
local name = player:get_name();
get_view_offset
Returns the player's view offset (eye location relative to the player's origin).
Arguments
None.
Returns
Type
Description
View offset.
Example
local vo = player:get_view_offset();
get_eye_pos
Returns the player's eye position.
Arguments
None.
Returns
Type
Description
Eye position.
Example
local eyes = player:get_eye_pos();
Last updated