From 7e873b2449520d8c2b938328b41cd04afaa536b8 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Thu, 27 Aug 2026 23:01:19 +0300 Subject: [PATCH 1/8] docs: overhaul include documentation across engine/cssdk/gamedll/reunion layers Full read-only audit of include doc-comments against ReHLDS/ReGameDLL sources, followed by approved fixes. reapi_engine.inc / reapi_engine_const.inc (engine layer, 235 checks): - add missing Return type for RH_GetEntityInit / RH_SV_CheckUserInfo - fix factual errors: get_ucmd (usercmd handle, not entity), get_key_value_buffer (returns cell count), rh_get_client_connect_time (@error instead of soft 0), Is/ResetModifiedMessageData (MsgIndex -> MsgMsgId, "-1" argument rules), net_remote_address setter marked as not implemented (mutate the address via set_netadr) - new SND_EMIT2_USE_ORIGIN define; ~20 typo/copy-paste doc fixes (lenght, metchan, mvar params, message_const.inc reference, etc.) cssdk_const.inc (constant parity vs vendored cssdk + ReGameDLL/ReHLDS, 983 checks): - renames: ITDB_* -> ITBD_*, SHIELDREN_* -> SHIELDGREN_* (match C++) - DMG_EXPLOSION alias next to DMG_GRENADE (ReGameDLL name of the bit) - new constants: BLOOD_COLOR_DARKRED, ITEM_FLAG_EXHAUST_SECONDARYAMMO/ ITEM_FLAG_CUSTOM, PLAYER_PREVENT_DDUCK, DHF_*/DHM_* hint flags, ThrowDirection, sbar_data, PlayerIdShowHealth/PlayerIdField, WeaponInfiniteAmmoMode, AmmoType, RewardAccount, PaybackForBadThing (all verified against ReGameDLL) - comment fixes: PFLAG_DUCKING, DEAD_RESPAWNABLE, WeaponState weapon list, FEV_RELIABLE tail, "light" section header reapi_gamedll_const.inc: add missing Return type lines (RG_RoundEnd, RG_HandleMenu_ChooseTeam, RG_CBasePlayer_TakeHealth, RG_CBasePlayer_SetClientUserInfoName, RG_CBasePlayer_Observer_IsValidTarget with ATYPE_CLASSPTR note, RG_CBasePlayer_HasRestrictItem), KickBack full weapon list and up_max param name, m_pVIP/m_pVIPQueue relabeled to class CBasePlayer *, m_iIgnoreGlobalChat typed IgnoreChatMsg. reapi_reunion.inc: split constants into new reapi_reunion_const.inc (client_auth_type, reu_authkey_kind, AuthIdType) and document new natives (REU_GetAuthKeyKind, REU_SetConnectTime, REU_GetSerializedId). natives_common.cpp: sync get_key_value_buffer docs with .inc, swap mixed-up amx_Get/amx_SetBodygroup doc blocks natives_misc.cpp: fix "independant ... with via" typo --- .../amxmodx/scripting/include/cssdk_const.inc | 207 ++++++++++++++++-- .../scripting/include/reapi_engine.inc | 43 ++-- .../scripting/include/reapi_engine_const.inc | 56 +++-- .../scripting/include/reapi_gamedll_const.inc | 85 ++++--- .../scripting/include/reapi_reunion.inc | 67 ++++-- .../scripting/include/reapi_reunion_const.inc | 62 ++++++ reapi/src/natives/natives_common.cpp | 16 +- reapi/src/natives/natives_misc.cpp | 2 +- 8 files changed, 423 insertions(+), 115 deletions(-) create mode 100644 reapi/extra/amxmodx/scripting/include/reapi_reunion_const.inc diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index 31a73e0f..0229b8a8 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -114,7 +114,7 @@ #define DEAD_NO 0 // Alive #define DEAD_DYING 1 // Playing death animation or still falling off of a ledge waiting to hit ground #define DEAD_DEAD 2 // Dead, lying still -#define DEAD_RESPAWNABLE 3 +#define DEAD_RESPAWNABLE 3 // do respawn the entity #define DEAD_DISCARDBODY 4 /** @@ -204,6 +204,54 @@ #define PLAYER_PREVENT_DUCK (1<<4) #define PLAYER_PREVENT_CLIMB (1<<5) // The player can't climb ladder #define PLAYER_PREVENT_JUMP (1<<6) +#define PLAYER_PREVENT_DDUCK (1<<7) // ReGameDLL: player data iuser3 (unduck logic) + +/** +* Player's throw direction on killed for use with m_iThrowDirection +*/ +enum ThrowDirection +{ + THROW_NONE, + THROW_FORWARD, + THROW_BACKWARD, + THROW_HITVEL, + THROW_BOMB, + THROW_GRENADE, + THROW_HITVEL_MINUS_AIRVEL +}; + +/** +* Player's status bar constants +*/ +#define SBAR_TARGETTYPE_TEAMMATE 1 +#define SBAR_TARGETTYPE_ENEMY 2 +#define SBAR_TARGETTYPE_HOSTAGE 3 + +enum sbar_data +{ + SBAR_ID_TARGETTYPE = 1, + SBAR_ID_TARGETNAME, + SBAR_ID_TARGETHEALTH, + SBAR_END +}; + +/** +* Player id cvar extensions (ReGameDLL, #ifdef REGAMEDLL_ADD) +*/ +enum PlayerIdShowHealth +{ + PLAYERID_HIDE = 0, // Don't show health + PLAYERID_TEAMMATES = 1, // Show health for teammates only (default CS) + PLAYERID_ALL = 2 // Show health for all players +}; + +enum PlayerIdField +{ + PLAYERID_FIELD_NONE = 0, // No extra info + PLAYERID_FIELD_TEAM = 1, // Show team name + PLAYERID_FIELD_HEALTH = 2, // Show health percentage + PLAYERID_FIELD_BOTH = 3 // Show both team name and health +}; /** * Instant damage values for use with the 3rd parameter of the "Damage" client @@ -234,6 +282,7 @@ #define DMG_SLOWFREEZE (1<<22) // In a subzero freezer #define DMG_MORTAR (1<<23) // Hit by air raid (done to distinguish grenade from mortar) #define DMG_GRENADE (1<<24) // Counter-Strike only - Hit by HE grenade +#define DMG_EXPLOSION (1<<24) // ReGameDLL name of the same bit as DMG_GRENADE (kept as alias) #define DMG_TIMEBASED (~(0x3fff)) // Mask for time-based damage // These are the damage types that are allowed to gib corpses @@ -258,7 +307,7 @@ #define PFLAG_ONSWING (1<<0) #define PFLAG_ONTRAIN (1<<1) #define PFLAG_ONBARNACLE (1<<2) -#define PFLAG_DUCKING (1<<3) // In the process of ducking, but totally squatted yet +#define PFLAG_DUCKING (1<<3) // In the process of ducking, but not totally squatted yet #define PFLAG_USING (1<<4) // Using a continuous entity #define PFLAG_OBSERVER (1<<5) // Player is locked in stationary cam mode. Spectators can move, observers can't. @@ -284,6 +333,8 @@ #define ITEM_FLAG_LIMITINWORLD (1<<3) #define ITEM_FLAG_EXHAUSTIBLE (1<<4) #define ITEM_FLAG_NOFIREUNDERWATER (1<<5) +#define ITEM_FLAG_EXHAUST_SECONDARYAMMO (1<<6) +#define ITEM_FLAG_CUSTOM (ITEM_FLAG_NOFIREUNDERWATER|ITEM_FLAG_EXHAUST_SECONDARYAMMO) /** * @section get_entvar(entity, var_spawnflags) values @@ -640,7 +691,7 @@ #define SF_PUSH_BREAKABLE 128 /** -* light_spawn +* light */ #define SF_LIGHT_START_OFF 1 @@ -682,8 +733,8 @@ * PlaybackEvent flags */ #define FEV_NOTHOST (1<<0) // Skip local host for event send. -#define FEV_RELIABLE (1<<1) // Send the event reliably. You must specify the origin and angles - // for this to work correctly on the server for anything +#define FEV_RELIABLE (1<<1) // Send the event reliably. You must specify the origin and angles and use + // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything // that depends on the event origin/angles. I.e., the origin/angles are not // taken from the invoking edict for reliable events. @@ -714,10 +765,38 @@ // UNDONE: This will ignore transition volumes (trigger_transition), but not the PVS!!! #define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions +/** +* CBasePlayer::m_flDisplayHistory hint flags (ReGameDLL hintmessage.h) +*/ +#define DHF_ROUND_STARTED BIT(1) +#define DHF_HOSTAGE_SEEN_FAR BIT(2) +#define DHF_HOSTAGE_SEEN_NEAR BIT(3) +#define DHF_HOSTAGE_USED BIT(4) +#define DHF_HOSTAGE_INJURED BIT(5) +#define DHF_HOSTAGE_KILLED BIT(6) +#define DHF_FRIEND_SEEN BIT(7) +#define DHF_ENEMY_SEEN BIT(8) +#define DHF_FRIEND_INJURED BIT(9) +#define DHF_FRIEND_KILLED BIT(10) +#define DHF_ENEMY_KILLED BIT(11) +#define DHF_BOMB_RETRIEVED BIT(12) +#define DHF_AMMO_EXHAUSTED BIT(15) +#define DHF_IN_TARGET_ZONE BIT(16) +#define DHF_IN_RESCUE_ZONE BIT(17) +#define DHF_IN_ESCAPE_ZONE BIT(18) +#define DHF_IN_VIPSAFETY_ZONE BIT(19) +#define DHF_NIGHTVISION BIT(20) +#define DHF_HOSTAGE_CTMOVE BIT(21) +#define DHF_SPEC_DUCK BIT(22) + +#define DHM_ROUND_CLEAR (DHF_ROUND_STARTED|DHF_HOSTAGE_KILLED|DHF_FRIEND_KILLED|DHF_BOMB_RETRIEVED) +#define DHM_CONNECT_CLEAR (DHF_HOSTAGE_SEEN_FAR|DHF_HOSTAGE_SEEN_NEAR|DHF_HOSTAGE_USED|DHF_HOSTAGE_INJURED|DHF_FRIEND_SEEN|DHF_ENEMY_SEEN|DHF_FRIEND_INJURED|DHF_ENEMY_KILLED|DHF_AMMO_EXHAUSTED|DHF_IN_TARGET_ZONE|DHF_IN_RESCUE_ZONE|DHF_IN_ESCAPE_ZONE|DHF_IN_VIPSAFETY_ZONE|DHF_HOSTAGE_CTMOVE|DHF_SPEC_DUCK) + /** * All monsters need this data */ #define DONT_BLEED -1 +#define BLOOD_COLOR_DARKRED 223 #define BLOOD_COLOR_RED 247 #define BLOOD_COLOR_YELLOW 195 #define BLOOD_COLOR_GREEN BLOOD_COLOR_YELLOW @@ -725,13 +804,24 @@ /** * CBasePlayer::m_iIgnoreGlobalChat */ -enum +enum IgnoreChatMsg { IGNOREMSG_NONE, // Nothing to do IGNOREMSG_ENEMY, // To ignore any chat messages from the enemy IGNOREMSG_TEAM // Same as IGNOREMSG_ENEMY but ignore teammates } +/** +* CBasePlayer::m_musicState +* @see regamedll/dlls/player.h (enum MusicState { SILENT, CALM, INTENSE }) +*/ +enum MusicState +{ + MUSIC_SILENT = 0, + MUSIC_CALM, + MUSIC_INTENSE +} + /** * Hitgroups */ @@ -817,6 +907,53 @@ enum RewardType RT_VIP_RESCUED_MYSELF }; +/** +* Reward account amounts for RG_CBasePlayer_AddAccount / rg_add_account (ReGameDLL) +*/ +enum RewardAccount +{ + REWARD_TARGET_BOMB = 3500, + REWARD_VIP_ESCAPED = 3500, + REWARD_VIP_ASSASSINATED = 3250, + REWARD_TERRORISTS_ESCAPED = 3150, + REWARD_CTS_PREVENT_ESCAPE = 3500, + REWARD_ESCAPING_TERRORISTS_NEUTRALIZED = 3250, + REWARD_BOMB_DEFUSED = 3250, + REWARD_BOMB_PLANTED = 800, + REWARD_BOMB_EXPLODED = 3250, + REWARD_CTS_WIN = 3000, + REWARD_TERRORISTS_WIN = 3000, + REWARD_ALL_HOSTAGES_RESCUED = 2500, + + // the end round was by the expiration time + REWARD_TARGET_BOMB_SAVED = 3250, + REWARD_HOSTAGE_NOT_RESCUED = 3250, + REWARD_VIP_NOT_ESCAPED = 3250, + + // loser bonus + REWARD_LOSER_BONUS_DEFAULT = 1400, + REWARD_LOSER_BONUS_MIN = 1500, + REWARD_LOSER_BONUS_MAX = 3000, + REWARD_LOSER_BONUS_ADD = 500, + + REWARD_RESCUED_HOSTAGE = 750, + REWARD_KILLED_ENEMY = 300, + REWARD_KILLED_VIP = 2500, + REWARD_VIP_HAVE_SELF_RESCUED = 2500, + + REWARD_TAKEN_HOSTAGE = 1000, + REWARD_TOOK_HOSTAGE_ACC = 100, + REWARD_TOOK_HOSTAGE = 150 +}; + +/** +* Penalty for team killing (ReGameDLL) +*/ +enum PaybackForBadThing +{ + PAYBACK_FOR_KILLED_TEAMMATES = -3300 +}; + /** * Team IDs for m_iTeam */ @@ -909,20 +1046,52 @@ enum WeaponIdType WEAPON_SHIELDGUN = 99 }; +/** +* Weapon infinite ammo modes for m_iWeaponInfiniteAmmo (ReGameDLL, #ifdef REGAMEDLL_ADD) +*/ +enum WeaponInfiniteAmmoMode +{ + WPNMODE_INFINITE_CLIP = 1, + WPNMODE_INFINITE_BPAMMO +}; + +/** +* Ammo types (ReGameDLL weapontype.h; note: numbering differs from AMXX CsAmmoType) +*/ +enum AmmoType +{ + AMMO_NONE, + AMMO_338MAGNUM, + AMMO_762NATO, + AMMO_556NATOBOX, + AMMO_556NATO, + AMMO_BUCKSHOT, + AMMO_45ACP, + AMMO_57MM, + AMMO_50AE, + AMMO_357SIG, + AMMO_9MM, + AMMO_FLASHBANG, + AMMO_HEGRENADE, + AMMO_SMOKEGRENADE, + AMMO_C4, + + AMMO_MAX_TYPES +}; + /** * For CBaseMonster::m_rgbTimeBasedDamage -* prefix should be ITBD_ */ enum TimeBasedDamage { - ITDB_PARALYZE, - ITDB_NERVEGAS, - ITDB_POISON, - ITDB_RADIATION, - ITDB_DROWNRECOVER, - ITDB_ACID, - ITDB_SLOWBURN, - ITDB_SLOWFREEZE + ITBD_PARALYZE, + ITBD_NERVE_GAS, + ITBD_POISON, + ITBD_RADIATION, + ITBD_DROWN_RECOVER, + ITBD_ACID, + ITBD_SLOW_BURN, + ITBD_SLOW_FREEZE }; /** @@ -1164,9 +1333,9 @@ enum InventorySlotType */ enum shieldgren_e { - SHIELDREN_IDLE = 4, - SHIELDREN_UP, - SHIELDREN_DOWN + SHIELDGREN_IDLE = 4, + SHIELDGREN_UP, + SHIELDGREN_DOWN }; enum shieldgun_e @@ -1195,7 +1364,7 @@ enum SignalState }; /** -* Weapon states of the following weapons: usp, elite, glock18, famas and m4a1. +* Weapon states of the following weapons: usp, elite, glock18, famas, m4a1 and shield. */ enum WeaponState { diff --git a/reapi/extra/amxmodx/scripting/include/reapi_engine.inc b/reapi/extra/amxmodx/scripting/include/reapi_engine.inc index 62f752bd..4f6f603f 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_engine.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_engine.inc @@ -25,7 +25,7 @@ native any:get_entvar(const index, const EntVars:var, any:...); native set_ucmd(const ucmd, const UCmd:var, any:...); /* -* Returns usercmd data from an entity. +* Returns usercmd data from a usercmd structure handle (see get_pmove(pm_cmd)). * Use the ucmd_* UCmd enum */ native any:get_ucmd(const ucmd, const UCmd:var, any:...); @@ -33,19 +33,24 @@ native any:get_ucmd(const ucmd, const UCmd:var, any:...); /* * Sets netchan data. * Use the net_* NetChan enum +* +* @note index must be a connected client */ native set_netchan(const index, const NetChan:var, any:...); /* -* Returns metchan data from an client. +* Returns netchan data from a client. * Use the net_* NetChan enum +* +* @note index must be a connected client */ native any:get_netchan(const index, const NetChan:var, any:...); /* * Sets a NetAdr var. * -* @param var The specified mvar, look at the enum NetAdrVars +* @param adr Pointer/handle to a netadr structure (e.g. obtained via get_netchan(index, net_remote_address)) +* @param var NetAdrVars member to set, look at the enum NetAdrVars * * @return 1 on success. */ @@ -54,9 +59,10 @@ native set_netadr(const adr, const NetAdrVars:var, any:...); /* * Returns a NetAdr var * -* @param var The specified mvar, look at the enum NetAdrVars +* @param adr Pointer/handle to a netadr structure (e.g. obtained via get_netchan(index, net_remote_address)) +* @param var NetAdrVars member to get, look at the enum NetAdrVars * -* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar +* @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member */ native any:get_netadr(const adr, const NetAdrVars:var, any:...); @@ -88,11 +94,11 @@ native set_key_value(const pbuffer, const key[], const value[]); /* * Gets an AMXX string buffer from a infobuffer pointer * -* @param buffer Info string pointer -* @param value String to copy value to +* @param pbuffer Info string pointer +* @param output String to copy value to * @param maxlen Maximum size of the output buffer * -* @return Returns a string buffer on infobuffer pointer +* @return Number of cells written to the output buffer */ native get_key_value_buffer(const pbuffer, const output[], const maxlen); @@ -208,7 +214,7 @@ native rh_set_mapname(const mapname[]); * @param output Buffer to copy map name to * @param len Maximum buffer size * @param type MNT_SET will return the name of the current map -* MNT_TRUE will return the original map name independant of the name set with via rh_set_mapname +* MNT_TRUE will return the original map name independent of the name set via rh_set_mapname * * @noreturn */ @@ -260,7 +266,7 @@ native rh_update_user_info(const index); native rh_drop_client(const index, const message[] = ""); /* -* - +* Returns the address string the most recent connection request came from (net_from). * * @param output Buffer to copy the ip address * @param len Maximum buffer size @@ -275,7 +281,9 @@ native rh_get_net_from(output[], len); * * @param index Client index * -* @return Netchan connection time in seconds or 0 if client index is invalid or client is not connected +* @return Netchan connection time in seconds +* +* @error Invalid client index or client is not connected */ native rh_get_client_connect_time(const index); @@ -332,7 +340,7 @@ enum MessageHook * * @note The callback arguments have: * msg_id - Message id -* msg_dest - Destination type (see MSG_* constants in messages_const.inc) +* msg_dest - Destination type (see MSG_* constants in message_const.inc) * msg_entity - Entity receiving the message * * @note You can modify the message content using SetMessageData native before the original function is invoked. @@ -376,7 +384,7 @@ native bool:DisableHookMessage(const MessageHook:handle); * Sets the message data in the current game message. * * @param type The type of the message data that can be changed -* @param ... Additional args depending on the type of the message argument being retrieved (For more details, look at the enum MsgArgType) +* @param ... Additional args depending on the type of the message argument being set (For more details, look at the enum MsgArgType) * * @return Returns true if the message data is successfully set, otherwise false. */ @@ -447,13 +455,14 @@ native MsgBlockType:GetMessageBlock(const msgid); * This can be one of the following: * - MsgAny: Check if any part of the message has been modified * - MsgDest: Check if the destination has been modified -* - MsgIndex: Check if the message ID has been modified +* - MsgMsgId: Check if the message ID has been modified * - MsgOrigin: Check if the origin has been modified * - MsgTargetId: Check if the index of the recipient client has been modified * - MsgArg: Check if a specific argument of the message has been modified * * @param number The number of the argument to check for modification (used only when type is MsgDataType:MsgArg) -* Default value is -1, which means the argument number is not applicable +* Default value is -1; allowed only when type is not MsgArg +* (for MsgArg the argument number is required) * * @return Returns true if the specified data type has been modified, false otherwise */ @@ -462,11 +471,11 @@ native bool:IsMessageDataModified(MsgDataType:type = MsgAny, const number = -1); /** * Resets a specific type of message data to its original value * -* @param type The type of the data to check for modification +* @param type The type of the data to reset * This can be one of the following: * - MsgAny: Reset all modified message data to its original values * - MsgDest: Reset the destination to its original value -* - MsgIndex: Reset the message ID to its original value +* - MsgMsgId: Reset the message ID to its original value * - MsgOrigin: Reset the origin to its original value * - MsgTargetId: Reset the index of the recipient client to its original value * - MsgArg: Reset a specific argument of the message to its original value diff --git a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc index eee1f366..9e19802c 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc @@ -9,7 +9,7 @@ */ enum MapNameType { - MNT_TRUE, // return the original map name independant of the name set with via rh_set_mapname + MNT_TRUE, // return the original map name independent of the name set via rh_set_mapname MNT_SET // return the name of the current map }; @@ -44,6 +44,7 @@ enum ResourceType_t */ #define SND_EMIT2_NOPAS BIT(0) // Never to check PAS #define SND_EMIT2_INVOKER BIT(1) // Do not send to the client invoker +#define SND_EMIT2_USE_ORIGIN BIT(2) // use given origin instead of entity origin /** * enum EngineFunc @@ -75,14 +76,17 @@ enum EngineFunc RH_Cvar_DirectSet, /* - * Description: Receiver is player index or 0 when update will be sended to all. + * Description: Receiver is player index or 0 when update will be sent to all. * Params: (const client, buffer, const receiver) */ RH_SV_WriteFullClientUpdate, /* * Description: - + * Return type: int * Params: (const classname[]) + * + * @note Returns the address of the entity class constructor function (advanced use only). */ RH_GetEntityInit, @@ -99,7 +103,7 @@ enum EngineFunc RH_SV_ConnectClient, /* - * Description: Called when client it's in the scoreboard + * Description: Called when client is in the scoreboard * Params: (const client) */ RH_SV_EmitPings, @@ -125,10 +129,12 @@ enum EngineFunc /* * Description: Called when a player's userinfo is being checked. + * Return type: int * Params: (adr, buffer, bool:reconnect, reconnectSlot, name[]) * * @note Param adr is unused, guaranteed to return nothing also, don't send anything through it. * @note In order for param name work, hook needs to be registered as Post. + * @note Return 0 to reject the connection, 1 to continue. */ RH_SV_CheckUserInfo, @@ -155,7 +161,7 @@ enum EngineFunc /* * Description: Called when an event is being added to event precache list. - * Return type: int + * Return type: int (engine-side: unsigned short) * Params: (const string[]) */ RH_EV_Precache, @@ -182,6 +188,8 @@ enum EngineFunc /* * Description: Called when a command is being sent to server. * Params: (const cmd[], source, id) + * + * @note id is 0 unless source is a client */ RH_ExecuteServerStringCmd, @@ -201,7 +209,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_classname = BEGIN_MEMBER_REGION(entvars), @@ -209,7 +217,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_globalname, @@ -247,7 +255,7 @@ enum EntVars var_basevelocity, /* - * Description: Base velocity that was passed in to server physics so client can predict conveyors correctly. Server zeroes it, so we need to it store here, too. + * Description: Base velocity that was passed in to server physics so client can predict conveyors correctly. Server zeroes it, so we need to store it here, too. * Member type: class Vector * Get params: get_entvar(index, EntVars:var, Float:output[3]); * Set params: set_entvar(index, EntVars:var, Float:dest[3]); @@ -263,7 +271,7 @@ enum EntVars var_movedir, /* - * Description: Angles model. + * Description: Model angles. * Member type: class Vector * Get params: get_entvar(index, EntVars:var, Float:output[3]); * Set params: set_entvar(index, EntVars:var, Float:dest[3]); @@ -377,7 +385,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_model, @@ -385,7 +393,7 @@ enum EntVars /* * Description: Player's viewmodel. * Member type: string_t - * Get params: get_entvar(index, EntVars:var); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_viewmodel, @@ -393,7 +401,7 @@ enum EntVars /* * Description: The model that other players see. * Member type: string_t - * Get params: get_entvar(index, EntVars:var); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_weaponmodel, @@ -809,7 +817,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_target, @@ -817,7 +825,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_targetname, @@ -825,7 +833,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_netname, @@ -833,7 +841,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_message, @@ -873,7 +881,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_noise, @@ -881,7 +889,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_noise1, @@ -889,7 +897,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_noise2, @@ -897,7 +905,7 @@ enum EntVars /* * Description: - * Member type: string_t - * Get params: get_entvar(index, EntVars:var, dest[], const lenght); + * Get params: get_entvar(index, EntVars:var, dest[], const length); * Set params: set_entvar(index, EntVars:var, const source[]); */ var_noise3, @@ -1287,7 +1295,7 @@ enum UCmd enum NetAdrType { - NA_NULL = 0, + NA_NULL = 0, // "NA_UNUSED" in ReHLDS sources NA_LOOPBACK, NA_BROADCAST, NA_IP, @@ -1308,7 +1316,7 @@ enum NetAdrVars /* * Description: - * Member type: unsigned char [4] - * Get params: get_netadr(const NetAdr:adr, const NetAdrVars:var, dest[], const lenght); // Also returns a iplong value + * Get params: get_netadr(const NetAdr:adr, const NetAdrVars:var, dest[], const length); // dest receives dotted string "A.B.C.D" (no port); also returns an iplong value * Set params: set_netadr(const NetAdr:adr, const NetAdrVars:var, const iplong_value); // Only iplong can to set */ netadr_ip, @@ -1329,7 +1337,7 @@ enum NetSrc { NS_CLIENT, NS_SERVER, - NS_MULTICAST // xxxMO + NS_MULTICAST }; /** @@ -1339,7 +1347,7 @@ enum NetChan { /* * Description: NS_SERVER or NS_CLIENT, depending on channel - * Member type: int + * Member type: NetSrc * Get params: NetSrc:get_netchan(const index, NetChan:var); * Set params: set_netchan(const index, NetChan:var, NetSrc:value); */ @@ -1349,7 +1357,7 @@ enum NetChan * Description: Address this channel is talking to * Member type: NetAdr * Get params: NetAdr:get_netchan(const index, NetChan:var); - * Set params: set_netchan(const index, NetChan:var, NetAdr:value); + * Set params: set_netchan(const index, NetChan:var, NetAdr:value); // NOT IMPLEMENTED: the pointer cannot be set, mutate the address data via set_netadr() on the returned handle */ net_remote_address, diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 8cc322b4..5b229128 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -307,6 +307,7 @@ enum GamedllFunc /* * Description: - + * Return type: bool * Params: (WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay) */ RG_RoundEnd, @@ -331,6 +332,7 @@ enum GamedllFunc /* * Description: - + * Return type: BOOL * Params: (const index, const MenuChooseTeam:slot) */ RG_HandleMenu_ChooseTeam, @@ -607,6 +609,7 @@ enum GamedllFunc_CBasePlayer /* * Description: - + * Return type: BOOL * Params: (const this, Float:flHealth, bitsDamageType) */ RG_CBasePlayer_TakeHealth, @@ -712,12 +715,15 @@ enum GamedllFunc_CBasePlayer /* * Description: - + * Return type: bool * Params: (const this, infobuffer[], szNewName[]) */ RG_CBasePlayer_SetClientUserInfoName, /* * Description: - + * Return type: CBasePlayer * (Entity index of observer target) + * @note To override the return value use SetHookChainReturn(ATYPE_CLASSPTR, entityIndex) * Params: (const this, iPlayerIndex, bool:bSameTeam) */ RG_CBasePlayer_Observer_IsValidTarget, @@ -762,6 +768,7 @@ enum GamedllFunc_CBasePlayer /* * Description: - + * Return type: bool * Params: (const this, ItemID:item, ItemRestType:type) */ RG_CBasePlayer_HasRestrictItem, @@ -1002,9 +1009,11 @@ enum GamedllFunc_CBasePlayerWeapon /* * Description: Called whenever player fires a weapon and shakes player screen (punchangles altering) - * @note Weapons that use KickBack: AK47, AUG, FAMAS, GALIL, M249, M4A1, MAC10, MP5NAVY, P90, SG552, TMP, UMP45 + * @note Weapons that use KickBack: AK47, AUG, AWP, DEAGLE, ELITE, FAMAS, FIVESEVEN, + * G3SG1, GALIL, GLOCK18, M249, M3, MAC10, M4A1, MP5NAVY, P228, P90, SCOUT, + * SG550, SG552, TMP, UMP45, USP, XM1014 * Return type: void - * Params: (const this, Float:up_base, Float:lateral_base, Float:up_modifier, Float:lateral_modifier, Float:p_max, Float:lateral_max, direction_change) + * Params: (const this, Float:up_base, Float:lateral_base, Float:up_modifier, Float:lateral_modifier, Float:up_max, Float:lateral_max, direction_change) */ RG_CBasePlayerWeapon_KickBack, @@ -1831,17 +1840,17 @@ enum CSGameRules_Members /* * Description: - - * Member type: int + * Member type: class CBasePlayer * * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, value); // entity index of player */ m_pVIP, /* * Description: - - * Member type: int [5] + * Member type: class CBasePlayer * [5] * Get params: get_member_game(member, element); - * Set params: set_member_game(member, value, element); + * Set params: set_member_game(member, value, element); // entity index of player */ m_pVIPQueue, @@ -2641,9 +2650,9 @@ enum CBasePlayer_Members /* * Description: - - * Member type: int + * Member type: enum IgnoreChatMsg * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, value); // IGNOREMSG_* */ m_iIgnoreGlobalChat, @@ -3976,7 +3985,7 @@ enum RebuyStruct /* * Description: enum ArmorType - * Member type: int + * Member type: ArmorType * Get params: get_rebuy(RebuyHandle:handle, RebuyStruct:member); * Set params: set_rebuy(RebuyHandle:handle, RebuyStruct:member, value); */ @@ -4015,7 +4024,7 @@ enum PlayerMove /* * Description: - * Member type: float - * Get params: Float:get_pmove(const MoveVars:var); + * Get params: Float:get_pmove(member); * Set params: set_pmove(const MoveVars:var, Float:value); */ pm_time, @@ -4023,7 +4032,7 @@ enum PlayerMove /* * Description: - * Member type: float - * Get params: Float:get_pmove(const MoveVars:var); + * Get params: Float:get_pmove(member); * Set params: set_pmove(const MoveVars:var, Float:value); */ pm_frametime, @@ -4429,7 +4438,9 @@ enum PlayerMove pm_numphysent, /* - * Description: - + * Description: Pointer to the input command structure of the current player. + * @note Pass the result into get_ucmd()/set_ucmd() natives (reapi_engine.inc) + * to access the usercmd fields, e.g. ucmd_sidemove. * Member type: struct usercmd_s * * Get params: get_pmove(member); * Set params: set_pmove(const PlayerMove:var, value); @@ -5788,6 +5799,12 @@ enum CUMP45_Members */ enum CSG550_Members { + /* + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ m_SG550_iShell = BEGIN_MEMBER_REGION(sg550), /* @@ -5853,8 +5870,8 @@ enum CFamas_Members /* * Description: Basic damage that famas deals before any multiplier, such as hitgroup, armor, distance and bullet penetration in burst mode * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Famas_flBaseDamageBurst, }; @@ -5883,8 +5900,8 @@ enum CUSP_Members /* * Description: Basic damage that usp deals before any multiplier, such as hitgroup, armor, distance and bullet penetration in silence mdoe * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_USP_flBaseDamageSil, }; @@ -5998,6 +6015,12 @@ enum CM249_Members */ enum CM3_Members { + /* + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ m_M3_iShell = BEGIN_MEMBER_REGION(m3), /* @@ -6049,8 +6072,8 @@ enum CM4A1_Members /* * Description: Basic damage that m4a1 deals before any multiplier, such as hitgroup, armor, distance and bullet penetration in silence mdoe * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_M4A1_flBaseDamageSil, }; @@ -6213,48 +6236,48 @@ enum CKnife_Members /* * Description: Stab damage (default: 65.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flStabBaseDamage, /* * Description: Swing damage (default: 15.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flSwingBaseDamage, /* * Description: Fast Swing (first one) damage (default: 20.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flSwingBaseDamage_Fast, /* * Description: Stab distance (default: 32.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flStabDistance, /* - * Description: Swing distance (default: 64.0) + * Description: Swing distance (default: 48.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flSwingDistance, /* * Description: Back Stab damage multiplier (default: 3.0) * Member type: float - * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); */ m_Knife_flBackStabMultiplier, }; diff --git a/reapi/extra/amxmodx/scripting/include/reapi_reunion.inc b/reapi/extra/amxmodx/scripting/include/reapi_reunion.inc index 311f0c2c..fec73c4f 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_reunion.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_reunion.inc @@ -3,21 +3,7 @@ #endif #define _reapi_reunion_included -enum client_auth_type -{ - CA_TYPE_NONE = 0, - CA_TYPE_DPROTO, - CA_TYPE_STEAM, - CA_TYPE_STEAMEMU, - CA_TYPE_REVEMU, - CA_TYPE_OLDREVEMU, - CA_TYPE_HLTV, - CA_TYPE_SC2009, - CA_TYPE_AVSMP, - CA_TYPE_SXEI, - CA_TYPE_REVEMU2013, - CA_TYPE_SSE3, -}; +#include #define is_user_steam(%0) (REU_GetAuthtype(%0) == CA_TYPE_STEAM) @@ -51,6 +37,57 @@ native client_auth_type:REU_GetAuthtype(const index); */ native REU_GetAuthKey(const index, dest[], maxlen); +/* +* Gets client authkey kind. +* +* @param index Client index +* +* @return Authkey kind, see enum reu_authkey_kind (REU_AK_*) +*/ +native reu_authkey_kind:REU_GetAuthKeyKind(const index); + +/* +* Sets the client connect time. +* +* @param index Client index +* @param time Connect time to set +* +* @return 1 on success +*/ +native REU_SetConnectTime(const index, const Float:time); + +/* +* Gets the client serialized SteamID. +* +* @param index Client index +* @param type Variable to store the id type in, see enum AuthIdType (AUTH_IDTYPE_*) +* @param authid Buffer to copy the serialized id to (at least 64 cells) +* +* @return true on success, false if the client has no serialized id +*/ +native bool:REU_GetSerializedId(const index, &AuthIdType:type, authid[]); + +/* +* Gets the client storage SteamID. +* +* @param index Client index +* @param type Variable to store the id type in, see enum AuthIdType (AUTH_IDTYPE_*) +* @param authid Buffer to copy the storage id to (at least 64 cells) +* +* @return true on success, false if the client has no storage id +*/ +native bool:REU_GetStorageId(const index, &AuthIdType:type, authid[]); + +/* +* Gets the client display SteamID. +* +* @param index Client index +* +* @return Display SteamID as a 64-bit value truncated to a 32-bit cell +* @note For the full id use REU_GetSerializedId/REU_GetStorageId +*/ +native REU_GetDisplaySteamId(const index); + /* * Check if the client is running RevEmu with limited user rights. * diff --git a/reapi/extra/amxmodx/scripting/include/reapi_reunion_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_reunion_const.inc new file mode 100644 index 00000000..da26e66d --- /dev/null +++ b/reapi/extra/amxmodx/scripting/include/reapi_reunion_const.inc @@ -0,0 +1,62 @@ +#if defined _reapi_reunion_const_included + #endinput +#endif + +#define _reapi_reunion_const_included + +/** +* Client auth type +* +* @see REU_GetAuthtype() +* @note Mirrors reunion's enum dp_authkind_e (reunion_api.h), +* extended with CA_TYPE_SSE3 (value 11) +*/ +enum client_auth_type +{ + CA_TYPE_NONE = 0, + CA_TYPE_DPROTO, + CA_TYPE_STEAM, + CA_TYPE_STEAMEMU, + CA_TYPE_REVEMU, + CA_TYPE_OLDREVEMU, + CA_TYPE_HLTV, + CA_TYPE_SC2009, + CA_TYPE_AVSMP, + CA_TYPE_SXEI, + CA_TYPE_REVEMU2013, + CA_TYPE_SSE3, +}; + +/** +* Authkey kind +* +* @see REU_GetAuthKeyKind() +* @note Mirrors reunion's enum reu_authkey_kind (reunion_api.h); +* REU_AK_MAX is a sentinel and is not exposed +*/ +enum reu_authkey_kind +{ + REU_AK_UNKNOWN = -1, + REU_AK_STEAM, + REU_AK_VOLUMEID, + REU_AK_HDDSN, + REU_AK_FILEID, + REU_AK_SXEID, + REU_AK_OTHER, +}; + +/** +* Auth id type +* +* @see REU_GetSerializedId(), REU_GetStorageId() +* @note Mirrors ReHLDS's enum AUTH_IDTYPE +* (rehlds/public/rehlds/userid_rehlds.h) - the +* USERID_t::idtype field written by the natives above +*/ +enum AuthIdType +{ + AUTH_IDTYPE_UNKNOWN = 0, + AUTH_IDTYPE_STEAM, + AUTH_IDTYPE_VALVE, + AUTH_IDTYPE_LOCAL, +}; diff --git a/reapi/src/natives/natives_common.cpp b/reapi/src/natives/natives_common.cpp index b538c14a..699f79eb 100644 --- a/reapi/src/natives/natives_common.cpp +++ b/reapi/src/natives/natives_common.cpp @@ -146,11 +146,11 @@ cell AMX_NATIVE_CALL amx_set_key_value_buffer(AMX *amx, cell *params) /* * Gets an AMXX string buffer from a infobuffer pointer * -* @param buffer Info string pointer -* @param value String to copy value to +* @param pbuffer Info string pointer +* @param output String to copy value to * @param maxlen Maximum size of the output buffer * -* @return Returns a string buffer on infobuffer pointer +* @return Number of cells written to the output buffer * * native get_key_value_buffer(const pbuffer, const output[], const maxlen); */ @@ -313,13 +313,12 @@ cell AMX_NATIVE_CALL amx_GetAttachment(AMX *amx, cell *params) } /* -* Sets body group value based on entity's model group +* Gets body group value based on entity's model group * * @param entity Entity index * @param group Number of entity's model group index -* @param value Value to assign * -* @return 1 on success, 0 otherwise +* @return Body group value * @error If the index is not within the range of 1 to maxEntities or * the entity is not valid, an error will be thrown. * @@ -345,12 +344,13 @@ cell AMX_NATIVE_CALL amx_GetBodygroup(AMX *amx, cell *params) } /* -* Gets body group value based on entity's model group +* Sets body group value based on entity's model group * * @param entity Entity index * @param group Number of entity's model group index +* @param value Value to assign * -* @return Body group value +* @return 1 on success, 0 otherwise * @error If the index is not within the range of 1 to maxEntities or * the entity is not valid, an error will be thrown. * diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index 4e813bea..493408a8 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -3620,7 +3620,7 @@ enum MapNameType { MNT_TRUE, MNT_SET }; * @param output Buffer to copy map name to * @param len Maximum buffer size * @param type MNT_SET will return the name of the current map -* MNT_TRUE will return the original map name independant of the name set with via rh_set_mapname +* MNT_TRUE will return the original map name independent of the name set via rh_set_mapname * * @noreturn * From d32eed9ad57a2f08fdc1d851bc535893fe1f5746 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Fri, 28 Aug 2026 11:08:34 +0300 Subject: [PATCH 2/8] docs(cssdk_const): add Tier B & point constants verified against ReGameDLL/ReHLDS Second batch of the cssdk_const expansion (CS-applicability filter applied: HL-only relics like EF_NIGHTVISION/SNIPERLASER/FIBERCAMERA are intentionally NOT added - neither fork ever sets those bits). New constants: - user-message payloads: BOMB_FLAG_*, STATUSICON_*, HUD_PRINT* (HUD_PRINTRADIO has no AMXX print_* analog), STATUS_NIGHTVISION_*, ITEM_STATUS_* - ScreenFade flags: FFADE_IN/OUT/MODULATE/STAYOUT/LONGFADE - CHAN_BOT (ReHLDS bot chatter channel) - SCENARIO_BLOCK_* (mp_round_infinite flags "a".."k") - menus: ChooseTeamMenuSlot, VGUIMenuSlot, BuyItemMenuSlot - weapon bitfield masks: WEAPON_SUIT, WEAPON_ALLWEAPONS - view cone: VIEW_FIELD_FULL/WIDE/NARROW/ULTRA_NARROW - misc: IN_ACTIVE composite, NUM_BLENDING, ANIM_SWIM_1/2, ANIM_FIRST_DEATH_SEQUENCE, WEAPON_ACTIVITY_VOLUME, DEFAULT_FOV, CS_KILLS_FOR_DOMINATION, KNIFE_BODYHIT/WALLHIT_VOLUME - point additions: MAX_AMMO_SLOTS, MAX_ITEMS, NUM_HITGROUPS, ITBD_END, SF_GAMECOUNTSET_FIREONCE, SF_GAME_PZONE_ONLY_ALIVE, SF_PLAYEREQUIP_REMOVEWEAPONS, SF_GUNTARGET_START_ON, SF_SPARK_TOOGLE/IF_OFF ("TOOGLE" preserved from C++) All values verified against ReGameDLL/ReHLDS headers; no name collisions with amxmodx/core or reapi includes (word-boundary sweep). --- .../amxmodx/scripting/include/cssdk_const.inc | 152 +++++++++++++++++- 1 file changed, 150 insertions(+), 2 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index 0229b8a8..230a944a 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -13,6 +13,8 @@ #define MAX_WEAPONS 32 #define MAX_CLIENTS 32 // Max # of clients allowed in a server. #define MAX_ITEM_TYPES 6 // hud item selection slots +#define MAX_AMMO_SLOTS 32 // not really slots +#define MAX_ITEMS 4 // hard coded item types #define MAX_EDICT_BITS 11 // How many bits to use to encode an edict. # of bits needed to represent max edicts #define MAX_EDICTS (1< Date: Fri, 28 Aug 2026 11:11:03 +0300 Subject: [PATCH 3/8] docs(cssdk_const): export large ReGameDLL weapon/reward enums Expansion batch: port the big constant enums that plugins could not use before (values verified 1:1 against ReGameDLL weapontype.h, gamerules.h, weapons.h): - AutoBuyClassType (15 autobuy bits) - ItemCostType / AmmoCostType / WeaponCostType (item, ammo and weapon default prices; AmmoCostType grenade entries reference ItemCostType values, as in C++) - ClipGiveDefault (28, KNIFE entry kept commented as in C++) - ClipSizeType (24 clip sizes) - WeightWeapon (29 weights) - MaxAmmoType (10 base + 4 ReGameDLL custom grenade/C4 caps) - SATCHELCODE (grenade satchel use codes) - DefuserAllocation (mp_defuser_allocation modes) Word-boundary collision sweep vs amxmodx core and reapi includes: clean. --- .../amxmodx/scripting/include/cssdk_const.inc | 233 ++++++++++++++++++ 1 file changed, 233 insertions(+) diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index 230a944a..bf7ebef0 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -1014,6 +1014,16 @@ enum PaybackForBadThing PAYBACK_FOR_KILLED_TEAMMATES = -3300 }; +/** +* Defuser allocation modes (mp_defuser_allocation) +*/ +enum DefuserAllocation +{ + DEFUSERALLOCATION_NONE = 0, + DEFUSERALLOCATION_RANDOM = 1, + DEFUSERALLOCATION_ALL = 2, +}; + /** * Team IDs for m_iTeam */ @@ -1145,6 +1155,229 @@ enum AmmoType AMMO_MAX_TYPES }; +/** +* Weapon autobuy class types (for m_iAutoBuyClassType / autobuy logic) +*/ +enum AutoBuyClassType +{ + AUTOBUYCLASS_NONE = 0, + AUTOBUYCLASS_PRIMARY = BIT(0), + AUTOBUYCLASS_SECONDARY = BIT(1), + AUTOBUYCLASS_AMMO = BIT(2), + AUTOBUYCLASS_ARMOR = BIT(3), + AUTOBUYCLASS_DEFUSER = BIT(4), + AUTOBUYCLASS_PISTOL = BIT(5), + AUTOBUYCLASS_SMG = BIT(6), + AUTOBUYCLASS_RIFLE = BIT(7), + AUTOBUYCLASS_SNIPERRIFLE = BIT(8), + AUTOBUYCLASS_SHOTGUN = BIT(9), + AUTOBUYCLASS_MACHINEGUN = BIT(10), + AUTOBUYCLASS_GRENADE = BIT(11), + AUTOBUYCLASS_NIGHTVISION = BIT(12), + AUTOBUYCLASS_SHIELD = BIT(13), +}; + +/** +* Item default costs +*/ +enum ItemCostType +{ + ASSAULTSUIT_PRICE = 1000, + FLASHBANG_PRICE = 200, + HEGRENADE_PRICE = 300, + SMOKEGRENADE_PRICE = 300, + KEVLAR_PRICE = 650, + HELMET_PRICE = 350, + NVG_PRICE = 1250, + DEFUSEKIT_PRICE = 200, +}; + +/** +* Ammo default costs +*/ +enum AmmoCostType +{ + AMMO_338MAG_PRICE = 125, + AMMO_357SIG_PRICE = 50, + AMMO_45ACP_PRICE = 25, + AMMO_50AE_PRICE = 40, + AMMO_556MM_PRICE = 60, + AMMO_57MM_PRICE = 50, + AMMO_762MM_PRICE = 80, + AMMO_9MM_PRICE = 20, + AMMO_BUCKSHOT_PRICE = 65, + AMMO_FLASHBANG_PRICE = FLASHBANG_PRICE, + AMMO_HEGRENADE_PRICE = HEGRENADE_PRICE, + AMMO_SMOKEGRENADE_PRICE = SMOKEGRENADE_PRICE, +}; + +/** +* Weapon default costs +*/ +enum WeaponCostType +{ + AK47_PRICE = 2500, + AWP_PRICE = 4750, + DEAGLE_PRICE = 650, + G3SG1_PRICE = 5000, + SG550_PRICE = 4200, + GLOCK18_PRICE = 400, + M249_PRICE = 5750, + M3_PRICE = 1700, + M4A1_PRICE = 3100, + AUG_PRICE = 3500, + MP5NAVY_PRICE = 1500, + P228_PRICE = 600, + P90_PRICE = 2350, + UMP45_PRICE = 1700, + MAC10_PRICE = 1400, + SCOUT_PRICE = 2750, + SG552_PRICE = 3500, + TMP_PRICE = 1250, + USP_PRICE = 500, + ELITE_PRICE = 800, + FIVESEVEN_PRICE = 750, + XM1014_PRICE = 3000, + GALIL_PRICE = 2000, + FAMAS_PRICE = 2250, + SHIELDGUN_PRICE = 2200, +}; + +/** +* The default amount of ammo that comes with each gun when it spawns +*/ +enum ClipGiveDefault +{ + P228_DEFAULT_GIVE = 13, + GLOCK18_DEFAULT_GIVE = 20, + SCOUT_DEFAULT_GIVE = 10, + HEGRENADE_DEFAULT_GIVE = 1, + XM1014_DEFAULT_GIVE = 7, + C4_DEFAULT_GIVE = 1, + MAC10_DEFAULT_GIVE = 30, + AUG_DEFAULT_GIVE = 30, + SMOKEGRENADE_DEFAULT_GIVE = 1, + ELITE_DEFAULT_GIVE = 30, + FIVESEVEN_DEFAULT_GIVE = 20, + UMP45_DEFAULT_GIVE = 25, + SG550_DEFAULT_GIVE = 30, + GALIL_DEFAULT_GIVE = 35, + FAMAS_DEFAULT_GIVE = 25, + USP_DEFAULT_GIVE = 12, + AWP_DEFAULT_GIVE = 10, + MP5NAVY_DEFAULT_GIVE = 30, + M249_DEFAULT_GIVE = 100, + M3_DEFAULT_GIVE = 8, + M4A1_DEFAULT_GIVE = 30, + TMP_DEFAULT_GIVE = 30, + G3SG1_DEFAULT_GIVE = 20, + FLASHBANG_DEFAULT_GIVE = 1, + DEAGLE_DEFAULT_GIVE = 7, + SG552_DEFAULT_GIVE = 30, + AK47_DEFAULT_GIVE = 30, + //KNIFE_DEFAULT_GIVE = 1, + P90_DEFAULT_GIVE = 50, +}; + +/** +* Weapon clip sizes +*/ +enum ClipSizeType +{ + P228_MAX_CLIP = 13, + GLOCK18_MAX_CLIP = 20, + SCOUT_MAX_CLIP = 10, + XM1014_MAX_CLIP = 7, + MAC10_MAX_CLIP = 30, + AUG_MAX_CLIP = 30, + ELITE_MAX_CLIP = 30, + FIVESEVEN_MAX_CLIP = 20, + UMP45_MAX_CLIP = 25, + SG550_MAX_CLIP = 30, + GALIL_MAX_CLIP = 35, + FAMAS_MAX_CLIP = 25, + USP_MAX_CLIP = 12, + AWP_MAX_CLIP = 10, + MP5N_MAX_CLIP = 30, + M249_MAX_CLIP = 100, + M3_MAX_CLIP = 8, + M4A1_MAX_CLIP = 30, + TMP_MAX_CLIP = 30, + G3SG1_MAX_CLIP = 20, + DEAGLE_MAX_CLIP = 7, + SG552_MAX_CLIP = 30, + AK47_MAX_CLIP = 30, + P90_MAX_CLIP = 50, +}; + +/** +* Weapon weights +*/ +enum WeightWeapon +{ + P228_WEIGHT = 5, + GLOCK18_WEIGHT = 5, + SCOUT_WEIGHT = 30, + HEGRENADE_WEIGHT = 2, + XM1014_WEIGHT = 20, + C4_WEIGHT = 3, + MAC10_WEIGHT = 25, + AUG_WEIGHT = 25, + SMOKEGRENADE_WEIGHT = 1, + ELITE_WEIGHT = 5, + FIVESEVEN_WEIGHT = 5, + UMP45_WEIGHT = 25, + SG550_WEIGHT = 20, + GALIL_WEIGHT = 25, + FAMAS_WEIGHT = 75, + USP_WEIGHT = 5, + AWP_WEIGHT = 30, + MP5NAVY_WEIGHT = 25, + M249_WEIGHT = 25, + M3_WEIGHT = 20, + M4A1_WEIGHT = 25, + TMP_WEIGHT = 25, + G3SG1_WEIGHT = 20, + FLASHBANG_WEIGHT = 1, + DEAGLE_WEIGHT = 7, + SG552_WEIGHT = 25, + AK47_WEIGHT = 25, + P90_WEIGHT = 26, + KNIFE_WEIGHT = 0, +}; + +/** +* Maximum ammo amounts (last 4 - ReGameDLL custom) +*/ +enum MaxAmmoType +{ + MAX_AMMO_BUCKSHOT = 32, + MAX_AMMO_9MM = 120, + MAX_AMMO_556NATO = 90, + MAX_AMMO_556NATOBOX = 200, + MAX_AMMO_762NATO = 90, + MAX_AMMO_45ACP = 100, + MAX_AMMO_50AE = 35, + MAX_AMMO_338MAGNUM = 30, + MAX_AMMO_57MM = 100, + MAX_AMMO_357SIG = 52, + + // custom + MAX_AMMO_SMOKEGRENADE = 1, + MAX_AMMO_HEGRENADE = 1, + MAX_AMMO_FLASHBANG = 2, + MAX_AMMO_C4 = 1, +}; + +/** +* Grenade satchel codes for weapon_grenade Use() +*/ +enum SATCHELCODE +{ + SATCHEL_DETONATE, + SATCHEL_RELEASE, +}; + /** * For CBaseMonster::m_rgbTimeBasedDamage */ From e3eac69d7101732b030bae06549a1030f737b156 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Sun, 13 Sep 2026 20:53:18 +0400 Subject: [PATCH 4/8] docs(cssdk_const): add GROUP_OP_AND/GROUP_OP_NAND Port the util.h group operation codes (placed next to the VIEW_FIELD_* block, mirroring source order). Values verified against ReGameDLL regamedll/dlls/util.h:36-37; resurrected from an old local commit (65e855d). No name collisions with amxmodx core or reapi includes (word-boundary sweep). --- reapi/extra/amxmodx/scripting/include/cssdk_const.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index bf7ebef0..c45a4f44 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -302,6 +302,12 @@ enum PlayerIdField #define GIB_NEVER 1 // Never gib, no matter how much death damage is done ( freezing, etc ) #define GIB_ALWAYS 2 // Always gib ( Houndeye Shock, Barnacle Bite ) +/** +* Group operation codes (util.h) +*/ +#define GROUP_OP_AND 0 +#define GROUP_OP_NAND 1 + /** * Dot products for view cone checking (util.h; for m_flFieldOfView) */ From 78fe44530cd2752579094efe45d61579f757d78d Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Sun, 13 Sep 2026 20:59:44 +0400 Subject: [PATCH 5/8] docs(cssdk_const): drop SATCHELCODE, relocate KNIFE_*_VOLUME - remove SATCHELCODE enum: HL satchel-charge relic, UseSatchelCharges is NOXREF and never called in CS paths (violates the CS-applicability filter) - move KNIFE_BODYHIT_VOLUME/KNIFE_WALLHIT_VOLUME out of the m_iWeaponFlash block into the m_iWeaponVolume block where they belong: both are m_iWeaponVolume values set by wpn_knife.cpp (body hit = 128, wall hit = int(flVol * 512)) --- .../extra/amxmodx/scripting/include/cssdk_const.inc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index c45a4f44..51c134cc 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -1375,15 +1375,6 @@ enum MaxAmmoType MAX_AMMO_C4 = 1, }; -/** -* Grenade satchel codes for weapon_grenade Use() -*/ -enum SATCHELCODE -{ - SATCHEL_DETONATE, - SATCHEL_RELEASE, -}; - /** * For CBaseMonster::m_rgbTimeBasedDamage */ @@ -1894,6 +1885,8 @@ enum InfoMapBuyParam #define NORMAL_EXPLOSION_VOLUME 1024 #define SMALL_EXPLOSION_VOLUME 512 #define WEAPON_ACTIVITY_VOLUME 64 +#define KNIFE_BODYHIT_VOLUME 128.0 // CBasePlayer::m_iWeaponVolume after a knife body hit (wpn_knife.cpp) +#define KNIFE_WALLHIT_VOLUME 512.0 // m_iWeaponVolume multiplier after a knife wall hit: int(flVol * KNIFE_WALLHIT_VOLUME) /** * For CBasePlayer:m_iWeaponFlash @@ -1901,8 +1894,6 @@ enum InfoMapBuyParam #define BRIGHT_GUN_FLASH 512 #define NORMAL_GUN_FLASH 256 #define DIM_GUN_FLASH 128 -#define KNIFE_BODYHIT_VOLUME 128.0 -#define KNIFE_WALLHIT_VOLUME 512.0 /** * Player zoom constants From c472ed69d9eea7a72cb3fd74dc039c1d87d58043 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Sun, 13 Sep 2026 23:52:44 +0400 Subject: [PATCH 6/8] docs: correct reapi.inc hookchain native docs and reapi_rechecker.inc contract - HC_BYPASS: document void-only behavior (on returning hookchains it acts like HC_CONTINUE) - GetHookChainReturn: maxlen is required for ATYPE_STRING, not optional; clarify @return - SetHookChainArg: remove phantom maxlen param, add missing @param type, clarify post behavior (later post forwards still see the changed argument) - add missing @return blocks: DisableHookChain, SetHookChainReturn (+@error: strict AType check, ATYPE_TRACE unsupported), get_viewent - reapi_rechecker.inc: declare QueryFileHook tag enum (INVALID_QUERYFILE_HOOK), document hash=-1 semantics (RES_TYPE_EXISTS with -1 becomes RES_TYPE_HASH_ANY), fix ResourceType comment grammar --- .../extra/amxmodx/scripting/include/reapi.inc | 23 ++++++++++++------- .../scripting/include/reapi_rechecker.inc | 13 +++++++---- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/reapi.inc b/reapi/extra/amxmodx/scripting/include/reapi.inc index b3cbfe21..f01e9423 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi.inc @@ -124,7 +124,8 @@ enum // @note Warning: Be very careful, using this type of return will skip calls for all following AMXX plugins HC_BYPASS // Skip calls for all following AMXX plugins, but call the original function - // @note Warning: In PRE skips all forwards including POST forwards + // @note Warning: Applies to void hookchains only: in PRE skips all forwards including POST forwards. + // @note For hookchains with a return value, HC_BYPASS acts like HC_CONTINUE. }; /** @@ -166,6 +167,7 @@ native HookChain:RegisterHookChain(ReAPIFunc:function_id, const callback[], post * * @param hook The hook to stop * +* @return Returns true if the hook is successfully disabled, otherwise false */ native bool:DisableHookChain(HookChain:hook); @@ -185,6 +187,9 @@ native bool:EnableHookChain(HookChain:hook); * @param type To specify the ATYPE_* parameter, look at the enum AType * @param value The value to set the return to * +* @return Returns true on success, otherwise false +* +* @error The type must exactly match the return type registered for the hook; ATYPE_TRACE is not supported. */ native SetHookChainReturn(AType:type, any:...); @@ -193,19 +198,20 @@ native SetHookChainReturn(AType:type, any:...); * This has no effect in pre hookchain. * * @param type To specify the ATYPE_* parameter, look at the enum AType -* @param [maxlen] Max length of string (optional) +* @param maxlen Max length of string (required when type is ATYPE_STRING) * -* @return If an integer or boolean or one byte or float, array or everything else is passed via 1st argument and more +* @return Returns the hookchain return value (see SetHookChainReturn) */ native any:GetHookChainReturn(AType:type, any:...); /* * Set hookchain argument. -* This has no effect in post hookchain. +* In post hookchain this does not affect the original function (it has already been called), +* but subsequent post forwards will see the changed value. * * @param number Number of argument +* @param type To specify the ATYPE_* parameter, look at the enum AType * @param value New value -* @param [maxlen] Max length of string (optional) * * @return Returns true if the function is successfully executed, otherwise false */ @@ -241,13 +247,13 @@ native bool:FClassnameIs(const entityIndex, const className[]); * * @param entity Grenade entity * -* @return return enum's of WeaponIdType +* @return WeaponIdType enum value */ native WeaponIdType:GetGrenadeType(const entityIndex); /* * Sets the view entity on a client. -* This allows pfnSetView able to hooks. +* This allows pfnSetView to be hooked. * * @param index Client index * @param viewEntity Entity index @@ -256,10 +262,11 @@ native WeaponIdType:GetGrenadeType(const entityIndex); native engset_view(const index, const viewEntity); /* -* Gets the return index of the current view entity on a client. +* Gets the index of the current view entity on a client. * * @param index Client index * +* @return View entity index, 0 if none */ native get_viewent(const index); diff --git a/reapi/extra/amxmodx/scripting/include/reapi_rechecker.inc b/reapi/extra/amxmodx/scripting/include/reapi_rechecker.inc index 50c7f2d9..62975244 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_rechecker.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_rechecker.inc @@ -3,13 +3,18 @@ #endif #define _reapi_rechecker_included +enum QueryFileHook +{ + INVALID_QUERYFILE_HOOK = 0 +}; + enum ResourceType { RES_TYPE_NONE = 0, - RES_TYPE_EXISTS, // to comparison with the specified hash value - RES_TYPE_MISSING, // check it missing file on client + RES_TYPE_EXISTS, // compare with the specified hash value + RES_TYPE_MISSING, // check that the file is missing on the client RES_TYPE_IGNORE, // ignore the specified hash value - RES_TYPE_HASH_ANY, // any file with any the hash value + RES_TYPE_HASH_ANY, // any file with any hash value }; enum ReCheckerFunc @@ -41,7 +46,7 @@ enum ReCheckerFunc * @param file The file (Can contain a relative path to the file) * @param function The forward to call * @param type The request type, can be only RES_TYPE_EXISTS, RES_TYPE_MISSING or RES_TYPE_HASH_ANY -* @param hash Hash of file to request. +* @param hash Hash of file to request. With RES_TYPE_EXISTS, -1 means "any hash" (the request is treated as RES_TYPE_HASH_ANY). * * @return Returns a hook handle. Use UnRegisterQueryFile to remove the forward */ From 21a9c0712c4ffc3098b98f67acac6c058d68afbe Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Mon, 14 Sep 2026 14:21:03 +0400 Subject: [PATCH 7/8] docs: note VTC_PlaySound path and format requirements Documents existing VTC behavior: soundFilePath is relative to the game directory and must be a valid PCM WAV file (8 or 16 bit). The broadcast receiver note and the block natives documentation live in the module PR (feat/vtc-api31-block-natives). --- reapi/extra/amxmodx/scripting/include/reapi_vtc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reapi/extra/amxmodx/scripting/include/reapi_vtc.inc b/reapi/extra/amxmodx/scripting/include/reapi_vtc.inc index 98e3aae1..2b5c3a16 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_vtc.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_vtc.inc @@ -43,7 +43,7 @@ native bool:VTC_IsClientMuted(const index); * Play the audio file via the voice stream. * * @param receiver Receiver index -* @param soundFilePath The path to the sound file +* @param soundFilePath The path to the sound file, relative to the game directory; must be a valid PCM WAV file (8 or 16 bit) * * @note Usage example: * VTC_PlaySound(id, "sound/ambience/Opera.wav"); From 33ebc69fb6e6bac7e46d13f9cd148c7736ee2b46 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Sun, 27 Sep 2026 12:48:53 +0400 Subject: [PATCH 8/8] docs(cssdk_const): add SBAR_TARGETTYPE_NONE Mirrors the implicit zeroed sbar state (no target under the crosshair) so Pawn plugins can compare the target type against a named constant instead of a magic 0. Note: upstream ReGameDLL (player.h) defines only SBAR_TARGETTYPE_TEAMMATE/ENEMY/HOSTAGE; the zero state is unnamed there, so 0 is taken from the zero-initialized newSBarState behavior. --- reapi/extra/amxmodx/scripting/include/cssdk_const.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index 51c134cc..39c21799 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -226,6 +226,7 @@ enum ThrowDirection /** * Player's status bar constants */ +#define SBAR_TARGETTYPE_NONE 0 #define SBAR_TARGETTYPE_TEAMMATE 1 #define SBAR_TARGETTYPE_ENEMY 2 #define SBAR_TARGETTYPE_HOSTAGE 3