Skip to content

entities

Functions

FindByClass(className) Find and put into table all entities with given class name.

--Returns table of all players
local Players = entities.FindByClass("CCSPlayer");

GetLocalPlayer() Return the local player entity.

local LocalPlayer = entities.GetLocalPlayer();

GetByIndex(index) Return the entity by index.

local RandomPlayer = entities.GetByIndex(3);

GetByUserID(userID) Return the entity by user id

for i = 1, globals.MaxClients(), 1 do
    local Player = entities.GetByUserID(i);
end

GetPlayerResources() Return the 'CCSPlayerResource' entity

local playerResources = entities.GetPlayerResources();

GetGameRules() Return the 'CCSGameRulesProxy' entity

local gameRules = entities.GetGameRules();