Nuclide
Software Development Kit for id Technology (BETA)
api_func.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
18typedef enum
19{
25
28typedef enumflags
29{
30 AF_LEFT,
31 AF_TOP,
32 AF_RIGHT,
33 AF_BOTTOM
34} alignflags_t;
35#define AF_NONE 0
36
38typedef struct
39{
40 int iID;
41 int iScaleX;
42 int iScaleY;
43 vector vecColor;
44 float flAlpha;
45 int iFlags;
46 string hexColor;
47} font_s;
48
141typedef struct
142{
153 float GetID(font_s fnt);
154
159 void Load(string fontDef,font_s &fntNew);
160
165 string RGBtoHex(vector normalizedColor);
166
172
186 float StringWidth(string inputText,bool hasColor,font_s fnt);
187} fontAPI_t;
192typedef struct
193{
194 vector Mins(void);
195 vector Size(void);
196 float Width(void);
197 float Height(void);
198 vector HUDMins(void);
199 vector HUDSize(void);
204typedef struct
205{
212 void Rect(vector rectPos, vector rectSize, vector rectRGB , float rectAlpha);
220 void RectOutline(vector rectPos, vector rectSize, float outlineThickness, vector rectColor, float rectAlpha);
227 void RoundedRectOutline(vector rectPos, vector rectSize, vector rectColor, float rectAlpha);
228
235 void RoundedBox(vector boxPos, vector boxSize, vector boxColor, float boxAlpha);
236
244 void Line(float lineThickness, vector startPos, vector endPos, vector lineColor, float lineAlpha);
252 void Pic(vector imagePos, string imageName, vector imageSize, vector imageColor, float imageAlpha, float imageFlags);
262 void SubPic(vector imagePos, vector displaySize, string imageName, vector sourcePos, vector sourceSize, vector imageColor, float imageAlpha, float imageFlags);
268 void Text(vector vecOrigin, string strText, font_s fnt);
275 void Text_A(vector vecOrigin, string strText, float a, font_s fnt);
282 void Text_RGB(vector vecOrigin, string strText, vector col, font_s fnt);
291 void Text_RGBA(vector vecOrigin, string strText, vector col, float a, font_s fnt);
294 void RText(vector vecOrigin, string strText, font_s fnt);
297 void RText_A(vector vecOrigin, string strText, float a, font_s fnt);
300 void RText_RGB(vector vecOrigin, string strText, vector col, font_s fnt);
303 void RText_RGBA(vector vecOrigin, string strText, vector col, float a, font_s fnt);
311 void TextField(vector vecOrigin, vector vecSize, string strText, font_s fnt, alignflags_t iAlignFlags);
320 void TextFieldAtHeight(vector vecOrigin, vector vecSize, int iTextHeight, string strText, font_s fnt, alignflags_t iAlignFlags);
321
323 void RadarRect(vector vecOrigin, vector vecSize);
324} drawAPI_t;
328typedef struct
329{
333 vector GetCameraPosition(void);
337 vector GetCameraAngles(void);
341 float GetArmor(void);
345 float GetHealth(void);
349 float GetStamina(void);
353 int GetTeam(void);
358 bool IsStanding(void);
362 bool IsLeaning(void);
366 bool IsSprinting(void);
370 bool IsCrouched(void);
374 bool IsProne(void);
378 bool IsMoving(void);
382 bool IsFalling(void);
387 bool HasItem(string itemClassName);
392 string GetString(string userKey);
397 int GetInteger(string userKey);
402 float GetFloat(string userKey);
407 bool GetBool(string userKey);
412 vector GetVector(string userKey);
413
419 float GetGameFlags(void);
424typedef struct
425{
430 bool IsValid(entity weaponRef = __NULL__);
435 string GetTitle(entity weaponRef = __NULL__);
440 int GetSlot(entity weaponRef = __NULL__);
445 int GetSlotPos(entity weaponRef = __NULL__);
450 string GetIcon(entity weaponRef = __NULL__);
455 string GetSelectedIcon(entity weaponRef = __NULL__);
459 int GetAmmo1(entity weaponRef = __NULL__);
463 int GetAmmo2(entity weaponRef = __NULL__);
467 int GetClip(entity weaponRef = __NULL__);
471 int GetClipSize(entity weaponRef = __NULL__);
475 int MaxAmmo(entity weaponRef = __NULL__);
479 bool IsEmpty(entity weaponRef = __NULL__);
483 bool UsesSecondaryAmmo(entity weaponRef = __NULL__);
487 bool AmmoRequired(entity weaponRef = __NULL__);
488
492 entity GetActiveWeapon(void);
501
507
512 entity GetPreviousWeaponRelativeTo(entity playerWeapon);
513
517 void SelectWeapon(entity);
523typedef struct
524{
525 ncSpectatorMode_t Mode(void);
526 string LocalizedMode(void);
527 string Name(void);
528 int Team(void);
533typedef struct
534{
535 int Load(string atlasPicName); /* loads a permanent handle for the named atlas pic */
536 void Draw(int atlasPic, vector drawAtPos, bool forceAdditive);
537 void Draw_A(int atlasPic, vector drawAtPos, float picAlpha, bool forceAdditive);
538 void Draw_RGBA(int atlasPic, vector drawAtPos, vector picColor, float picAlpha, bool forceAdditive);
539 void DrawTop_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
540 void DrawBottom_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
541 void DrawLeft_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
542 void DrawRight_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
543
544
545 void DrawTop_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
546 void DrawBottom_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
547 void DrawLeft_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
548 void DrawRight_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
549
550 void Draw_RGB(int atlasPic, vector drawAtPos, vector picColor, bool forceAdditive);
552 float GetWidth(int atlasPic);
553 float GetHeight(int atlasPic);
554 vector GetSize(int atlasPic);
559typedef struct
560{
561 bool Cached(void);
562 float GetWidth(string materialName);
563 float GetHeight(string materialName);
564 vector GetSize(string materialName);
566var materialAPI_t material; // end of hudC
569
570/* To be implemented by HUD */
571void HUD_Init(void);
572
573__variant
574linkToClientProgs(string funcName)
575{
576 static void empty(void)
577 {
578 print("Called unimplemented client-side API call.\n");
579 breakpoint();
580 }
581
582 void *func = externvalue(0, funcName);
583
584 if (func) {
585 return ((__variant)func);
586 } else {
587 return (empty);
588 }
589}
590
591void
592_client_main(void)
593{
594 font.GetHeight = linkToClientProgs("Font_GetHeight");
595 font.GetID = linkToClientProgs("Font_GetID");
596 font.Load = linkToClientProgs("Font_Load");
597 font.RGBtoHex = linkToClientProgs("Font_RGBtoHex");
598 font.StringWidth = linkToClientProgs("Font_StringWidth");
599
600 screen.Width = linkToClientProgs("CLPF_surface_ScreenWidth");
601 screen.Height = linkToClientProgs("CLPF_surface_ScreenHeight");
602 screen.Size = linkToClientProgs("CLPF_surface_ScreenSize");
603 screen.Mins = linkToClientProgs("CLPF_surface_ScreenMins");
604 screen.HUDMins = linkToClientProgs("CLPF_surface_HUDMins");
605 screen.HUDSize = linkToClientProgs("CLPF_surface_HUDSize");
606
607 material.GetSize = linkToClientProgs("CLPF_material_GetSize");
608 material.GetWidth = linkToClientProgs("CLPF_material_GetWidth");
609 material.GetHeight = linkToClientProgs("CLPF_material_GetHeight");
610 material.Cached = linkToClientProgs("CLPF_material_Cached");
611
612 player.GetCameraPosition = linkToClientProgs("CLPF_player_GetCameraPosition");
613 player.GetCameraAngles = linkToClientProgs("CLPF_player_GetCameraAngles");
614 player.GetHealth = linkToClientProgs("CLPF_player_GetHealth");
615 player.GetArmor = linkToClientProgs("CLPF_player_GetArmor");
616 player.GetStamina = linkToClientProgs("CLPF_player_GetStamina");
617 player.GetTeam = linkToClientProgs("CLPF_player_GetTeam");
618 player.HasItem = linkToClientProgs("CLPF_player_HasItem");
619 player.IsStanding = linkToClientProgs("CLPF_player_IsStanding");
620 player.IsLeaning = linkToClientProgs("CLPF_player_IsLeaning");
621 player.IsSprinting = linkToClientProgs("CLPF_player_IsSprinting");
622 player.IsCrouched = linkToClientProgs("CLPF_player_IsCrouching");
623 player.IsProne = linkToClientProgs("CLPF_player_IsProne");
624 player.IsMoving = linkToClientProgs("CLPF_player_IsMoving");
625 player.IsFalling = linkToClientProgs("CLPF_player_IsFalling");
626 player.GetGameFlags = linkToClientProgs("CLPF_player_GetGameFlags");
627
628 player.GetString = linkToClientProgs("CLPF_player_GetString");
629 player.GetInteger = linkToClientProgs("CLPF_player_GetInteger");
630 player.GetBool = linkToClientProgs("CLPF_player_GetBool");
631 player.GetFloat = linkToClientProgs("CLPF_player_GetFloat");
632 player.GetVector = linkToClientProgs("CLPF_player_GetVector");
633
634 weapon.IsValid = linkToClientProgs("CLPF_weapon_IsValid");
635 weapon.GetTitle = linkToClientProgs("CLPF_weapon_GetTitle");
636 weapon.GetIcon = linkToClientProgs("CLPF_weapon_GetIcon");
637 weapon.GetSelectedIcon = linkToClientProgs("CLPF_weapon_GetSelectedIcon");
638 weapon.GetSlot = linkToClientProgs("CLPF_weapon_GetSlot");
639 weapon.GetSlotPos = linkToClientProgs("CLPF_CLPF_weapon_GetSlotPos");
640 weapon.GetAmmo1 = linkToClientProgs("CLPF_weapon_GetAmmo1");
641 weapon.GetAmmo2 = linkToClientProgs("CLPF_weapon_GetAmmo2");
642 weapon.GetClip = linkToClientProgs("CLPF_weapon_GetClip");
643 weapon.GetClipSize = linkToClientProgs("CLPF_CLPF_weapon_GetClipSize");
644 weapon.MaxAmmo = linkToClientProgs("CLPF_weapon_MaxAmmo");
645 weapon.IsEmpty = linkToClientProgs("CLPF_weapon_IsEmpty");
646 weapon.UsesSecondaryAmmo = linkToClientProgs("CLPF_weapon_UsesSecondaryAmmo");
647 weapon.AmmoRequired = linkToClientProgs("CLPF_weapon_AmmoRequired");
648 weapon.GetActiveWeapon = linkToClientProgs("CLPF_weapon_GetActiveWeapon");
649 weapon.GetFirstWeaponInInventory = linkToClientProgs("CLPF_weapon_GetFirstWeaponInInventory");
650 weapon.GetLastWeaponInInventory = linkToClientProgs("CLPF_weapon_GetLastWeaponInInventory");
651 weapon.GetNextWeaponRelativeTo = linkToClientProgs("CLPF_weapon_GetNextWeaponRelativeTo");
652 weapon.GetPreviousWeaponRelativeTo = linkToClientProgs("CLPF_weapon_GetPreviousWeaponRelativeTo");
653 weapon.SelectWeapon = linkToClientProgs("CLPF_weapon_SelectWeapon");
654
655 draw.Rect = linkToClientProgs("CLPF_draw_Rect");
656 draw.RectOutline = linkToClientProgs("CLPF_draw_RectOutline");
657 draw.RoundedRectOutline = linkToClientProgs("CLPF_draw_RoundedRectOutline");
658 draw.RoundedBox = linkToClientProgs("CLPF_draw_RoundedBox");
659 draw.Line = linkToClientProgs("CLPF_draw_Line");
660 draw.Pic = linkToClientProgs("CLPF_draw_Pic");
661 draw.SubPic = linkToClientProgs("CLPF_draw_SubPic");
662
663 draw.TextField = linkToClientProgs("Font_DrawField");
664 draw.TextFieldAtHeight = linkToClientProgs("Font_DrawFieldAtHeight");
665 draw.RText = linkToClientProgs("Font_DrawRText");
666 draw.RText_A = linkToClientProgs("Font_DrawRText_A");
667 draw.RText_RGB = linkToClientProgs("Font_DrawRText_RGB");
668 draw.RText_RGBA = linkToClientProgs("Font_DrawRText_RGBA");
669 draw.Text = linkToClientProgs("Font_DrawText");
670 draw.Text_A= linkToClientProgs("Font_DrawText_A");
671 draw.Text_RGB= linkToClientProgs("Font_DrawText_RGB");
672 draw.Text_RGBA = linkToClientProgs("Font_DrawText_RGBA");
673 draw.RadarRect = linkToClientProgs("CLPF_draw_RadarRect");
674
675 spectating.Mode = linkToClientProgs("CLPF_spectating_Mode");
676 spectating.LocalizedMode = linkToClientProgs("CLPF_spectating_LocalizedMode");
677 spectating.Name = linkToClientProgs("CLPF_spectating_Name");
678 spectating.Team = linkToClientProgs("CLPF_spectating_Team");
679
680 atlasPic.Load = linkToClientProgs("CLPF_atlasPic_Load");
681 atlasPic.Draw = linkToClientProgs("CLPF_atlasPic_Draw");
682 atlasPic.Draw_A = linkToClientProgs("CLPF_atlasPic_Draw_A");
683 atlasPic.Draw_RGB = linkToClientProgs("CLPF_atlasPic_Draw_RGB");
684 atlasPic.Draw_RGBA = linkToClientProgs("CLPF_atlasPic_Draw_RGBA");
685 atlasPic.DrawTop_RGBA = linkToClientProgs("CLPF_atlasPic_DrawTop_RGBA");
686 atlasPic.DrawBottom_RGBA = linkToClientProgs("CLPF_atlasPic_DrawBottom_RGBA");
687 atlasPic.DrawLeft_RGBA = linkToClientProgs("CLPF_atlasPic_DrawLeft_RGBA");
688 atlasPic.DrawRight_RGBA = linkToClientProgs("CLPF_atlasPic_DrawRight_RGBA");
689
690 atlasPic.DrawTop_RGB = linkToClientProgs("CLPF_atlasPic_DrawTop_RGB");
691 atlasPic.DrawBottom_RGB = linkToClientProgs("CLPF_atlasPic_DrawBottom_RGB");
692 atlasPic.DrawLeft_RGB = linkToClientProgs("CLPF_atlasPic_DrawLeft_RGB");
693 atlasPic.DrawRight_RGB = linkToClientProgs("CLPF_atlasPic_DrawRight_RGB");
694
695 atlasPic.DrawCrosshair = linkToClientProgs("CLPF_atlasPic_DrawCrosshair");
696 atlasPic.GetWidth = linkToClientProgs("CLPF_atlasPic_GetWidth");
697 atlasPic.GetHeight = linkToClientProgs("CLPF_atlasPic_GetHeight");
698 atlasPic.GetSize = linkToClientProgs("CLPF_atlasPic_GetSize");
699}
var surfaceAPI_t screen
Access surfaceAPI_t functions using this variable.
Definition: api_func.h:201
var spectatingAPI_t spectating
Access spectatingAPI_t functions using this variable.
Definition: api_func.h:530
var fontAPI_t font
Access fontAPI_t functions using this variable.
Definition: api_func.h:188
var materialAPI_t material
Access atlasPicAPI_t functions using this variable.
Definition: api_func.h:566
var weaponAPI_t weapon
Access weaponAPI_t functions using this variable.
Definition: api_func.h:519
var drawAPI_t draw
Access drawAPI_t functions using this variable.
Definition: api_func.h:325
var atlasPicAPI_t atlasPic
Access atlasPicAPI_t functions using this variable.
Definition: api_func.h:556
var playerAPI_t player
Access playerAPI_t functions using this variable.
Definition: api_func.h:421
drawflag_t
Flags for 2D drawing operations.
Definition: font.h:27
typedef enumflags
Defines the valid alignment flags for text fields.
Definition: font.h:37
@ DRAWFLAG_ADDITIVE
Render with an additive blend mode.
Definition: api_func.h:21
@ DRAWFLAG_MODULATE
Not implemented in FTEQW.
Definition: api_func.h:22
@ DRAWFLAG_2XMODULATE
Not implemented in FTEQW.
Definition: api_func.h:23
@ DRAWFLAG_NORMAL
The default.
Definition: api_func.h:20
atlasPic library
Definition: api_func.h:534
void DrawLeft_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive)
void DrawTop_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive)
void Draw_RGB(int atlasPic, vector drawAtPos, vector picColor, bool forceAdditive)
void DrawRight_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive)
void DrawLeft_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive)
float GetWidth(int atlasPic)
void Draw_RGBA(int atlasPic, vector drawAtPos, vector picColor, float picAlpha, bool forceAdditive)
int Load(string atlasPicName)
float GetHeight(int atlasPic)
void DrawBottom_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive)
void Draw_A(int atlasPic, vector drawAtPos, float picAlpha, bool forceAdditive)
void DrawTop_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive)
void DrawRight_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive)
void Draw(int atlasPic, vector drawAtPos, bool forceAdditive)
void DrawCrosshair(int atlasPic)
vector GetSize(int atlasPic)
void DrawBottom_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive)
Draw library.
Definition: api_func.h:205
void RText_RGB(vector vecOrigin, string strText, vector col, font_s fnt)
Right-aligned variant of Text_RGB().
void Text(vector vecOrigin, string strText, font_s fnt)
Draw text on the screen at the desired position with a desired font.
void Line(float lineThickness, vector startPos, vector endPos, vector lineColor, float lineAlpha)
Displays a line with a specified thickness and color.
void TextFieldAtHeight(vector vecOrigin, vector vecSize, int iTextHeight, string strText, font_s fnt, alignflags_t iAlignFlags)
Draws a textfield with line wrapping at a custom text height.
void Text_RGBA(vector vecOrigin, string strText, vector col, float a, font_s fnt)
Draw tinted and alpha blended text on the screen at the desired position with a desired font.
void TextField(vector vecOrigin, vector vecSize, string strText, font_s fnt, alignflags_t iAlignFlags)
Draws a textfield with line wrapping.
void Text_RGB(vector vecOrigin, string strText, vector col, font_s fnt)
Draw tinted text on the screen at the desired position with a desired font.
void RoundedRectOutline(vector rectPos, vector rectSize, vector rectColor, float rectAlpha)
Displays a colored, rounded rectangle outline at the specified position with a specified size.
void RadarRect(vector vecOrigin, vector vecSize)
Draws an opaque, rectangular radar that is centered around the current player, or the player that is ...
void Rect(vector rectPos, vector rectSize, vector rectRGB, float rectAlpha)
Displays a solid colored rectangle at the specified position with a specified size.
void SubPic(vector imagePos, vector displaySize, string imageName, vector sourcePos, vector sourceSize, vector imageColor, float imageAlpha, float imageFlags)
Draws part of an image from either the virtual file-system, or the materials.
void RText_RGBA(vector vecOrigin, string strText, vector col, float a, font_s fnt)
Right-aligned variant of Text_RGBA().
void RoundedBox(vector boxPos, vector boxSize, vector boxColor, float boxAlpha)
Displays a colored rounded box at the specified position with a specified size.
void Pic(vector imagePos, string imageName, vector imageSize, vector imageColor, float imageAlpha, float imageFlags)
Draws an image from either the virtual file-system, or the materials.
void RText_A(vector vecOrigin, string strText, float a, font_s fnt)
Right-aligned variant of Text_A().
void RectOutline(vector rectPos, vector rectSize, float outlineThickness, vector rectColor, float rectAlpha)
Displays a colored rectangle outline at the specified position with a specified size.
void RText(vector vecOrigin, string strText, font_s fnt)
Right-aligned variant of Text().
void Text_A(vector vecOrigin, string strText, float a, font_s fnt)
Draw alpha-blended text on the screen at the desired position with a desired font.
Font library.
Definition: api_func.h:142
float GetID(font_s fnt)
Get the internal font id.
string RGBtoHex(vector normalizedColor)
Converts a normalized RGB color vector to a hex color string.
void Load(string fontDef, font_s &fntNew)
Load a desired .font definition into memory.
int GetHeight(font_s fnt)
Returns the height of a specified font in pixels.
float StringWidth(string inputText, bool hasColor, font_s fnt)
Returns the width of a series of characters in pixels.
Representation of a font.
Definition: api_func.h:39
int iFlags
Rendering flags that the font posesses.
Definition: api_func.h:45
int iScaleX
Suggested maximum width of a character in the font.
Definition: api_func.h:41
int iScaleY
Maximum height of a chracter in the font.
Definition: api_func.h:42
vector vecColor
Suggested default color of the font.
Definition: api_func.h:43
float flAlpha
Suggested default alpha of the font.
Definition: api_func.h:44
int iID
Internal ID, will be passed to 'drawfont' before rendering text.
Definition: api_func.h:40
string hexColor
Definition: api_func.h:46
material library
Definition: api_func.h:560
bool Cached(void)
float GetWidth(string materialName)
float GetHeight(string materialName)
vector GetSize(string materialName)
Player library.
Definition: api_func.h:329
float GetFloat(string userKey)
Returns the floating-point value of a current/active player's info-key.
int GetTeam(void)
Get the current player's team ID.
bool GetBool(string userKey)
Returns the boolean value of a current/active player's info-key.
float GetHealth(void)
Get the current player's health value.
float GetArmor(void)
Get the current player's armor value.
bool IsLeaning(void)
Check if the current player is leaning in any direction.
bool IsProne(void)
Check if the current player is actively prone/laying flat on the ground.
bool IsCrouched(void)
Check if the current player is actively crouched/ducked.
vector GetCameraAngles(void)
Get the current 3D viewport's camera angle.
bool IsMoving(void)
Check if the current player is actively moving.
bool HasItem(string itemClassName)
Check if the current player has a particular item.
int GetInteger(string userKey)
Returns the integer value of a current/active player's info-key.
bool IsStanding(void)
Check if the current player is standing upright.
float GetStamina(void)
Get the current player's stamina value.
vector GetVector(string userKey)
Returns the vector value of a current/active player's info-key.
float GetGameFlags(void)
Returns the game flags of the player entity.
string GetString(string userKey)
Returns the string value of the current/active player's info-key.
bool IsFalling(void)
Check if the current player is not on ground.
bool IsSprinting(void)
Check if the current player is actively sprinting.
vector GetCameraPosition(void)
Get the current 3D viewport's camera position.
Spectating library.
Definition: api_func.h:524
string Name(void)
int Team(void)
ncSpectatorMode_t Mode(void)
string LocalizedMode(void)
Surface library.
Definition: api_func.h:193
vector HUDSize(void)
Returns the size of the HUD.
float Height(void)
The height of the surface or display.
float Width(void)
The width of the surface or display.
vector HUDMins(void)
Returns the top-left starting position of the HUD on the surface.
vector Size(void)
The size of the surface or display.
vector Mins(void)
Returns the top-left starting position of the surface.
Weapon library.
Definition: api_func.h:425
bool UsesSecondaryAmmo(entity weaponRef=__NULL__)
Returns if the specified weapon item in the player's inventory makes use of a secondary ammo type.
entity GetNextWeaponRelativeTo(entity)
Returns the weapon that comes after (in the player's inventory) the input weapon.
string GetTitle(entity weaponRef=__NULL__)
Returns the title of the weapon specified.
entity GetActiveWeapon(void)
Returns the current/active weapon item in the player's inventory.
entity GetLastWeaponInInventory(void)
Returns the last weapon item in the player's inventory.
int GetSlotPos(entity weaponRef=__NULL__)
Returns if the slot position of the weapon specified.
int GetAmmo1(entity weaponRef=__NULL__)
Returns if the current/active weapons present reserve ammo.
bool IsEmpty(entity weaponRef=__NULL__)
Returns if the specified weapon item in the player's inventory is empty.
string GetIcon(entity weaponRef=__NULL__)
Returns the inventory icons of the weapon specified.
bool AmmoRequired(entity weaponRef=__NULL__)
Returns if the specified weapon item in the player's inventory requires ammo.
entity GetPreviousWeaponRelativeTo(entity playerWeapon)
Returns the weapon that comes before (in the player's inventory) the input weapon.
int GetClipSize(entity weaponRef=__NULL__)
Returns if the current/active weapons maximum clip/magazine size.
int MaxAmmo(entity weaponRef=__NULL__)
Returns if the maximum reserve ammo.
entity GetFirstWeaponInInventory(void)
Returns the first weapon item in the player's inventory.
int GetClip(entity weaponRef=__NULL__)
Returns if the current/active weapons present clip/magazine size.
string GetSelectedIcon(entity weaponRef=__NULL__)
Returns the selected variant inventory icons of the weapon specified.
bool IsValid(entity weaponRef=__NULL__)
Returns whether this entity reference to a weapon is still valid.
int GetAmmo2(entity weaponRef=__NULL__)
Returns if the current/active weapons present reserve ammo, but for the second ammo type.
void SelectWeapon(entity)
Attempts to make the player switch to the specified weapon reference.
int GetSlot(entity weaponRef=__NULL__)
Returns the slot number of the weapon specified.