Skip to content

Miscellaneous

bool IsServer()

bool IsClient()

bool IsToolsMode()

bool IsFNF()

bool IsGameFromReload()

int GetCPULevel()

bool IsEnemyTeam( int ownTeam, int otherTeam )

Returns if otherTeam is an enemy of ownTeam

void SetMaxActivityMode( int mode )

int CalculateHashForString( string s )

void CreateRope( vector start, vector end, float length = 0, entity startEnt = null, entity endEnt = null, int startAttachment = 0, int endAttachment = 0, string material = "", int segmentCount = 0 )

Creates a rope between two points or entities.

float GetTeamSkill( int team )

void SendToConsole( string cmd )

Execute cmd on the local host

void RecordAchievementEvent( string s1, number n1 )

void ServiceEventQueue()

void SetDucking( string s1, string s2, number n1 )

void GrantClientSidePickup_MatchCandy( entity player, int amount, vector origin, int flags, int recieptID )

void NoteMatchState( number a1, number a2, number a3, number a4, number a5, number a6, number a7, number a8, number a9 )

void NoteLobbyState( number a1, string a2 )

bool IsHighPerfDevServer()

bool ShouldAwardHappyHourBonus( entity player )

bool InPrediction()

bool IsFirstTimePredicted()

string GetMapName()

Get the map name of the current map

bool IsFastIterationEnabled()

bool BuildingCubeMaps()

bool IsTestMap()

Returns value of IsTestMap from the level's script list .rson file

Parents & Children

void AssertNoPlayerChildren( entity parent )

void TryClearParent( entity parent )

void SetForceDrawWhileParented( entity child, bool force )

Visual Options

void SetCrosshairTeamColoringDisabled( entity player, bool disabled )

void SetHideOnCloak( entity ent, bool hide )

VPK

void VPKNotifyFile( string file )

Player Utils

bool IsPlayerSafeFromNPCs( entity player )

bool IsPlayerSafeFromProjectiles( entity player, vector origin )

entity GetWindowHint( vector startPos, number radius, number height, vector dir, number distance, number gravity, number margin, entity ignoreEnt )

Returns the best window hint.

void ScreenFade( entity player, number r, number g, number b, number fadeTime, number fadeHold, int fadeFlags )

Fade the player's scren.

Fade flags start with FFADE_

Levels

void SetXPForLevel( int a, int b )

Sets the XP required for a player to get to a certain level

int GetLevelForXP( int n )

Entity Utils

float GetHealthFrac( entity ent )

bool IsMagneticTarget( entity ent )

Returns if an entity is a magnetic target

bool IsTurret( entity ent )

int GetHitgroupForHitboxOnEntity( var a, number b )

void PutEntityInSafeSpot( entity ent, entity referenceEnt, entity movingGroundEnt, vector, safeStartingLocationForEntity, vector positionAtEndOfAnimationForEntity )

float GetHealthFrac( entity ent )

bool IsMagneticTarget( entity ent )

Returns if an entity is a magnetic target

bool IsTurret( entity ent )

Is entity a turret

Weapon Utils

void Weapon_SetDespawnTime( number time )

int GetImpactEffectTable( string weapon )

float CalcWeaponDamage( entity owner, entity target, entity weapon, number distanceToTarget, int extraMods )

Preinstall

bool IsGameFullyInstalled()

Returns true if the full game is installed. You can't start mp or any sp map but sp_training and sp_crashsite if this is false.

bool IsGamePartiallyInstalled()

Returns true if the game is partially installed. You can't start sp training this is false.

float GetGameFullyInstalledProgress()

Returns fraction 0.0 to 1.0 of downloading of full game progress.

bool Script_IsRunningTrialVersion()

Only call when we have an active user.

Script Reloads

void ReloadScriptCallbacks()

void ReloadingScriptsBegin()

void ReloadingScriptsEnd()