Hey everyone. I'm working on a buy menu for a L4D2 server and I need to know when a player kills each type of zombie to be able to reward them with a specific amount of money. So far I have found everything except for the zombie types from hordes. Here is what I have. Please let me know if I my way works and how I can get the information for hordes.
Code:
#define ZOMBIECLASS_SMOKER 1
#define ZOMBIECLASS_BOOMER 2
#define ZOMBIECLASS_HUNTER 3
#define ZOMBIECLASS_SPITTER 4
#define ZOMBIECLASS_JOCKEY 5
#define ZOMBIECLASS_CHARGER 6
#define ZOMBIECLASS_WITCH 7
#define ZOMBIECLASS_TANK 8
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int attacker = GetEventInt(event, "attacker");
int client = GetClientOfUserId(attacker);
int user = GetEventInt(event, "userid");
int deadclient = GetClientOfUserId("user");
int victim = GetEventString(event, "victimname");
int class = GetZombieType(client);
int money;
if(!IsFakeClient(client))
{
// if(StrEqual(class, "commoninfected")
// money = GetConVarInt(h_MoneyfromCommonInfected);
if(class == ZOMBIECLASS_HUNTER)
money = GetConVarInt(h_MoneyfromHunter);
else if(class == ZOMBIECLASS_SMOKER)
money = GetConVarInt(h_MoneyfromSmoker);
else if(class == ZOMBIECLASS_BOOMER)
money = GetConVarInt(h_MoneyfromBoomer);
else if(class == ZOMBIECLASS_TANK)
money = GetConVarInt(h_MoneyfromTank);
else if(GetClientTeam(deadclient)==2)
money = GetConVarInt(h_MoneyfromSurvivor);
else if(class == ZOMBIECLASS_WITCH)
money = GetConVarInt(h_MoneyfromWitch);
else if(class == ZOMBIECLASS_JOCKEY)
money = GetConVarInt(h_MoneyfromJockey);
else if(class == ZOMBIECLASS_CHARGER)
money = GetConVarInt(h_MoneyfromCharger);
else if(class == ZOMBIECLASS_SPITTER)
money = GetConVarInt(h_MoneyfromSpitter);
// else if(StrEqual(class, "ceda")
// money = GetConVarInt(h_MoneyfromCEDA);
// else if(StrEqual(class, "jim")
// money = GetConVarInt(h_MoneyfromJim);
// else if(StrEqual(class, "fallen")
// money = GetConVarInt(h_MoneyfromFallen);
// else if(StrEqual(class, "clown")
// money = GetConVarInt(h_MoneyfromClown);
// else if(StrEqual(class, "mud")
// money = GetConVarInt(h_MoneyfromMud);
// else if(StrEqual(class, "riot")
// money = GetConVarInt(h_MoneyfromRiot);
i_Money[client] += money;
}
}
stock GetZombieType(client)
{
return GetEntProp(client, Prop_Send, "m_zombieClass");
}
__________________