Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
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
36
38typedef struct
39{
43 string NameForNum(int ammoID);
47 int NumForName(string ammoName);
51 int MaxForName(string ammoName);
55 int MaxForNum(int ammoID);
56} ammoAPI_t;
57
59
60
68typedef struct
69{
74 string GetString(string cvarName);
79 int GetInteger(string cvarName);
84 float GetFloat(string cvarName);
89 bool GetBool(string cvarName);
94 vector GetVector(string cvarName);
99 void SetString(string cvarName, string setValue);
104 void SetInteger(string cvarName, int setValue);
109 void SetBool(string cvarName, bool setValue);
114 void SetFloat(string cvarName, float setValue);
119 void SetVector(string cvarName, vector setValue);
120} cvarAPI_t;
121
123
125typedef struct
126{
131 string GetString(string serverKey);
136 int GetInteger(string serverKey);
141 float GetFloat(string serverKey);
146 bool GetBool(string serverKey);
151 vector GetVector(string serverKey);
156 void SetString(string serverKey, string setValue);
161 void SetInteger(string serverKey, int setValue);
166 void SetBool(string serverKey, bool setValue);
171 void SetFloat(string serverKey, float setValue);
176 void SetVector(string serverKey, vector setValue);
178
180
182typedef struct
183{
189 string GetString(entity clientEnt, string userKey);
195 int GetInteger(entity clientEnt, string userKey);
201 float GetFloat(entity clientEnt, string userKey);
207 bool GetBool(entity clientEnt, string userKey);
213 vector GetVector(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);
245
247
249typedef struct
250{
254 string Type(string weaponDef);
258 int StartAmmo(string weaponDef);
262 int MaxAmmo(string weaponDef);
266 bool IsSemiAuto(string weaponDef);
267
271 string InventoryType(string weaponDef);
275 float FireTime(string weaponDef);
279 int ClipSize(string weaponDef);
283 string Class(string weaponDef);
287 bool IsClipOnly(string weaponDef);
291 bool IsDetonationTimed(string weaponDef);
293
295
297typedef struct
298{
304 int TeamCount(void);
307 int OpenTeamCount(void);
311 vector Color(int teamID);
315 string Name(int teamID);
319 int Score(int teamID);
323 string SpawnPoint(int teamID);
327 int NumPlayers(int teamID);
331 int NumAlivePlayers(int teamID);
335 int NumDeadPlayers(int teamID);
339 int TotalDeaths(int teamID);
344 int TotalFrags(int teamID);
348 bool Valid(int teamID);
349
353 void AddScore(int teamID, int addedScore);
357 void SetScore(int teamID, int scoreValue);
361 entity RandomPlayer(int teamID);
362
363
370 void SetUp(int teamID, string teamTitle, vector teamColor, bool openTeam);
371
372
378 void AddClass(int teamID, string classType);
379
380
384 int TotalClasses(int teamID);
385
390 string ClassForIndex(int teamID, int classIndex);
391
398 void SetSpawnPoint(int teamID, string spawnPointEntityClassname);
399} teamAPI_t;
400
402
404typedef struct
405{
411 string GetString(string defName, string keyName);
417 int GetInteger(string defName, string keyName);
423 float GetFloat(string defName, string keyName);
429 bool GetBool(string defName, string keyName);
435 vector GetVector(string defName, string keyName);
438
440typedef struct
441{
448 float Model(string pathToModel);
449
457 float Sound(string soundDef);
458
466 musictrack_t Music(string musicTrack);
467
476 float Particle(string particleEffect);
477
484 bool Entity(string className);
485
492 string SpriteFrame(string spritePath, float frameNum, float timeIntoFrame);
493
504 string Material(string materialName);
507
509typedef struct
510{
511 void Play(string soundDef, float level = 75, float pitch = 100, float volume = 100, float channel = CHAN_AUTO);
512} soundAPI_t;
514
515typedef struct
516{
520 bool AI(entity entityToCheck);
524 bool Alive(entity entityToCheck);
528 bool GodMode(entity entityToCheck);
532 bool Client(entity entityToCheck);
536 bool Player(entity entityToCheck);
540 bool Sentient(entity entityToCheck);
544 bool Bot(entity entityToCheck);
548 bool Item(entity entityToCheck);
552 bool Weapon(entity entityToCheck);
553} isAPI_t;
555
556typedef struct
557{
562 entity Item(entity lastItem);
563
564
569 entity Weapon(entity lastWeapon);
570
571
576 entity Actor(entity lastActor);
577
578
583 entity Player(entity lastPlayer);
584
585
590 entity NPC(entity lastNPC);
591} nextAPI_t;
593
594typedef string decl;
595
597typedef struct
598{
601 decl New(void);
602
608 string GetString(decl declHandle, string keyName);
614 int GetInteger(decl declHandle, string keyName);
620 float GetFloat(decl declHandle, string keyName);
626 bool GetBool(decl declHandle, string keyName);
632 vector GetVector(decl declHandle, string keyName);
633
640 void AddKey(decl declHandle, string keyName, string setValue);
641
646 void RemoveKey(decl declHandle, string keyName);
647
651 void Delete(decl declHandle);
652} declAPI_t;
653
654declAPI_t declManager; // end of shared
656
657void
658setorigin_safe(entity target, vector testorg)
659{
660 for (int i = 0; i < 16; i++) {
661 tracebox(testorg, target.mins, target.maxs, testorg, MOVE_NORMAL, target);
662
663 if (!trace_startsolid) {
664 break;
665 }
666
667 testorg[2] += 1.0;
668 }
669
670 setorigin(target, testorg);
671}
672
673__variant
674linkToSharedProgs(string funcName)
675{
676 static void empty(void)
677 {
678 print("Called unimplemented shared API call.\n");
679 breakpoint();
680 }
681
682 float func = externvalue( 0, funcName);
683
684 if (func) {
685 return ((__variant)func);
686 } else {
687 return (empty);
688 }
689}
690
691void
692_shared_main(void)
693{
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");
698
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");
709
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");
718
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");
729
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");
740
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");
757
758 /* server */
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");
764
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");
772
773 soundKit.Play = linkToSharedProgs("SHPF_sounds_Play");
774
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");
785
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");
791
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");
801
802 /* helpful finder */
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");
808}
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.
Definition api.h:516
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:557
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.