From d00489b0f2ba65b69f4f4eb675127d8fc862770b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Lo=20Giudice?= Date: Tue, 1 Nov 2016 07:57:35 -0300 Subject: [PATCH] Added rg_reset_maxspeed native (#28) * Added rg_reset_maxspeed native --- .../scripting/include/reapi_gamedll.inc | 10 +++++++++ reapi/src/natives/natives_misc.cpp | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc index 4b73efc..bf96a3a 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc @@ -595,6 +595,16 @@ native WeaponIdType:rg_get_weaponbox_id(const entity); */ native rg_round_respawn(const index); +/* +* Reset player maxspeed +* +* @param index Client index +* +* @noreturn +* +*/ +native rg_reset_maxspeed(const index); + /* * Draws a HUD progress bar which is fills from 0% to 100% for the time duration seconds. * NOTE: Set Duration to 0 to hide the bar. diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index d330e63..ecaa7f5 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -1512,6 +1512,26 @@ cell AMX_NATIVE_CALL rg_round_respawn(AMX *amx, cell *params) return TRUE; } +/* +* Reset player maxspeed +* +* @param index Client index +* +* @noreturn +* +* native rg_reset_maxspeed(const index); +*/ +cell AMX_NATIVE_CALL rg_reset_maxspeed(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index }; + + CBasePlayer *pPlayer = g_ReGameFuncs->UTIL_PlayerByIndex(params[arg_index]); + CHECK_CONNECTED(pPlayer, arg_index); + + pPlayer->ResetMaxSpeed(); + return TRUE; +} + /* * Draws a HUD progress bar which is fills from 0% to 100% for the time duration seconds. * NOTE: Set Duration to 0 to hide the bar. @@ -1666,6 +1686,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] = { "rg_is_player_can_takedamage", rg_is_player_can_takedamage }, { "rg_get_weaponbox_id", rg_get_weaponbox_id }, { "rg_round_respawn", rg_round_respawn }, + { "rg_reset_maxspeed", rg_reset_maxspeed }, { "rg_send_bartime", rg_send_bartime }, { "rg_send_bartime2", rg_send_bartime2 },