diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index c578af1..0afc09d 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -395,7 +395,7 @@ enum GamedllFunc /* * Description: - - * Params: (int cGibs, int human) + * Params: (pevVictim, cGibs, human) */ RG_SpawnRandomGibs, }; @@ -777,13 +777,13 @@ enum GamedllFunc_CBasePlayer * Params: (const this) */ RG_CBasePlayer_UseEmpty, - + /* * Description: Called when a idle player is removed from server. * Return type: void * Params: (const this, const reason[]) */ - RG_CBasePlayer_DropIdlePlayer, + RG_CBasePlayer_DropIdlePlayer, }; /** @@ -4522,7 +4522,7 @@ enum CCSPlayer_Members * Set params: set_member(index, member, Float:value); */ m_flSpawnProtectionEndTime, - + /* * Description: - * Member type: class Vector @@ -5996,7 +5996,7 @@ enum CGib_Members * Set params: set_member(index, member, value); */ m_Gib_bloodColor = BEGIN_MEMBER_REGION(gib), - + /* * Description: - * Member type: int @@ -6004,7 +6004,7 @@ enum CGib_Members * Set params: set_member(index, member, value); */ m_Gib_cBloodDecals, - + /* * Description: - * Member type: int @@ -6012,7 +6012,7 @@ enum CGib_Members * Set params: set_member(index, member, value); */ m_Gib_material, - + /* * Description: - * Member type: float diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index bba93ac..e159cdc 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -875,26 +875,39 @@ cell AMX_NATIVE_CALL rg_remove_items_by_slot(AMX *amx, cell *params) CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]); CHECK_CONNECTED(pPlayer, arg_index); - pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem) + if (params[arg_slot] == C4_SLOT) { - if (pItem->IsWeapon()) { - if (pItem == pPlayer->m_pActiveItem) { - ((CBasePlayerWeapon *)pItem)->RetireWeapon(); + pPlayer->CSPlayer()->RemovePlayerItemEx("weapon_c4", true); + } + else + { + pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem) + { + if (pItem->IsWeapon()) { + if (pItem == pPlayer->m_pActiveItem) { + ((CBasePlayerWeapon *)pItem)->RetireWeapon(); + } + + pPlayer->m_rgAmmo[ pItem->PrimaryAmmoIndex() ] = 0; } - pPlayer->m_rgAmmo[ pItem->PrimaryAmmoIndex() ] = 0; + if (pPlayer->RemovePlayerItem(pItem)) { + pPlayer->pev->weapons &= ~(1 << pItem->m_iId); + + // No more weapon + if ((pPlayer->pev->weapons & ~(1 << WEAPON_SUIT)) == 0) { + pPlayer->m_iHideHUD |= HIDEHUD_WEAPONS; + } + + pItem->Kill(); + } + + return false; + }); + + if (!pPlayer->m_rgpPlayerItems[PRIMARY_WEAPON_SLOT]) { + pPlayer->m_bHasPrimary = false; } - - if (pPlayer->RemovePlayerItem(pItem)) { - pPlayer->pev->weapons &= ~(1 << pItem->m_iId); - pItem->Kill(); - } - - return false; - }); - - if (!pPlayer->m_rgpPlayerItems[PRIMARY_WEAPON_SLOT]) { - pPlayer->m_bHasPrimary = false; } return TRUE;