View Single Post
MarcoG18
New Member
Join Date: Oct 2014
Old 06-28-2021 , 18:57   Re: [L4D2] Shop [v2.7 | 23 May 2021]
Reply With Quote #28

I saw your work
it's excellent
I just miss one thing
I would like to leave a suggestion
Is it possible to put a function that looks like this

Infected kill = 1 pontos
Headshot kill = 1 pontos
Infected kill + headshot = 2

Special kill = 1 pontos
Special headshot kill = 1 pontos
Special kill + headshot kill = 2

new tankburning[MAXPLAYERS];
new tankbiled[MAXPLAYERS];
new witchburning[MAXPLAYERS];

new killcount[MAXPLAYERS];
new headshotcount[MAXPLAYERS];



//Survivor point earning things
new Handle:SValueKillingSpree = INVALID_HANDLE;
new Handle:SNumberKill = INVALID_HANDLE;

new Handle:SValueHeadSpree = INVALID_HANDLE;
new Handle:SNumberHead = INVALID_HANDLE;
new Handle:SSIKill = INVALID_HANDLE;

new Handle:STankKill = INVALID_HANDLE;
new Handle:SWitchKill = INVALID_HANDLE;
new Handle:SWitchCrown = INVALID_HANDLE;

new Handle:STBurn = INVALID_HANDLE;
new Handle:STSolo = INVALID_HANDLE;
new Handle:SWBurn = INVALID_HANDLE;






Notifications = CreateConVar("l4d2_points_notify", "1", "Show messages when points are earned?");


SValueKillingSpree = CreateConVar("l4d2_points_cikill_value", "2", "How many points does killing a certain amount of infected earn");
SNumberKill = CreateConVar("l4d2_points_cikills", "20", "How many kills you need to earn a killing spree bounty");

SValueHeadSpree = CreateConVar("l4d2_points_headshots_value", "4", "How many points does killing a certain amount of infected with headshots earn");
SNumberHead = CreateConVar("l4d2_points_headshots", "20", "How many kills you need to earn a head hunter bonus");

SSIKill = CreateConVar("l4d2_points_sikill", "3", "How many points does killing a special infected earn");

STankKill = CreateConVar("l4d2_points_tankkill", "2", "How many points does killing a tank earn");
SWitchKill = CreateConVar("l4d2_points_witchkill", "4", "How many points does killing a witch earn");
SWitchCrown = CreateConVar("l4d2_points_witchcrown", "2", "How many points does crowning a witch earn");

STSolo = CreateConVar("l4d2_points_tanksolo", "8", "How many points does killing a tank single-handedly earn");
SWBurn = CreateConVar("l4d2_points_witchburn", "1", "How many points does burning a witch earn");

STag = CreateConVar("l4d2_points_bile_tank", "2", "How many points does biling a tank earn");

IKill = CreateConVar("l4d2_points_kill", "5", "How many points does killing a survivor earn");





public Action:Event_Kill(Handle:event, const String:name[], bool:dontBroadcast)
{
new bool:headshot = GetEventBool(event, "headshot");
ATTACKER
ACHECK2
{
if(headshot) headshotcount[attacker]++;
new headpoints = GetConVarInt(SValueHeadSpree);
new heads = GetConVarInt(SNumberHead);

if(headshotcount[attacker] == heads && headpoints > 0)
{
points[attacker] += headpoints;
headshotcount[attacker] -= heads;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Head Hunter", LANG_SERVER, headpoints);
}
killcount[attacker]++;

new spreepoints = GetConVarInt(SValueKillingSpree);
new kills = GetConVarInt(SNumberKill);
if(killcount[attacker] == kills && spreepoints > 0)
{
points[attacker] += spreepoints;
killcount[attacker] -= kills;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Killing Spree", LANG_SERVER, spreepoints);
}
}
}

public Action:Event_Incap(Handle:event, const String:name[], bool:dontBroadcast)
{
ATTACKER
ACHECK3
{
new incappoints = GetConVarInt(IIncap);
if(incappoints <= 0) return;
points[attacker] += incappoints;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "Incapped Survivor", LANG_SERVER, incappoints);
}
}

public Action:Event_Death(Handle:event, const String:name[], bool:dontBroadcast)
{
ATTACKER
CLIENT
if(attacker > 0 && client > 0 && !IsFakeClient(attacker) && IsAllowedGameMode() && GetConVarInt(Enable) == 1)
{
new bool:notify = GetConVarBool(Notifications);
if(GetClientTeam(attacker) == 2)
{
new sipoints = GetConVarInt(SSIKill);
if(sipoints < 1 || GetClientTeam(client) == 2 || GetEntProp(client, Prop_Send, "m_zombieClass") == 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(notify) PrintToChat(attacker, "%s %T", MSGTAG, "Head Hunter", LANG_SERVER, headpoints);
}
points[attacker] += sipoints;
if(notify) PrintToChat(attacker, "%s %T", MSGTAG, "Killed SI", LANG_SERVER, sipoints);
}
else if(GetClientTeam(attacker) == 3)
{
new killpoints = GetConVarInt(IKill);
if(killpoints < 1 || GetClientTeam(client) == 3) return;
points[attacker] += killpoints;
if(notify) PrintToChat(attacker, "%s %T", MSGTAG, "Killed Survivor", LANG_SERVER, killpoints);
}
}
}

public Action:Event_TankDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new solo = GetEventBool(event, "solo");
ATTACKER
ACHECK2
{
new solopoints = GetConVarInt(STSolo);
if(solo && solopoints > 0)
{
points[attacker] += solopoints;
if(GetConVarBool(Notifications)) PrintToChat(attacker, "%s %T", MSGTAG, "TANK SOLO", LANG_SERVER, solopoints);
}
}
new tankpoints = GetConVarInt(STankKill);
for (new i=1; i<=MaxClients; i++)
{
if(i && IsClientInGame(i)&& !IsFakeClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2 && tankpoints > 0 && GetConVarInt(Enable) == 1 && IsAllowedGameMode())
{
points[i] += tankpoints;
if(GetConVarBool(Notifications)) PrintToChat(i, "%s %T", MSGTAG, "Killed Tank", LANG_SERVER, tankpoints);
}
}
tankburning[attacker] = 0;
tankbiled[attacker] = 0;
}

public Action:Event_WitchDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new oneshot = GetEventBool(event, "oneshot");
CLIENT
CCHECK2
{
new witchpoints = GetConVarInt(SWitchKill);
if(witchpoints <= 0) return;
new notify = GetConVarBool(Notifications);
points[client] += witchpoints;
new crownpoints = GetConVarInt(SWitchCrown);
if(oneshot && crownpoints > 0)
{
points[client] += crownpoints;
if(notify) PrintToChat(client, "%s %T", MSGTAG, "Crowned Witch", LANG_SERVER, crownpoints);
}
if(notify) PrintToChat(client, "%s %T", MSGTAG, "Killed Witch", LANG_SERVER, witchpoints);
}
witchburning[client] = 0;
}



public Action:Event_Burn(Handle:event, const String:name[], bool:dontBroadcast)
{
new String:victim[30];
GetEventString(event, "victimname", victim, sizeof(victim));
CLIENT
CCHECK2
{
new tankpoints = GetConVarInt(STBurn);
new witchpoints = GetConVarInt(SWBurn);
if(StrEqual(victim, "Tank", false) && tankburning[client] == 0 && tankpoints > 0)
{
points[client] += tankpoints;
if(GetConVarBool(Notifications)) PrintToChat(client, "%s %T", MSGTAG, "Burn Tank", LANG_SERVER, tankpoints);
tankburning[client] = 1;
}
else if(StrEqual(victim, "Witch", false) && witchburning[client] == 0 && witchpoints > 0)
{
points[client] += witchpoints;
if(GetConVarBool(Notifications)) PrintToChat(client, "%s %T", MSGTAG, "Burn Witch", LANG_SERVER, witchpoints);
witchburning[client] = 1;
}
}
}
MarcoG18 is offline