Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
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{
20 DRAWFLAG_NORMAL = 0,
21 DRAWFLAG_ADDITIVE,
22 DRAWFLAG_MODULATE,
23 DRAWFLAG_2XMODULATE
24} drawflag_t;
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
139
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;
189
190
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);
202
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;
326
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);
422
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 UsesSecondaryAmmo(entity weaponRef = __NULL__);
483 bool AmmoRequired(entity weaponRef = __NULL__);
484
488 entity GetActiveWeapon(void);
497
503
508 entity GetPreviousWeaponRelativeTo(entity playerWeapon);
509
513 void SelectWeapon(entity);
516
517
519typedef struct
520{
521 ncSpectatorMode_t Mode(void);
522 string LocalizedMode(void);
523 string Name(void);
524 int Team(void);
527
529typedef struct
530{
531 int Load(string atlasPicName); /* loads a permanent handle for the named atlas pic */
532 void Draw(int atlasPic, vector drawAtPos, bool forceAdditive);
533 void Draw_A(int atlasPic, vector drawAtPos, float picAlpha, bool forceAdditive);
534 void Draw_RGBA(int atlasPic, vector drawAtPos, vector picColor, float picAlpha, bool forceAdditive);
535 void DrawTop_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
536 void DrawBottom_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
537 void DrawLeft_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
538 void DrawRight_RGBA(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, float picAlpha, bool forceAdditive);
539
540
541 void DrawTop_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
542 void DrawBottom_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
543 void DrawLeft_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
544 void DrawRight_RGB(int atlasPic, vector drawAtPos, float percentageDrawn, vector picColor, bool forceAdditive);
545
546 void Draw_RGB(int atlasPic, vector drawAtPos, vector picColor, bool forceAdditive);
548 float GetWidth(int atlasPic);
549 float GetHeight(int atlasPic);
550 vector GetSize(int atlasPic);
553
555typedef struct
556{
557 bool Cached(void);
558 float GetWidth(string materialName);
559 float GetHeight(string materialName);
560 vector GetSize(string materialName);
563 // end of hudC
565
566/* To be implemented by HUD */
567void HUD_Init(void);
568
569__variant
570linkToClientProgs(string funcName)
571{
572 static void empty(void)
573 {
574 print("Called unimplemented client-side API call.\n");
575 breakpoint();
576 }
577
578 void *func = externvalue(0, funcName);
579
580 if (func) {
581 return ((__variant)func);
582 } else {
583 return (empty);
584 }
585}
586
587void
588_client_main(void)
589{
590 font.GetHeight = linkToClientProgs("Font_GetHeight");
591 font.GetID = linkToClientProgs("Font_GetID");
592 font.Load = linkToClientProgs("Font_Load");
593 font.RGBtoHex = linkToClientProgs("Font_RGBtoHex");
594 font.StringWidth = linkToClientProgs("Font_StringWidth");
595
596 screen.Width = linkToClientProgs("CLPF_surface_ScreenWidth");
597 screen.Height = linkToClientProgs("CLPF_surface_ScreenHeight");
598 screen.Size = linkToClientProgs("CLPF_surface_ScreenSize");
599 screen.Mins = linkToClientProgs("CLPF_surface_ScreenMins");
600 screen.HUDMins = linkToClientProgs("CLPF_surface_HUDMins");
601 screen.HUDSize = linkToClientProgs("CLPF_surface_HUDSize");
602
603 material.GetSize = linkToClientProgs("CLPF_material_GetSize");
604 material.GetWidth = linkToClientProgs("CLPF_material_GetWidth");
605 material.GetHeight = linkToClientProgs("CLPF_material_GetHeight");
606 material.Cached = linkToClientProgs("CLPF_material_Cached");
607
608 player.GetCameraPosition = linkToClientProgs("CLPF_player_GetCameraPosition");
609 player.GetCameraAngles = linkToClientProgs("CLPF_player_GetCameraAngles");
610 player.GetHealth = linkToClientProgs("CLPF_player_GetHealth");
611 player.GetArmor = linkToClientProgs("CLPF_player_GetArmor");
612 player.GetStamina = linkToClientProgs("CLPF_player_GetStamina");
613 player.GetTeam = linkToClientProgs("CLPF_player_GetTeam");
614 player.HasItem = linkToClientProgs("CLPF_player_HasItem");
615 player.IsStanding = linkToClientProgs("CLPF_player_IsStanding");
616 player.IsLeaning = linkToClientProgs("CLPF_player_IsLeaning");
617 player.IsSprinting = linkToClientProgs("CLPF_player_IsSprinting");
618 player.IsCrouched = linkToClientProgs("CLPF_player_IsCrouching");
619 player.IsProne = linkToClientProgs("CLPF_player_IsProne");
620 player.IsMoving = linkToClientProgs("CLPF_player_IsMoving");
621 player.IsFalling = linkToClientProgs("CLPF_player_IsFalling");
622 player.GetGameFlags = linkToClientProgs("CLPF_player_GetGameFlags");
623
624 player.GetString = linkToClientProgs("CLPF_player_GetString");
625 player.GetInteger = linkToClientProgs("CLPF_player_GetInteger");
626 player.GetBool = linkToClientProgs("CLPF_player_GetBool");
627 player.GetFloat = linkToClientProgs("CLPF_player_GetFloat");
628 player.GetVector = linkToClientProgs("CLPF_player_GetVector");
629
630 weapon.IsValid = linkToClientProgs("CLPF_weapon_IsValid");
631 weapon.GetTitle = linkToClientProgs("CLPF_weapon_GetTitle");
632 weapon.GetIcon = linkToClientProgs("CLPF_weapon_GetIcon");
633 weapon.GetSelectedIcon = linkToClientProgs("CLPF_weapon_GetSelectedIcon");
634 weapon.GetSlot = linkToClientProgs("CLPF_weapon_GetSlot");
635 weapon.GetSlotPos = linkToClientProgs("CLPF_CLPF_weapon_GetSlotPos");
636 weapon.GetAmmo1 = linkToClientProgs("CLPF_weapon_GetAmmo1");
637 weapon.GetAmmo2 = linkToClientProgs("CLPF_weapon_GetAmmo2");
638 weapon.GetClip = linkToClientProgs("CLPF_weapon_GetClip");
639 weapon.GetClipSize = linkToClientProgs("CLPF_CLPF_weapon_GetClipSize");
640 weapon.MaxAmmo = linkToClientProgs("CLPF_weapon_MaxAmmo");
641 weapon.UsesSecondaryAmmo = linkToClientProgs("CLPF_weapon_UsesSecondaryAmmo");
642 weapon.AmmoRequired = linkToClientProgs("CLPF_weapon_AmmoRequired");
643 weapon.GetActiveWeapon = linkToClientProgs("CLPF_weapon_GetActiveWeapon");
644 weapon.GetFirstWeaponInInventory = linkToClientProgs("CLPF_weapon_GetFirstWeaponInInventory");
645 weapon.GetLastWeaponInInventory = linkToClientProgs("CLPF_weapon_GetLastWeaponInInventory");
646 weapon.GetNextWeaponRelativeTo = linkToClientProgs("CLPF_weapon_GetNextWeaponRelativeTo");
647 weapon.GetPreviousWeaponRelativeTo = linkToClientProgs("CLPF_weapon_GetPreviousWeaponRelativeTo");
648 weapon.SelectWeapon = linkToClientProgs("CLPF_weapon_SelectWeapon");
649
650 draw.Rect = linkToClientProgs("CLPF_draw_Rect");
651 draw.RectOutline = linkToClientProgs("CLPF_draw_RectOutline");
652 draw.RoundedRectOutline = linkToClientProgs("CLPF_draw_RoundedRectOutline");
653 draw.RoundedBox = linkToClientProgs("CLPF_draw_RoundedBox");
654 draw.Line = linkToClientProgs("CLPF_draw_Line");
655 draw.Pic = linkToClientProgs("CLPF_draw_Pic");
656 draw.SubPic = linkToClientProgs("CLPF_draw_SubPic");
657
658 draw.TextField = linkToClientProgs("Font_DrawField");
659 draw.TextFieldAtHeight = linkToClientProgs("Font_DrawFieldAtHeight");
660 draw.RText = linkToClientProgs("Font_DrawRText");
661 draw.RText_A = linkToClientProgs("Font_DrawRText_A");
662 draw.RText_RGB = linkToClientProgs("Font_DrawRText_RGB");
663 draw.RText_RGBA = linkToClientProgs("Font_DrawRText_RGBA");
664 draw.Text = linkToClientProgs("Font_DrawText");
665 draw.Text_A= linkToClientProgs("Font_DrawText_A");
666 draw.Text_RGB= linkToClientProgs("Font_DrawText_RGB");
667 draw.Text_RGBA = linkToClientProgs("Font_DrawText_RGBA");
668 draw.RadarRect = linkToClientProgs("CLPF_draw_RadarRect");
669
670 spectating.Mode = linkToClientProgs("CLPF_spectating_Mode");
671 spectating.LocalizedMode = linkToClientProgs("CLPF_spectating_LocalizedMode");
672 spectating.Name = linkToClientProgs("CLPF_spectating_Name");
673 spectating.Team = linkToClientProgs("CLPF_spectating_Team");
674
675 atlasPic.Load = linkToClientProgs("CLPF_atlasPic_Load");
676 atlasPic.Draw = linkToClientProgs("CLPF_atlasPic_Draw");
677 atlasPic.Draw_A = linkToClientProgs("CLPF_atlasPic_Draw_A");
678 atlasPic.Draw_RGB = linkToClientProgs("CLPF_atlasPic_Draw_RGB");
679 atlasPic.Draw_RGBA = linkToClientProgs("CLPF_atlasPic_Draw_RGBA");
680 atlasPic.DrawTop_RGBA = linkToClientProgs("CLPF_atlasPic_DrawTop_RGBA");
681 atlasPic.DrawBottom_RGBA = linkToClientProgs("CLPF_atlasPic_DrawBottom_RGBA");
682 atlasPic.DrawLeft_RGBA = linkToClientProgs("CLPF_atlasPic_DrawLeft_RGBA");
683 atlasPic.DrawRight_RGBA = linkToClientProgs("CLPF_atlasPic_DrawRight_RGBA");
684
685 atlasPic.DrawTop_RGB = linkToClientProgs("CLPF_atlasPic_DrawTop_RGB");
686 atlasPic.DrawBottom_RGB = linkToClientProgs("CLPF_atlasPic_DrawBottom_RGB");
687 atlasPic.DrawLeft_RGB = linkToClientProgs("CLPF_atlasPic_DrawLeft_RGB");
688 atlasPic.DrawRight_RGB = linkToClientProgs("CLPF_atlasPic_DrawRight_RGB");
689
690 atlasPic.DrawCrosshair = linkToClientProgs("CLPF_atlasPic_DrawCrosshair");
691 atlasPic.GetWidth = linkToClientProgs("CLPF_atlasPic_GetWidth");
692 atlasPic.GetHeight = linkToClientProgs("CLPF_atlasPic_GetHeight");
693 atlasPic.GetSize = linkToClientProgs("CLPF_atlasPic_GetSize");
694}
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:526
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:562
var weaponAPI_t weapon
Access weaponAPI_t functions using this variable.
Definition api_func.h:515
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:552
var playerAPI_t player
Access playerAPI_t functions using this variable.
Definition api_func.h:421
atlasPic library
Definition api_func.h:530
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:556
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:520
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 current/active weapon item in the player's inventory makes use of a secondary ammo typ...
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.
string GetIcon(entity weaponRef=__NULL__)
Returns the inventory icons of the weapon specified.
bool AmmoRequired(entity weaponRef=__NULL__)
Returns if the current/active 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.