Nuclide
Software Development Kit for id Technology (BETA)
api.h
1/*
2 * Copyright (c) 2016-2025 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17#define bool float
18#define true 1
19#define false 0
20typedef float musictrack_t;
21
38typedef struct
39{
43 string NameForNum(int ammoID);
47 int NumForName(string ammoName);
51 int MaxForName(string ammoName);
55 int MaxForNum(int ammoID);
56
59 int Count();
60} ammoAPI_t;
61
72typedef struct
73{
78 string GetString(string cvarName);
83 int GetInteger(string cvarName);
88 float GetFloat(string cvarName);
93 bool GetBool(string cvarName);
98 vector GetVector(string cvarName);
103 void SetString(string cvarName, string setValue);
108 void SetInteger(string cvarName, int setValue);
113 void SetBool(string cvarName, bool setValue);
118 void SetFloat(string cvarName, float setValue);
123 void SetVector(string cvarName, vector setValue);
124} cvarAPI_t;
125
129typedef struct
130{
135 string GetString(string serverKey);
140 int GetInteger(string serverKey);
145 float GetFloat(string serverKey);
150 bool GetBool(string serverKey);
155 vector GetVector(string serverKey);
160 void SetString(string serverKey, string setValue);
165 void SetInteger(string serverKey, int setValue);
170 void SetBool(string serverKey, bool setValue);
175 void SetFloat(string serverKey, float setValue);
180 void SetVector(string serverKey, vector setValue);
182
186typedef struct
187{
193 string GetString(entity clientEnt, string userKey);
199 int GetInteger(entity clientEnt, string userKey);
205 float GetFloat(entity clientEnt, string userKey);
211 bool GetBool(entity clientEnt, string userKey);
217 vector GetVector(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);
249
253typedef struct
254{
258 string Type(string weaponDef);
262 int StartAmmo(string weaponDef);
266 int MaxAmmo(string weaponDef);
270 bool IsSemiAuto(string weaponDef);
271
275 string AmmoTypes(string weaponDef);
276
280 string InventoryType(string weaponDef);
284 float FireTime(string weaponDef);
288 int ClipSize(string weaponDef);
292 string Class(string weaponDef);
296 bool IsClipOnly(string weaponDef);
300 bool IsDetonationTimed(string weaponDef);
302
306typedef struct
307{
313 int TeamCount(void);
316 int OpenTeamCount(void);
320 vector Color(int teamID);
324 string Name(int teamID);
328 int Score(int teamID);
332 string SpawnPoint(int teamID);
336 int NumPlayers(int teamID);
340 int NumAlivePlayers(int teamID);
344 int NumDeadPlayers(int teamID);
348 int TotalDeaths(int teamID);
353 int TotalFrags(int teamID);
357 bool Valid(int teamID);
361 int Flags(int teamID);
362
366 void AddScore(int teamID, int addedScore);
370 void SetScore(int teamID, int scoreValue);
374 void SetFlags(int teamID, int flagsField);
378 entity RandomPlayer(int teamID);
379
380
387 void SetUp(int teamID, string teamTitle, vector teamColor, bool openTeam);
388
389
395 void AddClass(int teamID, string classType);
396
397
401 int TotalClasses(int teamID);
402
407 string ClassForIndex(int teamID, int classIndex);
408
415 void SetSpawnPoint(int teamID, string spawnPointEntityClassname);
416} teamAPI_t;
417
421typedef struct
422{
428 string GetString(string defName, string keyName);
434 int GetInteger(string defName, string keyName);
440 float GetFloat(string defName, string keyName);
446 bool GetBool(string defName, string keyName);
452 vector GetVector(string defName, string keyName);
457typedef struct
458{
465 float Model(string pathToModel);
466
474 float Sound(string soundDef);
475
483 musictrack_t Music(string musicTrack);
484
493 float Particle(string particleEffect);
494
501 bool Entity(string className);
502
509 string SpriteFrame(string spritePath, float frameNum, float timeIntoFrame);
510
521 string Material(string materialName);
526typedef struct
527{
528 void Play(string soundDef, float level = 75, float pitch = 100, float volume = 100, float channel = CHAN_AUTO);
529} soundAPI_t;
532typedef struct
533{
537 bool AI(entity entityToCheck);
541 bool Alive(entity entityToCheck);
545 bool GodMode(entity entityToCheck);
549 bool Client(entity entityToCheck);
553 bool Player(entity entityToCheck);
557 bool Sentient(entity entityToCheck);
561 bool Bot(entity entityToCheck);
565 bool Item(entity entityToCheck);
569 bool Weapon(entity entityToCheck);
570} isAPI_t;
573typedef struct
574{
579 entity Item(entity lastItem);
580
581
586 entity Weapon(entity lastWeapon);
587
588
593 entity Actor(entity lastActor);
594
595
600 entity Player(entity lastPlayer);
601
602
607 entity NPC(entity lastNPC);
608} nextAPI_t;
611typedef string decl;
614typedef struct
615{
618 decl New(void);
619
625 string GetString(decl declHandle, string keyName);
631 int GetInteger(decl declHandle, string keyName);
637 float GetFloat(decl declHandle, string keyName);
643 bool GetBool(decl declHandle, string keyName);
649 vector GetVector(decl declHandle, string keyName);
650
657 void AddKey(decl declHandle, string keyName, string setValue);
658
663 void RemoveKey(decl declHandle, string keyName);
664
668 void Delete(decl declHandle);
669} declAPI_t;
670
671declAPI_t declManager; // end of shared
673
674void
675setorigin_safe(entity target, vector testorg)
676{
677 for (int i = 0; i < 16; i++) {
678 tracebox(testorg, target.mins, target.maxs, testorg, MOVE_NORMAL, target);
679
680 if (!trace_startsolid) {
681 break;
682 }
683
684 testorg[2] += 1.0;
685 }
686
687 setorigin(target, testorg);
688}
689
690__variant
691linkToSharedProgs(string funcName)
692{
693 static void empty(void)
694 {
695 print("Called unimplemented shared API call.\n");
696 breakpoint();
697 }
698
699 float func = externvalue( 0, funcName);
700
701 if (func) {
702 return ((__variant)func);
703 } else {
704 return (empty);
705 }
706}
707
708void
709_shared_main(void)
710{
711 ammo.NameForNum = linkToSharedProgs("SHPF_ammo_NameForNum");
712 ammo.NumForName = linkToSharedProgs("SHPF_ammo_NumForName");
713 ammo.MaxForName = linkToSharedProgs("SHPF_ammo_MaxForName");
714 ammo.MaxForNum = linkToSharedProgs("SHPF_ammo_MaxForNum");
715 ammo.Count = linkToSharedProgs("SHPF_ammo_Count");
716
717 cvars.SetString = linkToSharedProgs("SHPF_cvars_SetString");
718 cvars.SetBool = linkToSharedProgs("SHPF_cvars_SetBool");
719 cvars.SetInteger = linkToSharedProgs("SHPF_cvars_SetInteger");
720 cvars.SetFloat = linkToSharedProgs("SHPF_cvars_SetFloat");
721 cvars.SetVector = linkToSharedProgs("SHPF_cvars_SetVector");
722 cvars.GetString = linkToSharedProgs("SHPF_cvars_GetString");
723 cvars.GetInteger = linkToSharedProgs("SHPF_cvars_GetInteger");
724 cvars.GetBool = linkToSharedProgs("SHPF_cvars_GetBool");
725 cvars.GetFloat = linkToSharedProgs("SHPF_cvars_GetFloat");
726 cvars.GetVector = linkToSharedProgs("SHPF_cvars_GetVector");
727
728 declManager.New = linkToSharedProgs("SHPF_declManager_New");
729 declManager.GetFloat = linkToSharedProgs("SHPF_declManager_GetFloat");
730 declManager.GetString = linkToSharedProgs("SHPF_declManager_GetString");
731 declManager.GetVector = linkToSharedProgs("SHPF_declManager_GetVector");
732 declManager.GetBool = linkToSharedProgs("SHPF_declManager_GetBool");
733 declManager.AddKey = linkToSharedProgs("SHPF_declManager_AddKey");
734 declManager.RemoveKey = linkToSharedProgs("SHPF_declManager_RemoveKey");
735 declManager.Delete = linkToSharedProgs("SHPF_declManager_Delete");
736
737 userinfo.SetString = linkToSharedProgs("SHPF_userinfo_SetString");
738 userinfo.SetBool = linkToSharedProgs("SHPF_userinfo_SetBool");
739 userinfo.SetInteger = linkToSharedProgs("SHPF_userinfo_SetInteger");
740 userinfo.SetFloat = linkToSharedProgs("SHPF_userinfo_SetFloat");
741 userinfo.SetVector = linkToSharedProgs("SHPF_userinfo_SetVector");
742 userinfo.GetString = linkToSharedProgs("SHPF_userinfo_GetString");
743 userinfo.GetInteger = linkToSharedProgs("SHPF_userinfo_GetInteger");
744 userinfo.GetBool = linkToSharedProgs("SHPF_userinfo_GetBool");
745 userinfo.GetFloat = linkToSharedProgs("SHPF_userinfo_GetFloat");
746 userinfo.GetVector = linkToSharedProgs("SHPF_userinfo_GetVector");
747
748 serverinfo.SetString = linkToSharedProgs("SHPF_serverinfo_SetString");
749 serverinfo.SetBool = linkToSharedProgs("SHPF_serverinfo_SetBool");
750 serverinfo.SetInteger = linkToSharedProgs("SHPF_serverinfo_SetInteger");
751 serverinfo.SetFloat = linkToSharedProgs("SHPF_serverinfo_SetFloat");
752 serverinfo.SetVector = linkToSharedProgs("SHPF_serverinfo_SetVector");
753 serverinfo.GetString = linkToSharedProgs("SHPF_serverinfo_GetString");
754 serverinfo.GetInteger = linkToSharedProgs("SHPF_serverinfo_GetInteger");
755 serverinfo.GetBool = linkToSharedProgs("SHPF_serverinfo_GetBool");
756 serverinfo.GetFloat = linkToSharedProgs("SHPF_serverinfo_GetFloat");
757 serverinfo.GetVector = linkToSharedProgs("SHPF_serverinfo_GetVector");
758
759 teams.BestAutoJoinTeam = linkToSharedProgs("SHPF_teams_BestAutoJoinTeam");
760 teams.TeamCount = linkToSharedProgs("SHPF_teams_TeamCount");
761 teams.OpenTeamCount = linkToSharedProgs("SHPF_teams_OpenTeamCount");
762 teams.Color = linkToSharedProgs("SHPF_teams_Color");
763 teams.Name = linkToSharedProgs("SHPF_teams_Name");
764 teams.Score = linkToSharedProgs("SHPF_teams_Score");
765 teams.SpawnPoint = linkToSharedProgs("SHPF_teams_SpawnPoint");
766 teams.NumPlayers = linkToSharedProgs("SHPF_teams_NumPlayers");
767 teams.NumAlivePlayers = linkToSharedProgs("SHPF_teams_NumAlivePlayers");
768 teams.NumDeadPlayers = linkToSharedProgs("SHPF_teams_NumDeadPlayers");
769 teams.TotalDeaths = linkToSharedProgs("SHPF_teams_TotalDeaths");
770 teams.TotalFrags = linkToSharedProgs("SHPF_teams_TotalFrags");
771 teams.Valid = linkToSharedProgs("SHPF_teams_Valid");
772 teams.RandomPlayer = linkToSharedProgs("SHPF_teams_RandomPlayer");
773 teams.TotalClasses = linkToSharedProgs("SHPF_teams_TotalClasses");
774 teams.ClassForIndex = linkToSharedProgs("SHPF_teams_ClassForIndex");
775 teams.Flags = linkToSharedProgs("SHPF_teams_Flags");
776
777 /* server */
778 teams.AddScore = linkToSharedProgs("SHPF_teams_AddScore");
779 teams.SetScore = linkToSharedProgs("SHPF_teams_SetScore");
780 teams.SetFlags = linkToSharedProgs("SHPF_teams_SetFlags");
781 teams.SetUp = linkToSharedProgs("SHPF_teams_SetUp");
782 teams.AddClass = linkToSharedProgs("SHPF_teams_AddClass");
783 teams.SetSpawnPoint = linkToSharedProgs("SHPF_teams_SetSpawnPoint");
784
785 precache.Material = linkToSharedProgs("SHPF_precache_Material");
786 precache.Model = linkToSharedProgs("SHPF_precache_Model");
787 precache.Music = linkToSharedProgs("SHPF_precache_Music");
788 precache.Sound = linkToSharedProgs("SHPF_precache_Sound");
789 precache.Particle = linkToSharedProgs("SHPF_precache_Particle");
790 precache.Entity = linkToSharedProgs("SHPF_precache_Entity");
791 precache.SpriteFrame = linkToSharedProgs("SHPF_precache_SpriteFrame");
792
793 soundKit.Play = linkToSharedProgs("SHPF_sounds_Play");
794
795 weaponInfo.Type = linkToSharedProgs("SHPF_weaponInfo_Type");
796 weaponInfo.StartAmmo = linkToSharedProgs("SHPF_weaponInfo_StartAmmo");
797 weaponInfo.MaxAmmo = linkToSharedProgs("SHPF_weaponInfo_MaxAmmo");
798 weaponInfo.AmmoTypes = linkToSharedProgs("SHPF_weaponInfo_AmmoTypes");
799 weaponInfo.IsSemiAuto = linkToSharedProgs("SHPF_weaponInfo_IsSemiAuto");
800 weaponInfo.InventoryType = linkToSharedProgs("SHPF_weaponInfo_InventoryType");
801 weaponInfo.FireTime = linkToSharedProgs("SHPF_weaponInfo_FireTime");
802 weaponInfo.ClipSize = linkToSharedProgs("SHPF_weaponInfo_ClipSize");
803 weaponInfo.Class = linkToSharedProgs("SHPF_weaponInfo_Class");
804 weaponInfo.IsClipOnly = linkToSharedProgs("SHPF_weaponInfo_IsClipOnly");
805 weaponInfo.IsDetonationTimed = linkToSharedProgs("SHPF_weaponInfo_IsDetonationTimed");
806
807 entityDef.GetString = linkToSharedProgs("SHPF_entityDef_GetString");
808 entityDef.GetInteger = linkToSharedProgs("SHPF_entityDef_GetInteger");
809 entityDef.GetBool = linkToSharedProgs("SHPF_entityDef_GetBool");
810 entityDef.GetFloat = linkToSharedProgs("SHPF_entityDef_GetFloat");
811 entityDef.GetVector = linkToSharedProgs("SHPF_entityDef_GetVector");
812
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");
822
823 /* helpful finder */
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");
829}
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.
Definition: api.h:533
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.
Definition: api.h:574
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.