20typedef float musictrack_t;
170 void SetBool(
string serverKey,
bool setValue);
211 bool GetBool(entity clientEnt,
string userKey);
223 void SetString(entity clientEnt,
string userKey,
string setValue);
229 void SetInteger(entity clientEnt,
string userKey,
int setValue);
235 void SetBool(entity clientEnt,
string userKey,
bool setValue);
241 void SetFloat(entity clientEnt,
string userKey,
float setValue);
247 void SetVector(entity clientEnt,
string userKey, vector setValue);
387 void SetUp(
int teamID,
string teamTitle, vector teamColor,
bool openTeam);
483 musictrack_t
Music(
string musicTrack);
509 string SpriteFrame(
string spritePath,
float frameNum,
float timeIntoFrame);
528 void Play(
string soundDef,
float level = 75,
float pitch = 100,
float volume = 100,
float channel = CHAN_AUTO);
537 bool AI(entity entityToCheck);
561 bool Bot(entity entityToCheck);
565 bool Item(entity entityToCheck);
607 entity
NPC(entity lastNPC);
657 void AddKey(
decl declHandle,
string keyName,
string setValue);
675setorigin_safe(entity target, vector testorg)
677 for (
int i = 0; i < 16; i++) {
678 tracebox(testorg, target.mins, target.maxs, testorg, MOVE_NORMAL, target);
680 if (!trace_startsolid) {
687 setorigin(target, testorg);
691linkToSharedProgs(
string funcName)
693 static void empty(
void)
695 print(
"Called unimplemented shared API call.\n");
699 float func = externvalue( 0, funcName);
702 return ((__variant)func);
715 ammo.
Count = linkToSharedProgs(
"SHPF_ammo_Count");
718 cvars.
SetBool = linkToSharedProgs(
"SHPF_cvars_SetBool");
724 cvars.
GetBool = linkToSharedProgs(
"SHPF_cvars_GetBool");
762 teams.
Color = linkToSharedProgs(
"SHPF_teams_Color");
763 teams.
Name = linkToSharedProgs(
"SHPF_teams_Name");
764 teams.
Score = linkToSharedProgs(
"SHPF_teams_Score");
771 teams.
Valid = linkToSharedProgs(
"SHPF_teams_Valid");
775 teams.
Flags = linkToSharedProgs(
"SHPF_teams_Flags");
781 teams.
SetUp = linkToSharedProgs(
"SHPF_teams_SetUp");
813 is.
AI = linkToSharedProgs(
"SHPF_is_AI");
814 is.
Bot = linkToSharedProgs(
"SHPF_is_Bot");
815 is.
Alive = linkToSharedProgs(
"SHPF_is_Alive");
816 is.
GodMode = linkToSharedProgs(
"SHPF_is_GodMode");
817 is.
Client = linkToSharedProgs(
"SHPF_is_Client");
818 is.
Player = linkToSharedProgs(
"SHPF_is_Player");
819 is.
Sentient = linkToSharedProgs(
"SHPF_is_Sentient");
820 is.
Item = linkToSharedProgs(
"SHPF_is_Item");
821 is.
Weapon = linkToSharedProgs(
"SHPF_is_Weapon");
824 next.
Actor = linkToSharedProgs(
"SHPF_next_Actor");
825 next.
Item = linkToSharedProgs(
"SHPF_next_Item");
826 next.
Weapon = linkToSharedProgs(
"SHPF_next_Weapon");
827 next.
Player = linkToSharedProgs(
"SHPF_next_Player");
828 next.
NPC = linkToSharedProgs(
"SHPF_next_NPC");
nextAPI_t next
Access nextAPI_t functions using this variable.
Definition: api.h:609
weaponInfo_t weaponInfo
Access weaponInfo_t functions using this variable.
Definition: api.h:303
userinfoAPI_t userinfo
Access userinfoAPI_t functions using this variable.
Definition: api.h:250
precacheAPI_t precache
Access precacheAPI_t functions using this variable.
Definition: api.h:523
soundAPI_t soundKit
Access soundAPI_t functions using this variable.
Definition: api.h:530
declAPI_t declManager
Access declAPI_t functions using this variable.
Definition: api.h:671
cvarAPI_t cvars
Access cvarAPI_t functions using this variable.
Definition: api.h:126
string decl
storage type of a decl reference.
Definition: api.h:611
isAPI_t is
Access nextAPI_t functions using this variable.
Definition: api.h:571
entityDefAPI_t entityDef
Access entityDefAPI_t functions using this variable.
Definition: api.h:454
teamAPI_t teams
Access teamAPI_t functions using this variable.
Definition: api.h:418
serverinfoAPI_t serverinfo
Access serverinfoAPI_t functions using this variable.
Definition: api.h:183
ammoAPI_t ammo
Access ammoAPI_t functions using this variable.
Definition: api.h:62
Ammo library.
Definition: api.h:39
int MaxForNum(int ammoID)
Find out the maximum ammo of a ammo type given the ID.
int NumForName(string ammoName)
Get the internal ID of an ammo type.
string NameForNum(int ammoID)
Find out the internal name of an ammo ID.
int Count()
Find out the total amount of ammo types.
int MaxForName(string ammoName)
Find out the maximum ammo of a named ammo type.
CVar library.
Definition: api.h:73
float GetBool(string cvarName)
Returns the boolean value of a console variable.
float GetFloat(string cvarName)
Returns the floating-point value of a console variable.
void SetVector(string cvarName, vector setValue)
Sets the specified console variable to a set vector.
string GetString(string cvarName)
Returns the string value of a console variable.
void SetString(string cvarName, string setValue)
Sets the specified console variable to a set string value.
void SetFloat(string cvarName, float setValue)
Sets the specified console variable to a set floating-point value.
vector GetVector(string cvarName)
Returns the vector value of a console variable.
void SetInteger(string cvarName, int setValue)
Sets the specified console variable to a set integer value.
void SetBool(string cvarName, float setValue)
Sets the specified console variable to a set boolean value.
int GetInteger(string cvarName)
Returns the integer value of a console variable.
Decl library.
Definition: api.h:615
string GetString(decl declHandle, string keyName)
Returns the string value of a key from a decl.
vector GetVector(decl declHandle, string keyName)
Returns the vector value of a decl key.
int GetInteger(decl declHandle, string keyName)
Returns the integer value of a decl key.
decl New(void)
Returns the name of a new decl in which you can store key/value pairs in.
float GetBool(decl declHandle, string keyName)
Returns the boolean value of a decl key.
void AddKey(decl declHandle, string keyName, string setValue)
Adds/updates a named key within a decl with a new string value.
float GetFloat(decl declHandle, string keyName)
Returns the floating-point value of a decl key.
void Delete(decl declHandle)
Removes a named decl from the game.
void RemoveKey(decl declHandle, string keyName)
Removes a named key from a decl entirely.
EntityDef library.
Definition: api.h:422
string GetString(string defName, string keyName)
Returns the string value of a EntityDef key.
vector GetVector(string defName, string keyName)
Returns the vector value of a EntityDef key.
float GetFloat(string defName, string keyName)
Returns the floating-point value of a EntityDef key.
float GetBool(string defName, string keyName)
Returns the boolean value of a EntityDef key.
int GetInteger(string defName, string keyName)
Returns the integer value of a EntityDef key.
float AI(entity entityToCheck)
Returns true/false depending on if the entity is an AI character.
float Sentient(entity entityToCheck)
Returns true/false depending on if the entity is either a player, or AI character.
float Bot(entity entityToCheck)
Returns true/false depending on if the entity is a bot.
float Item(entity entityToCheck)
Returns true/false depending on if the entity is an item.
float Weapon(entity entityToCheck)
Returns true/false depending on if the entity is a weapon.
float Player(entity entityToCheck)
Returns true/false depending on if the entity is a player.
float Client(entity entityToCheck)
Returns true/false depending on if the entity is a client.
float Alive(entity entityToCheck)
Returns true/false depending on if the entity is alive.
float GodMode(entity entityToCheck)
Returns true/false depending on if the entity is in "god" mode.
entity Actor(entity lastActor)
Returns the next entity of type 'Actor' in the game.
entity NPC(entity lastNPC)
Returns the next entity of type 'NPC' in the game.
entity Weapon(entity lastWeapon)
Returns the next entity of type 'Weapon' in the game.
entity Player(entity lastPlayer)
Returns the next entity of type 'Player' in the game.
entity Item(entity lastItem)
Returns the next entity of type 'Item' in the game.
Precaching library.
Definition: api.h:458
musictrack_t Music(string musicTrack)
Precaches a given music track.
string Material(string materialName)
Precaches a given material.
float Model(string pathToModel)
Precaches a given model file and additional helper files.
float Particle(string particleEffect)
Precaches a given particle effect.
string SpriteFrame(string spritePath, float frameNum, float timeIntoFrame)
Precaches a given sprite frame to a material.
float Entity(string className)
Precaches a given entity class.
float Sound(string soundDef)
Precaches a given sound def or sample.
ServerInfo library.
Definition: api.h:130
void SetBool(string serverKey, float setValue)
Server only.
void SetVector(string serverKey, vector setValue)
Server only.
float GetBool(string serverKey)
Returns the boolean value of a server info-key.
float GetFloat(string serverKey)
Returns the floating-point value of a server info-key.
void SetString(string serverKey, string setValue)
Server only.
int GetInteger(string serverKey)
Returns the integer value of a server info-key.
vector GetVector(string serverKey)
Returns the vector value of a server info-key.
string GetString(string serverKey)
Returns the string value of a server info-key.
void SetInteger(string serverKey, int setValue)
Server only.
void SetFloat(string serverKey, float setValue)
Server only.
Sound library.
Definition: api.h:527
void Play(string soundDef, float level=75, float pitch=100, float volume=100, float channel=CHAN_AUTO)
Team library.
Definition: api.h:307
string ClassForIndex(int teamID, int classIndex)
Find out the name of a team class given an index.
float Valid(int teamID)
Find out if a given team exists, or valid.
int NumDeadPlayers(int teamID)
Find out how many team players are currently inactive/dead in a match.
int TotalDeaths(int teamID)
Find out how many times all the players in a given team have 'died' in the game.
void SetUp(int teamID, string teamTitle, vector teamColor, float openTeam)
Sets up a team for the current session.
int NumPlayers(int teamID)
Find out how many players are in an active team.
void SetSpawnPoint(int teamID, string spawnPointEntityClassname)
Sets up a team spawn point for the current session.
int TeamCount(void)
Find out how many teams are registered in the current game.
int TotalClasses(int teamID)
Find out how many classes are registered within a team.
int TotalFrags(int teamID)
Find out how many times all the players in a given team have scored 'frags'.
void AddClass(int teamID, string classType)
Sets up a team class for the current session.
void SetScore(int teamID, int scoreValue)
Overridess the score of a specified team.
int NumAlivePlayers(int teamID)
Find out how many team players are active/alive in a match.
string SpawnPoint(int teamID)
Find the entity class name representing individual team spawn points.
int BestAutoJoinTeam(void)
Find out what the best choice of team it is to join.
int Score(int teamID)
Find the current score of a team.
int Flags(int teamID)
Find the flags of a team.
entity RandomPlayer(int teamID)
Find a random player belonging to a given team.
string Name(int teamID)
Find the name of a team, that you can use in prints and written text.
void AddScore(int teamID, int addedScore)
Increases the score of a specified team.
void SetFlags(int teamID, int flagsField)
Overridess the flags of a specified team.
vector Color(int teamID)
Find out which color represents a team.
int OpenTeamCount(void)
Find out how many teams are open to new players.
UserInfo library.
Definition: api.h:187
float GetBool(entity clientEnt, string userKey)
Returns the boolean value of a user info-key.
void SetString(entity clientEnt, string userKey, string setValue)
Server only.
void SetBool(entity clientEnt, string userKey, float setValue)
Sets the specified user info-key to a set boolean value.
float GetFloat(entity clientEnt, string userKey)
Returns the floating-point value of a user info-key.
string GetString(entity clientEnt, string userKey)
Returns the string value of a user info-key.
vector GetVector(entity clientEnt, string userKey)
Returns the vector value of a user info-key.
void SetFloat(entity clientEnt, string userKey, float setValue)
Server only.
int GetInteger(entity clientEnt, string userKey)
Returns the integer value of a user info-key.
void SetInteger(entity clientEnt, string userKey, int setValue)
Server only.
void SetVector(entity clientEnt, string userKey, vector setValue)
Server only.
Weapon library.
Definition: api.h:254
string InventoryType(string weaponDef)
Find out how this weapon is stored.
float FireTime(string weaponDef)
Find out the minimum delay between shots of a weapon, in seconds.
string Type(string weaponDef)
Get the "attack" type of the weapon.
float IsSemiAuto(string weaponDef)
Find out whether the weapon is semi-automatic.
int StartAmmo(string weaponDef)
The amount of ammo the specified weapon is meant to start with, when first given to the player.
string AmmoTypes(string weaponDef)
Find out all ammotypes associated with this weapon.
float IsClipOnly(string weaponDef)
Find out if a weapon takes its ammo only through its clip.
int MaxAmmo(string weaponDef)
Find the amount of ammo a weapon can hold in total when it comes to reserve ammo.
float IsDetonationTimed(string weaponDef)
Find out whether a weapon has anything to do with a timed detonation.
string Class(string weaponDef)
Find the 'class' of a weapon.
int ClipSize(string weaponDef)
Find out what the clip size of a weapon is.