Keep magnums and pistols

This commit is contained in:
Jackz 2022-07-30 22:17:31 -05:00
parent 65a3af9ae0
commit 2f87a4e7ad
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
2 changed files with 8 additions and 6 deletions

Binary file not shown.

View file

@ -743,13 +743,15 @@ public Action Event_OnWeaponDrop(int client, int weapon) {
if(!IsValidEntity(weapon) || !IsFakeClient(client)) return Plugin_Continue; if(!IsValidEntity(weapon) || !IsFakeClient(client)) return Plugin_Continue;
static char wpn[32]; static char wpn[32];
GetEdictClassname(weapon, wpn, sizeof(wpn)); GetEdictClassname(weapon, wpn, sizeof(wpn));
if(StrEqual(wpn, "weapon_melee") && GetEntProp(client, Prop_Send, "m_humanSpectatorUserID") > 0) { if(GetEntProp(client, Prop_Send, "m_humanSpectatorUserID") > 0) {
if(StrEqual(wpn, "weapon_melee") || StrEqual(wpn, "weapon_pistol") || StrEqual(wpn, "weapon_pistol_magnum")) {
#if defined DEBUG #if defined DEBUG
PrintToServer("Bot %N dropped melee weapon %s", client, wpn); PrintToServer("Bot %N dropped melee weapon %s", client, wpn);
#endif #endif
RequestFrame(Frame_HideEntity, weapon); RequestFrame(Frame_HideEntity, weapon);
botDropMeleeWeapon[client] = weapon; botDropMeleeWeapon[client] = weapon;
} }
}
return Plugin_Continue; return Plugin_Continue;
} }
public void Frame_HideEntity(int entity) { public void Frame_HideEntity(int entity) {