20typedef float musictrack_t;
166 void SetBool(
string serverKey,
bool setValue);
207 bool GetBool(entity clientEnt,
string userKey);
219 void SetString(entity clientEnt,
string userKey,
string setValue);
225 void SetInteger(entity clientEnt,
string userKey,
int setValue);
231 void SetBool(entity clientEnt,
string userKey,
bool setValue);
237 void SetFloat(entity clientEnt,
string userKey,
float setValue);
243 void SetVector(entity clientEnt,
string userKey, vector setValue);
370 void SetUp(
int teamID,
string teamTitle, vector teamColor,
bool openTeam);
466 musictrack_t
Music(
string musicTrack);
492 string SpriteFrame(
string spritePath,
float frameNum,
float timeIntoFrame);
511 void Play(
string soundDef,
float level = 75,
float pitch = 100,
float volume = 100,
float channel = CHAN_AUTO);
520 bool AI(entity entityToCheck);
544 bool Bot(entity entityToCheck);
548 bool Item(entity entityToCheck);
590 entity
NPC(entity lastNPC);
640 void AddKey(
decl declHandle,
string keyName,
string setValue);
658setorigin_safe(entity target, vector testorg)
660 for (
int i = 0; i < 16; i++) {
661 tracebox(testorg, target.mins, target.maxs, testorg, MOVE_NORMAL, target);
663 if (!trace_startsolid) {
670 setorigin(target, testorg);
674linkToSharedProgs(
string funcName)
676 static void empty(
void)
678 print(
"Called unimplemented shared API call.\n");
682 float func = externvalue( 0, funcName);
685 return ((__variant)func);
694 ammo.NameForNum = linkToSharedProgs(
"SHPF_ammo_NameForNum");
695 ammo.NumForName = linkToSharedProgs(
"SHPF_ammo_NumForName");
696 ammo.MaxForName = linkToSharedProgs(
"SHPF_ammo_MaxForName");
697 ammo.MaxForNum = linkToSharedProgs(
"SHPF_ammo_MaxForNum");
699 cvars.SetString = linkToSharedProgs(
"SHPF_cvars_SetString");
700 cvars.SetBool = linkToSharedProgs(
"SHPF_cvars_SetBool");
701 cvars.SetInteger = linkToSharedProgs(
"SHPF_cvars_SetInteger");
702 cvars.SetFloat = linkToSharedProgs(
"SHPF_cvars_SetFloat");
703 cvars.SetVector = linkToSharedProgs(
"SHPF_cvars_SetVector");
704 cvars.GetString = linkToSharedProgs(
"SHPF_cvars_GetString");
705 cvars.GetInteger = linkToSharedProgs(
"SHPF_cvars_GetInteger");
706 cvars.GetBool = linkToSharedProgs(
"SHPF_cvars_GetBool");
707 cvars.GetFloat = linkToSharedProgs(
"SHPF_cvars_GetFloat");
708 cvars.GetVector = linkToSharedProgs(
"SHPF_cvars_GetVector");
710 declManager.New = linkToSharedProgs(
"SHPF_declManager_New");
711 declManager.GetFloat = linkToSharedProgs(
"SHPF_declManager_GetFloat");
712 declManager.GetString = linkToSharedProgs(
"SHPF_declManager_GetString");
713 declManager.GetVector = linkToSharedProgs(
"SHPF_declManager_GetVector");
714 declManager.GetBool = linkToSharedProgs(
"SHPF_declManager_GetBool");
715 declManager.AddKey = linkToSharedProgs(
"SHPF_declManager_AddKey");
716 declManager.RemoveKey = linkToSharedProgs(
"SHPF_declManager_RemoveKey");
717 declManager.Delete = linkToSharedProgs(
"SHPF_declManager_Delete");
719 userinfo.SetString = linkToSharedProgs(
"SHPF_userinfo_SetString");
720 userinfo.SetBool = linkToSharedProgs(
"SHPF_userinfo_SetBool");
721 userinfo.SetInteger = linkToSharedProgs(
"SHPF_userinfo_SetInteger");
722 userinfo.SetFloat = linkToSharedProgs(
"SHPF_userinfo_SetFloat");
723 userinfo.SetVector = linkToSharedProgs(
"SHPF_userinfo_SetVector");
724 userinfo.GetString = linkToSharedProgs(
"SHPF_userinfo_GetString");
725 userinfo.GetInteger = linkToSharedProgs(
"SHPF_userinfo_GetInteger");
726 userinfo.GetBool = linkToSharedProgs(
"SHPF_userinfo_GetBool");
727 userinfo.GetFloat = linkToSharedProgs(
"SHPF_userinfo_GetFloat");
728 userinfo.GetVector = linkToSharedProgs(
"SHPF_userinfo_GetVector");
730 serverinfo.SetString = linkToSharedProgs(
"SHPF_serverinfo_SetString");
731 serverinfo.SetBool = linkToSharedProgs(
"SHPF_serverinfo_SetBool");
732 serverinfo.SetInteger = linkToSharedProgs(
"SHPF_serverinfo_SetInteger");
733 serverinfo.SetFloat = linkToSharedProgs(
"SHPF_serverinfo_SetFloat");
734 serverinfo.SetVector = linkToSharedProgs(
"SHPF_serverinfo_SetVector");
735 serverinfo.GetString = linkToSharedProgs(
"SHPF_serverinfo_GetString");
736 serverinfo.GetInteger = linkToSharedProgs(
"SHPF_serverinfo_GetInteger");
737 serverinfo.GetBool = linkToSharedProgs(
"SHPF_serverinfo_GetBool");
738 serverinfo.GetFloat = linkToSharedProgs(
"SHPF_serverinfo_GetFloat");
739 serverinfo.GetVector = linkToSharedProgs(
"SHPF_serverinfo_GetVector");
741 teams.BestAutoJoinTeam = linkToSharedProgs(
"SHPF_teams_BestAutoJoinTeam");
742 teams.TeamCount = linkToSharedProgs(
"SHPF_teams_TeamCount");
743 teams.OpenTeamCount = linkToSharedProgs(
"SHPF_teams_OpenTeamCount");
744 teams.Color = linkToSharedProgs(
"SHPF_teams_Color");
745 teams.Name = linkToSharedProgs(
"SHPF_teams_Name");
746 teams.Score = linkToSharedProgs(
"SHPF_teams_Score");
747 teams.SpawnPoint = linkToSharedProgs(
"SHPF_teams_SpawnPoint");
748 teams.NumPlayers = linkToSharedProgs(
"SHPF_teams_NumPlayers");
749 teams.NumAlivePlayers = linkToSharedProgs(
"SHPF_teams_NumAlivePlayers");
750 teams.NumDeadPlayers = linkToSharedProgs(
"SHPF_teams_NumDeadPlayers");
751 teams.TotalDeaths = linkToSharedProgs(
"SHPF_teams_TotalDeaths");
752 teams.TotalFrags = linkToSharedProgs(
"SHPF_teams_TotalFrags");
753 teams.Valid = linkToSharedProgs(
"SHPF_teams_Valid");
754 teams.RandomPlayer = linkToSharedProgs(
"SHPF_teams_RandomPlayer");
755 teams.TotalClasses = linkToSharedProgs(
"SHPF_teams_TotalClasses");
756 teams.ClassForIndex = linkToSharedProgs(
"SHPF_teams_ClassForIndex");
759 teams.AddScore = linkToSharedProgs(
"SHPF_teams_AddScore");
760 teams.SetScore = linkToSharedProgs(
"SHPF_teams_SetScore");
761 teams.SetUp = linkToSharedProgs(
"SHPF_teams_SetUp");
762 teams.AddClass = linkToSharedProgs(
"SHPF_teams_AddClass");
763 teams.SetSpawnPoint = linkToSharedProgs(
"SHPF_teams_SetSpawnPoint");
765 precache.Material = linkToSharedProgs(
"SHPF_precache_Material");
766 precache.Model = linkToSharedProgs(
"SHPF_precache_Model");
767 precache.Music = linkToSharedProgs(
"SHPF_precache_Music");
768 precache.Sound = linkToSharedProgs(
"SHPF_precache_Sound");
769 precache.Particle = linkToSharedProgs(
"SHPF_precache_Particle");
770 precache.Entity = linkToSharedProgs(
"SHPF_precache_Entity");
771 precache.SpriteFrame = linkToSharedProgs(
"SHPF_precache_SpriteFrame");
773 soundKit.Play = linkToSharedProgs(
"SHPF_sounds_Play");
775 weaponInfo.Type = linkToSharedProgs(
"SHPF_weaponInfo_Type");
776 weaponInfo.StartAmmo = linkToSharedProgs(
"SHPF_weaponInfo_StartAmmo");
777 weaponInfo.MaxAmmo = linkToSharedProgs(
"SHPF_weaponInfo_MaxAmmo");
778 weaponInfo.IsSemiAuto = linkToSharedProgs(
"SHPF_weaponInfo_IsSemiAuto");
779 weaponInfo.InventoryType = linkToSharedProgs(
"SHPF_weaponInfo_InventoryType");
780 weaponInfo.FireTime = linkToSharedProgs(
"SHPF_weaponInfo_FireTime");
781 weaponInfo.ClipSize = linkToSharedProgs(
"SHPF_weaponInfo_ClipSize");
782 weaponInfo.Class = linkToSharedProgs(
"SHPF_weaponInfo_Class");
783 weaponInfo.IsClipOnly = linkToSharedProgs(
"SHPF_weaponInfo_IsClipOnly");
784 weaponInfo.IsDetonationTimed = linkToSharedProgs(
"SHPF_weaponInfo_IsDetonationTimed");
786 entityDef.GetString = linkToSharedProgs(
"SHPF_entityDef_GetString");
787 entityDef.GetInteger = linkToSharedProgs(
"SHPF_entityDef_GetInteger");
788 entityDef.GetBool = linkToSharedProgs(
"SHPF_entityDef_GetBool");
789 entityDef.GetFloat = linkToSharedProgs(
"SHPF_entityDef_GetFloat");
790 entityDef.GetVector = linkToSharedProgs(
"SHPF_entityDef_GetVector");
792 is.AI = linkToSharedProgs(
"SHPF_is_AI");
793 is.Bot = linkToSharedProgs(
"SHPF_is_Bot");
794 is.Alive = linkToSharedProgs(
"SHPF_is_Alive");
795 is.GodMode = linkToSharedProgs(
"SHPF_is_GodMode");
796 is.Client = linkToSharedProgs(
"SHPF_is_Client");
797 is.Player = linkToSharedProgs(
"SHPF_is_Player");
798 is.Sentient = linkToSharedProgs(
"SHPF_is_Sentient");
799 is.Item = linkToSharedProgs(
"SHPF_is_Item");
800 is.Weapon = linkToSharedProgs(
"SHPF_is_Weapon");
803 next.Actor = linkToSharedProgs(
"SHPF_next_Actor");
804 next.Item = linkToSharedProgs(
"SHPF_next_Item");
805 next.Weapon = linkToSharedProgs(
"SHPF_next_Weapon");
806 next.Player = linkToSharedProgs(
"SHPF_next_Player");
807 next.NPC = linkToSharedProgs(
"SHPF_next_NPC");
nextAPI_t next
Access nextAPI_t functions using this variable.
Definition api.h:592
weaponInfo_t weaponInfo
Access weaponInfo_t functions using this variable.
Definition api.h:294
userinfoAPI_t userinfo
Access userinfoAPI_t functions using this variable.
Definition api.h:246
precacheAPI_t precache
Access precacheAPI_t functions using this variable.
Definition api.h:506
soundAPI_t soundKit
Access soundAPI_t functions using this variable.
Definition api.h:513
declAPI_t declManager
Access declAPI_t functions using this variable.
Definition api.h:654
cvarAPI_t cvars
Access cvarAPI_t functions using this variable.
Definition api.h:122
string decl
storage type of a decl reference.
Definition api.h:594
isAPI_t is
Access nextAPI_t functions using this variable.
Definition api.h:554
entityDefAPI_t entityDef
Access entityDefAPI_t functions using this variable.
Definition api.h:437
teamAPI_t teams
Access teamAPI_t functions using this variable.
Definition api.h:401
serverinfoAPI_t serverinfo
Access serverinfoAPI_t functions using this variable.
Definition api.h:179
ammoAPI_t ammo
Access ammoAPI_t functions using this variable.
Definition api.h:58
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 MaxForName(string ammoName)
Find out the maximum ammo of a named ammo type.
CVar library.
Definition api.h:69
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:598
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:405
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:441
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:126
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:510
void Play(string soundDef, float level=75, float pitch=100, float volume=100, float channel=CHAN_AUTO)
Team library.
Definition api.h:298
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.
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.
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:183
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:250
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.
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.