mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 04:33:20 +00:00
Fix
This commit is contained in:
parent
9d25a36891
commit
a4fe39675a
2 changed files with 8 additions and 8 deletions
Binary file not shown.
|
@ -727,7 +727,7 @@ public void Event_BotPlayerSwap(Event event, const char[] name, bool dontBroadca
|
|||
} else {
|
||||
// Player replaced a bot
|
||||
int client = GetClientOfUserId(event.GetInt("player"));
|
||||
if(botDropMeleeWeapon[bot] > 0) {
|
||||
if(client && botDropMeleeWeapon[bot] > 0) {
|
||||
int meleeOwnerEnt = GetEntPropEnt(botDropMeleeWeapon[bot], Prop_Send, "m_hOwnerEntity");
|
||||
if(meleeOwnerEnt == -1) {
|
||||
EquipPlayerWeapon(client, botDropMeleeWeapon[bot]);
|
||||
|
@ -741,10 +741,10 @@ public void Event_BotPlayerSwap(Event event, const char[] name, bool dontBroadca
|
|||
}
|
||||
public Action Event_OnWeaponDrop(int client, int weapon) {
|
||||
if(!IsValidEntity(weapon) || !IsFakeClient(client)) return Plugin_Continue;
|
||||
if(GetEntProp(client, Prop_Send, "m_humanSpectatorUserID") > 0) {
|
||||
static char wpn[32];
|
||||
GetEdictClassname(weapon, wpn, sizeof(wpn));
|
||||
if(GetEntProp(client, Prop_Send, "m_humanSpectatorUserID") > 0) {
|
||||
if(StrEqual(wpn, "weapon_melee") || StrEqual(wpn, "weapon_pistol") || StrEqual(wpn, "weapon_pistol_magnum")) {
|
||||
if(StrEqual(wpn, "weapon_melee") || StrEqual(wpn, "weapon_pistol_magnum")) {
|
||||
#if defined DEBUG
|
||||
PrintToServer("Bot %N dropped melee weapon %s", client, wpn);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue