PHP Code:
stock AwardAssistPoints(client)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new Class = GetEntProp(client, Prop_Send, "m_zombieClass");
if (Class == 8)
{
new tankpoints = GetConVarInt(STankKill);
if(tankpoints < 1 || GetClientTeam(client) == 3) return;
points[attacker] += tankpoints;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Assist", LANG_SERVER, tankpoints);
}
else
{
new sipoints = GetConVarInt(SSIKill);
if(sipoints < 1 || GetClientTeam(client) == 2 || GetEntProp(client, Prop_Send, "m_zombieClass") == 8) return;
points[attacker] += sipoints;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Assist", LANG_SERVER, sipoints);
}
}
public Action:Event_Death(Handle:event, const String:name[], bool:dontBroadcast)
{
ATTACKER
CLIENT
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
for (new client = 1; client <= MaxClients; client++)
{
if (IsClientHuman(client) && AssistAgainst[client][victim])
{
AwardAssistPoints(client);
AssistAgainst[client][victim] = false;
}
}
if(attacker > 0 && client > 0 && !IsFakeClient(attacker) && IsAllowedGameMode() && GetConVarInt(Enable) == 1)
{
decl String:vName[MAX_NAME_LENGTH];
GetClientName(victim, vName, sizeof(vName));
if(GetClientTeam(attacker) == 2)
{
new sipoints = GetConVarInt(SSIKill);
if(sipoints < 1 || GetClientTeam(client) == 2 || GetEntProp(client, Prop_Send, "m_zombieClass") == 8) return;
new bool:headshot = GetEventBool(event, "headshot");
if(headshot) headshotcount[attacker]++;
new headsneeded = GetConVarInt(SNumberHead);
new headpoints = GetConVarInt(SValueHeadSpree);
if(headshotcount[attacker] == headsneeded && headpoints > 0)
{
points[attacker] += headpoints;
headshotcount[attacker] -= headsneeded;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "SI Head Hunter", LANG_SERVER, headpoints);
}
points[attacker] += sipoints;
if(GetConVarBool(Notifications)) CPrintToChat(attacker, "%s %T", MSGTAG, "Killed SI", LANG_SERVER, sipoints, vName);
}
else if(GetClientTeam(attacker) == 3)
{
new killpoints = GetConVarInt(IKill);
if(killpoints < 1 || GetClientTeam(client) == 3) return;
points[attacker] += killpoints;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Killed Survivor", LANG_SERVER, killpoints, vName);
}
}
}
public Action:Event_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
CLIENT
ATTACKER
if(attacker > 0 && client > 0 && !IsFakeClient(attacker) && GetClientTeam(attacker) == 3 && GetClientTeam(client) == 2 && IsAllowedGameMode() && GetConVarInt(Enable) == 1 && GetConVarInt(IHurt) > 0)
{
hurtcount[attacker]++;
new type = GetEventInt(event, "type");
//PrintToChat(attacker, "Damagetype: %d", type);
if( (type == 263168 || type == 265216) && hurtcount[attacker] >= 8 )
{
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Spit Damage", LANG_SERVER, GetConVarInt(IHurt));
points[attacker] += GetConVarInt(IHurt);
hurtcount[attacker] -= 8;
}
/*else if(GetEntProp(attacker, Prop_Send, "m_zombieClass") == 1 && !IsPlayerAlive(attacker))
{
if(FindConVar("l4d_cloud_damage_enabled") != INVALID_HANDLE)
{
if(GetConVarInt(FindConVar("l4d_cloud_damage_enabled")) == 1 && hurtcount[attacker] >= 8 && GetEntProp(attacker, Prop_Send, "m_isGhost") != 1)
{
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Cloud Damage", LANG_SERVER, GetConVarInt(IHurt));
points[attacker] += GetConVarInt(IHurt);
hurtcount[attacker] -= 10;
}
}
}*/
else if(type != 263168 && type != 265216 && hurtcount[attacker] >= 3)
{
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Damage", LANG_SERVER, GetConVarInt(IHurt));
points[attacker] += GetConVarInt(IHurt);
hurtcount[attacker] -= 3;
}
}
AssistAgainst[attacker][victim] = true;
}