Function Definitions

Function definitions are callbacks that can be passed around.
Consult the Angelscript documentation for more info.

FuncDefs

Namespace Declaration Description
<Global> void ThinkFunction() Function definition for custom entity Think functions
<Global> void UseFunction(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue) Function definition for custom entity Use functions
<Global> void TouchFunction(CBaseEntity@ pOther) Function definition for custom entity Touch functions
<Global> void BlockedFunction(CBaseEntity@ pOther) Function definition for custom entity Blocked functions
<Global> void TextMenuPlayerSlotCallback(CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem) Player slot callback for text menus.
<Global> void VoteBlocked(Vote@ pVote, float flTime) Funcdef for vote blocked callbacks. The given time is when the active vote has ended.
<Global> void VoteEnd(Vote@ pVote, bool fResult, int iVoters) Funcdef for vote ended callbacks. If fResult is true, users voted for yes. Otherwise, voted for no.
<Global> void ConCommandCallback(const CCommand@ args) Callback for server console commands.
<Global> void ClientCommandCallback(const CCommand@ args) Callback for client console commands.
<Global> void CVarCallback(CCVar@ cvar, const string& in szOldValue, float flOldValue) Callback for cvars.
<Global> HookReturnCode WeaponTertiaryAttackHook(CBasePlayer@, CBasePlayerWeapon@) Called when a player fires a weapon's tertiary attack.
<Global> HookReturnCode WeaponSecondaryAttackHook(CBasePlayer@, CBasePlayerWeapon@) Called when a player fires a weapon's secondary attack.
<Global> HookReturnCode WeaponPrimaryAttackHook(CBasePlayer@, CBasePlayerWeapon@) Called when a player fires a weapon's primary attack.
<Global> HookReturnCode PlayerPreDecalHook(CBasePlayer@, const TraceResult& in, bool& out bResult) Called when a player attempts to spraypaint a decal onto a surface. The given trace result contains the surface information. Set bResult to false if the player shouldn't be able to spray.
<Global> HookReturnCode PlayerDecalHook(CBasePlayer@, const TraceResult& in) Called when a player is spraypainting a decal onto a surface. The given trace result contains the surface information.
<Global> HookReturnCode GetPlayerSpawnSpotHook(CBasePlayer@ pPlayer, CBaseEntity@& out ppEntSpawnSpot) Called when a player is about to get a spawn point before (re)spawning.
<Global> HookReturnCode PlayerPostThinkHook(CBasePlayer@) Called when the player is processing post think events.
<Global> HookReturnCode PlayerPreThinkHook(CBasePlayer@, uint& out) Called when the player is processing pre think events.
<Global> HookReturnCode PlayerUseHook(CBasePlayer@, uint& out) Called when the game is processing player use input. Note that this occurs even if the player has not pressed their use key.
<Global> HookReturnCode PlayerLeftObserverHook(CBasePlayer@) Called when a player leaves observer mode.
<Global> HookReturnCode PlayerEnteredObserverHook(CBasePlayer@) Called when a player enters observer mode.
<Global> HookReturnCode PlayerKilledHook(CBasePlayer@, CBaseEntity@, int) Called when a player is killed.
<Global> HookReturnCode PlayerTakeDamageHook(DamageInfo@) Called when a player takes damage. Note that the victim entity can't be changed at this point.
<Global> HookReturnCode PlayerCanRespawnHook(CBasePlayer@, bool& out) Called when the game wants to know if the player should be able to respawn or not.Set bCanRespawn to false to disallow, default true.
<Global> HookReturnCode PlayerSpawnHook(CBasePlayer@) Called when a player (re)spawns.
<Global> HookReturnCode ClientConnectedHook(edict_t@, const string& in, const string& in, bool& out, string& out) Called when a player connects to the server. if bDisallowJoin is set to false, the player is disconnected. szRejectReason is shown to the player if disconnected. The maximum length of the reject reason string is 127 characters.
<Global> HookReturnCode CollectedHook(CBaseEntity@, CBaseEntity@) Called when a pickup object is collected by a player.
<Global> HookReturnCode MaterializeHook(CBaseEntity@) Called when a pickup object materializes.
<Global> HookReturnCode CanCollectHook(CBaseEntity@, CBaseEntity@, bool& out) Called when a pickup object is about to be collected by a player. Note that basic checks are done before this hook is called.
<Global> HookReturnCode CanPlayerUseReservedSlotHook(edict_t@, const string& in, const string& in, bool& out) Called when a player connects to the server, and the number of slots left on the server is <= the number of reserved slots. Set bAllowJoin to true to allow the player to join (default false).
<Global> HookReturnCode ClientSayHook(SayParameters@) Called when a player says something in game chat. The SayParameters class can be used to manipulate input and veto the message.
<Global> HookReturnCode ClientPutInServerHook(CBasePlayer@) Called when a player has finished connecting and is put into the world. It is safe to send network messages to the player at this point.
<Global> HookReturnCode ClientDisconnectHook(CBasePlayer@) Called when a player disconnects. Note that this is only called if the player was fully connected, meaning the player went through ClientPutInServer. This is never called for the local host.
<Global> HookReturnCode EntityCreatedHook(CBaseEntity@) Called when a new entity is created. At this point the entity is not spawned yet and may not be fully initialized.
<Global> HookReturnCode MapChangeHook() Called when the map changes. This happens when the world is destroyed. There may still be entities that exist at this point.