FECALITY.SHOP [API]
  • Overview
  • GETTING STARTED
    • Metadata
    • Creating scripts
    • Callbacks
    • Examples
    • Useful resources
  • DOCUMENTATION
    • Datatypes
      • entity
      • player_info
      • weapon_info
      • user_cmd
      • trace_t
      • vec3
      • cvar
      • timer
      • cfg_value
      • shot_info
      • game_event
      • material
      • material_var
      • zip
      • animator
    • Namespaces
      • Gui
      • Render
      • Engine
      • Math
      • Utilities
      • Entities
      • Database
      • Input
      • Panorama
      • Materials
      • Filesystem
      • Zip
    • Instances
      • Global Vars
      • Fecality
      • Gamerules
      • Server
Powered by GitBook
On this page
  • Functions
  • get_entity
  • get_entity_from_handle
  • for_each
  • for_each_z
  • for_each_player
  1. DOCUMENTATION
  2. Namespaces

Entities

entities namespace

Functions

get_entity

entities.get_entity(engine.get_local_player())

entity index

number

entity's server index

Returns:

entity's object

get_entity_from_handle

entities.get_entity_from_handle(local_player:get_prop("m_hMyWeapons", 1))

entity handle

number

a handle to the entity ex: m_hMyWeapons[1]

Returns:

entity's object

for_each

entities.for_each(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server.

for_each_z

entities.for_each_z(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server starting from the end.

for_each_player

entities.for_each_player(function(player)
    print(string.format("Player: %i has %i health", 
    player:get_index(), 
    player:get_prop("m_iHealth")))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the player.

Usage:

Runs for each player on the server.

PreviousUtilitiesNextDatabase

Last updated 2 years ago

Parameter
Datatype
Description
Value
Datatype
entity
Parameter
Datatype
Description
Value
Datatype
entity
Parameter
Datatype
Description
Parameter
Datatype
Description
Parameter
Datatype
Description