mirror of
https://github.com/rehlds/reapi.git
synced 2024-12-29 08:05:36 +03:00
Minor fixes (#193)
* fix rg_remove_items_by_slot c4 slot * fix rg_remove_items_by_slot weapon hud * add RG_SpawnRandomGibs victim arg
This commit is contained in:
parent
23cf192477
commit
1156a49c7a
@ -395,7 +395,7 @@ enum GamedllFunc
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Params: (int cGibs, int human)
|
||||
* Params: (pevVictim, cGibs, human)
|
||||
*/
|
||||
RG_SpawnRandomGibs,
|
||||
};
|
||||
|
@ -875,6 +875,12 @@ 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);
|
||||
|
||||
if (params[arg_slot] == C4_SLOT)
|
||||
{
|
||||
pPlayer->CSPlayer()->RemovePlayerItemEx("weapon_c4", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->ForEachItem(params[arg_slot], [pPlayer](CBasePlayerItem *pItem)
|
||||
{
|
||||
if (pItem->IsWeapon()) {
|
||||
@ -887,6 +893,12 @@ cell AMX_NATIVE_CALL rg_remove_items_by_slot(AMX *amx, cell *params)
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@ -896,6 +908,7 @@ cell AMX_NATIVE_CALL rg_remove_items_by_slot(AMX *amx, cell *params)
|
||||
if (!pPlayer->m_rgpPlayerItems[PRIMARY_WEAPON_SLOT]) {
|
||||
pPlayer->m_bHasPrimary = false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user