Values update once per tick, so they don’t change between
tick and the render frames after it.Overview
Lookup
getByIndex, getByHandle, getEntities, find, getPlayers, getLocalPlayer, getLocalController.Entity objects
alive, index, handle, className, address.Schema fields
m_iHealth and friends, read, bytes.Helpers
Origin, eyes, bounds, visibility, hitboxes, bones, weapon data.
EntityQuery
filter, forEach, toArray, first, count, map, some, every.EntityRef).
Lookup
getByIndex
index, or null when there’s none.
getByHandle
handle, or null once it’s gone.
getEntities
find
className matches exactly that class, parent matches it and every class deriving from it. Both together is an AND; an unknown name matches nothing. Returns an EntityQuery typed by the class you asked for.
getPlayers
skipLocal leaves yours out.
getLocalPlayer
null when you’re not in a game. Same observer-pawn rule as getPlayers.
getLocalController
null when you’re not in a game. Name, score, money and other per-player state live here.
Entity objects
The same entity is always the same object, so
=== and Map keys work. Once it’s destroyed, alive is false
for good and fields, address, read, bytes and helpers return null; index, handle and className still work.
Schema fields
Every schema field is a read-only property under its schema name:pawn.m_iHealth, pawn.m_ArmorValue. Autocompletion shows what each class has; the type for class C_CSPlayerPawn is IC_CSPlayerPawn.
m_pWeaponServices above, getWeaponData()) have address, read, bytes and toString as well.
read
offset bytes into the object, for data the schema doesn’t name. Types are the Pointer ones. RangeError past the end of the object.
bytes
size bytes from offset, defaulting to the whole object. RangeError past the end.
Helpers
Helpers returnnull when the data isn’t there (entity gone, no model).
isVisible
target’s eyes or box centre. Pass point to test that spot instead. null when no map is loaded.
Hitboxes and bones
Hitbox.index (the model’s hitbox id) / bone index. null when the model has none or the name doesn’t exist.
Bone has index, name (null if the model has none), position, rotation and scale.
EntityQuery
What find returns.filter returns a new query and leaves the original unchanged.