From 9bdeb103ebc03bd78834d1fec1fcd10f7cfc142e Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 11 May 2016 22:54:06 +0600 Subject: [PATCH] Added bypass warning 200 on amxmodx 1.8.2 --- .../extra/amxmodx/scripting/include/reapi.inc | 75 +- .../scripting/include/reapi_engine_const.inc | 32 +- .../scripting/include/reapi_gamedll.inc | 17 +- .../scripting/include/reapi_gamedll_const.inc | 3819 +++++++++-------- reapi/src/hook_list.cpp | 14 +- reapi/src/hook_list.h | 5 +- reapi/src/member_list.h | 2 +- reapi/src/natives/natives_addons.cpp | 1 + reapi/src/natives/natives_helper.h | 1 - reapi/src/natives/natives_hookchains.cpp | 72 +- reapi/src/natives/natives_misc.cpp | 12 +- 11 files changed, 2028 insertions(+), 2022 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/reapi.inc b/reapi/extra/amxmodx/scripting/include/reapi.inc index 0e705c6..3d7475b 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi.inc @@ -44,56 +44,54 @@ enum HookChain }; /* - * Hook API function that are available into enum - * Look at the enum's for parameter lists. - * - * @param function The function to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. - * - */ +* Hook API function that are available into enum +* Look at the enum's for parameter lists. +* +* @param function The function to hook. +* @param callback The forward to call. +* @param post Whether or not to forward this in post. +* @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. +* +*/ native HookChain:RegisterHookChain(any:function_id, const callback[], post = 0); /* - * Stops a hook from triggering. - * Use the return value from RegisterHookChain as the parameter here! - * - * @param hook The hook to stop. - * - */ +* Stops a hook from triggering. +* Use the return value from RegisterHookChain as the parameter here! +* +* @param hook The hook to stop. +* +*/ native bool:DisableHookChain(HookChain:hook); /* - * Starts a hook back up. - * Use the return value from RegisterHookChain as the parameter here! - * - * @param hook The hook to re-enable. - * @return Returns if the function is successful executed true otherwise false - * - */ +* Starts a hook back up. +* Use the return value from RegisterHookChain as the parameter here! +* +* @param hook The hook to re-enable. +* @return Returns if the function is successful executed true otherwise false +* +*/ native bool:EnableHookChain(HookChain:hook); /* - * Sets the return value of a hookchain. - * This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. - * - * @param type To specify the type RHV_*, look at the enum HookChainReturn - * @param value The value to set the return to. - * - * native SetHookChainReturn(AType:type, any:...); - */ +* Sets the return value of a hookchain. +* This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. +* +* @param type To specify the type RHV_*, look at the enum HookChainReturn +* @param value The value to set the return to. +* +*/ native SetHookChainReturn(AType:type, any:...); /* - * Gets the return value of a hookchain. - * This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. - * - * @param type To specify the type RHV_*, look at the enum HookChainReturn - * @param value The value to set the return to. - * - * native GetHookChainReturn(AType:type, any:...); - */ +* Gets the return value of a hookchain. +* This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. +* +* @param type To specify the type RHV_*, look at the enum HookChainReturn +* @param value The value to set the return to. +* +*/ native GetHookChainReturn(AType:type, any:...); /* @@ -105,7 +103,6 @@ native GetHookChainReturn(AType:type, any:...); * @param [maxlen] Max length of string (optional) * @return Returns if the function is successful executed true otherwise false * -* native SetHookChainArg(number, AType:type, any:...); */ native SetHookChainArg(number, AType:type, any:...); diff --git a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc index 0a5b425..5dafd29 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc @@ -6,28 +6,28 @@ enum EngineFunc { - /** - * Description: - - * Params: (const recipients, const entity, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch) - */ + /* + * Description: - + * Params: (const recipients, const entity, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch) + */ RH_SV_StartSound = 0, - /** - * Description: - - * Params: (const client, bool:crash, const fmt[]) - */ + /* + * Description: - + * Params: (const client, bool:crash, const fmt[]) + */ RH_SV_DropClient, - /** - * Description: - - * Params: (const runPhysics) - */ + /* + * Description: - + * Params: (const runPhysics) + */ RH_SV_ActivateServer, - /** - * Description: - - * Params: (pcvar, const value[]) - */ + /* + * Description: - + * Params: (pcvar, const value[]) + */ RH_Cvar_DirectSet, // [...] diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc index 919b245..40944b6 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc @@ -233,7 +233,7 @@ native rg_find_ent_by_class(start_index, const classname[]); */ native rg_find_ent_by_owner(&start_index, const classname[], owner); -/** +/* * Returns some information about a weapon. * * @param weapon name or id Weapon id, see WEAPON_* constants WeaponIdType or weapon_* name @@ -242,11 +242,10 @@ native rg_find_ent_by_owner(&start_index, const classname[], owner); * @return Weapon information value * @error If weapon_id and type are out of bound, an error will be thrown. * -* native rg_get_weapon_info(any:...); */ native rg_get_weapon_info(any:...); -/** +/* * Sets specific values of weapons info. * * @param weapon_id Weapon id, see WEAPON_* constants @@ -257,7 +256,17 @@ native rg_get_weapon_info(any:...); */ native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:...); -/** +/* +* Remove all the player's stuff +* +* @param index Client index +* +* @noreturn +* +*/ +native rg_remove_all_items(const index, bool:bRemoveSuit); + +/* * Remove specifed the player's item by class name * * @param index Client index diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 91aeba6..554a3ce 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -12,9 +12,16 @@ #define SIGNAL_VIPSAFETY (1<<4) // Returns 1, if round ended by expired time -// NOTE: Use this for hookchain RG_RoundEnd with the parametr ScenarioEventEndRound:event +// NOTE: Use this for hookchain RG_RoundEnd with the parameter ScenarioEventEndRound:event #define HadRoundExpired(event) (1<INDEX_TO_CSENTITY(m_value); } - Vector& vector() const { return operator Vector&(); diff --git a/reapi/src/natives/natives_hookchains.cpp b/reapi/src/natives/natives_hookchains.cpp index 98db2c3..7dad4cf 100644 --- a/reapi/src/natives/natives_hookchains.cpp +++ b/reapi/src/natives/natives_hookchains.cpp @@ -1,17 +1,16 @@ #include "precompiled.h" /* - * Hook API function that are available into enum - * Look at the enum's for parameter lists. - * - * @param function The function to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. - * - * native RegisterHookChain(any:function_id, const callback[], post = 0); - */ - +* Hook API function that are available into enum +* Look at the enum's for parameter lists. +* +* @param function The function to hook. +* @param callback The forward to call. +* @param post Whether or not to forward this in post. +* @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. +* +* native RegisterHookChain(any:function_id, const callback[], post = 0); +*/ cell AMX_NATIVE_CALL RegisterHookChain(AMX *amx, cell *params) { enum args_e { arg_count, arg_func, arg_handler, arg_post }; @@ -51,15 +50,14 @@ cell AMX_NATIVE_CALL RegisterHookChain(AMX *amx, cell *params) } /* - * Enable hook by handle. - * Use the return value from RegisterHookChain as the parameter here! - * - * @param fwd The hook to re-enable. - * @return Returns if the function is successful executed true otherwise false - * - * native bool:EnableHookChain(any:fwd); - */ - +* Enable hook by handle. +* Use the return value from RegisterHookChain as the parameter here! +* +* @param fwd The hook to re-enable. +* @return Returns if the function is successful executed true otherwise false +* +* native bool:EnableHookChain(any:fwd); +*/ cell AMX_NATIVE_CALL EnableHookChain(AMX *amx, cell *params) { enum args_e { arg_count, arg_handle_hook }; @@ -77,14 +75,13 @@ cell AMX_NATIVE_CALL EnableHookChain(AMX *amx, cell *params) } /* - * Disable hook by handle. - * Use the return value from RegisterHookChain as the parameter here! - * - * @param fwd The hook to stop. - * - * native bool:DisableHookChain(any:fwd); - */ - +* Disable hook by handle. +* Use the return value from RegisterHookChain as the parameter here! +* +* @param fwd The hook to stop. +* +* native bool:DisableHookChain(any:fwd); +*/ cell AMX_NATIVE_CALL DisableHookChain(AMX *amx, cell *params) { enum args_e { arg_count, arg_handle_hook }; @@ -102,15 +99,14 @@ cell AMX_NATIVE_CALL DisableHookChain(AMX *amx, cell *params) } /* - * Sets the return value of a hookchain. - * This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. - * - * @param type To specify the type RHV_*, look at the enum AType - * @param value The value to set the return to. - * - * native SetHookChainReturn(AType:type, any:...); - */ - +* Sets the return value of a hookchain. +* This needs to be used in conjunction with RH_OVERRIDE or RH_SUPERCEDE. +* +* @param type To specify the type RHV_*, look at the enum AType +* @param value The value to set the return to. +* +* native SetHookChainReturn(AType:type, any:...); +*/ cell AMX_NATIVE_CALL SetHookChainReturn(AMX *amx, cell *params) { if (!g_hookCtx) @@ -168,7 +164,6 @@ cell AMX_NATIVE_CALL SetHookChainReturn(AMX *amx, cell *params) * * native GetHookChainReturn(AType:type, any:...); */ - cell AMX_NATIVE_CALL GetHookChainReturn(AMX *amx, cell *params) { if (!g_hookCtx) @@ -217,7 +212,6 @@ cell AMX_NATIVE_CALL GetHookChainReturn(AMX *amx, cell *params) * * native SetHookChainArg(number, AType:type, any:...); */ - cell AMX_NATIVE_CALL SetHookChainArg(AMX *amx, cell *params) { if (!g_hookCtx) diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index 330f705..51e181f 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -480,7 +480,7 @@ cell AMX_NATIVE_CALL rg_find_ent_by_owner(AMX *amx, cell *params) cell& startIndex = *getAmxAddr(amx, params[arg_start_index]); const char* value = getAmxString(amx, params[arg_classname]); edict_t* pOwner = edictByIndexAmx(params[arg_onwer]); - edict_t* pEntity = &g_pEdicts[startIndex]; + edict_t* pEntity = g_pEdicts + startIndex; for (int i = startIndex; i < gpGlobals->maxEntities; i++, pEntity++) { @@ -501,7 +501,7 @@ cell AMX_NATIVE_CALL rg_find_ent_by_owner(AMX *amx, cell *params) return FALSE; } -/** +/* * Returns some information about a weapon. * * @param weapon name or id Weapon id, see WEAPON_* constants or weapon_* name @@ -583,7 +583,7 @@ cell AMX_NATIVE_CALL rg_get_weapon_info(AMX *amx, cell *params) } } -/** +/* * Sets specific values of weapons info. * * @param weapon_id Weapon id, see WEAPON_* constants @@ -631,14 +631,14 @@ cell AMX_NATIVE_CALL rg_set_weapon_info(AMX *amx, cell *params) return 1; } -/** +/* * Remove all the player's stuff * * @param index Client index * * @noreturn * -* native rg_remove_all_items(const index, bool:bRemove); +* native rg_remove_all_items(const index, bool:bRemoveSuit); */ cell AMX_NATIVE_CALL rg_remove_all_items(AMX *amx, cell *params) { @@ -656,7 +656,7 @@ cell AMX_NATIVE_CALL rg_remove_all_items(AMX *amx, cell *params) return TRUE; } -/** +/* * Remove specifed the player's item by class name * * @param index Client index