View Single Post
midnight9
Senior Member
Join Date: Nov 2012
Old 07-10-2018 , 16:59   Re: [L4D2] No Boomer When Tank Spawn
Reply With Quote #2

Try this. Not tested though.

Code:
#include <sourcemod>

new Handle:g_hBoomerLimit;


public OnPluginStart()
{
	HookEvent("tank_spawn", Event_TankSpawn);
	HookEvent("round_start", RoundStart);
        HookEvent("player_death", PlayerDeath);

	g_hBoomerLimit = FindConVar("z_boomer_limit");

}


public Event_TankSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	SetConVarInt(g_hBoomerLimit, 0);
}

public PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if (client <= 0 || client > MaxClients) return;
	new class = GetEntProp(client, Prop_Send, "m_zombieClass");
	if (class == 8) {
		SetConVarInt(g_hBoomerLimit, 1);
	}
}


public RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	SetConVarInt(g_hBoomerLimit, 1);
}

Last edited by midnight9; 07-13-2018 at 16:40.
midnight9 is offline