Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • 🖥️Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • ⚙️Instances
      • 🔢Math
      • ☎️Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • 🕹️Mods
        • events_t
      • ✏️Draw
        • ⚙️Types
          • ⚙️rect
          • ⚙️vec2
          • ⚙️color
          • ⚙️accessor
        • 🖥️Adapter
        • ✏️Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • 🖼️Managed
          • 🖼️texture
            • svg_texture
            • animated_texture
          • 🖼️shader
          • ™️font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • 🖥️Gui
        • ⚙️Types
          • ⚙️bits
          • ⚙️control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • ⚙️Utils
    • ⚙️Types
      • ⚙️ptr
      • ⚙️ref_holder_t
      • ⚙️vector
      • ⚙️vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

© 2025 - FATALITY

On this page
  • is_enemy
  • get_name
  • get_pawn
  • get_active_weapon
  • get_observer_pawn
  • get_observer_target
  • get_observer_mode
Export as PDF
  1. API
  2. Instances
  3. Entities
  4. base_entity

cs2_player_controller

Previouscs2_player_pawnNextcs2_weapon_base

Last updated 3 months ago

This type represents a CCSPlayerController class.

This type inherits type. All of its base methods and fields are also available in this type.

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

get_name

Returns the sanitized player name.

Arguments

None.

Returns

Type

Description

string

Player's name.

Example

local name = player:get_name();

get_pawn

Returns the pawn attached to this controller.

Arguments

None.

Returns

Type

Description

Pawn instance.

Example

local pawn = ctrl:get_pawn();

get_active_weapon

Returns the active weapon.

Arguments

None.

Returns

Type

Description

Weapon instance.

Example

local wep = player:get_active_weapon();

get_observer_pawn

Returns the observer pawn used for this controller.

Arguments

None.

Returns

Type

Description

Entity.

Example

local obs_pawn = ctrl:get_observer_pawn();

get_observer_target

Returns the pawn this controller is currently observing.

Arguments

None.

Returns

Type

Description

Entity.

Example

local obs = ctrl:get_observer_target();

get_observer_mode

Returns the current observer mode.

Arguments

None.

Returns

Type

Description

Observer mode.

Example

local mode = ctrl:get_observer_mode();

⚙️
🙋
base_entity
cs2_player_pawn
cs2_weapon_base_gun
base_entity
base_entity
observer_mode_t