Moved more code from event.inc to appropriate modules, fixed kill bonus.
This commit is contained in:
parent
bb05cbccd0
commit
8edf223dc1
@ -242,28 +242,14 @@ public Action:EventPlayerDeath(Handle:event, const String:name[], bool:dontBroad
|
|||||||
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
|
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
|
||||||
|
|
||||||
// Extinguish any flames to stop burning sounds.
|
|
||||||
ExtinguishEntity(index);
|
|
||||||
|
|
||||||
// If the attacker is valid, then continue.
|
|
||||||
if (ZRIsClientValid(attacker))
|
|
||||||
{
|
|
||||||
// If the client is a zombie, then continue.
|
|
||||||
if (InfectIsClientInfected(index))
|
|
||||||
{
|
|
||||||
// Add kill bonus to attacker's score.
|
|
||||||
new bonus = ClassGetKillBonus(attacker);
|
|
||||||
new score = ToolsClientScore(index, true, false);
|
|
||||||
ToolsClientScore(index, true, true, score + bonus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Forward event to modules.
|
// Forward event to modules.
|
||||||
ClassOnClientDeath(index);
|
ClassOnClientDeath(index);
|
||||||
RoundEndOnClientDeath();
|
RoundEndOnClientDeath();
|
||||||
|
InfectOnClientDeath();
|
||||||
SEffectsOnClientDeath(index);
|
SEffectsOnClientDeath(index);
|
||||||
SpawnProtectOnClientDeath(index);
|
SpawnProtectOnClientDeath(index);
|
||||||
RespawnOnClientDeath(index, attacker, weapon);
|
RespawnOnClientDeath(index, attacker, weapon);
|
||||||
|
NapalmOnClientDeath(index);
|
||||||
ZSpawnOnClientDeath(index);
|
ZSpawnOnClientDeath(index);
|
||||||
ZTeleOnClientDeath(index);
|
ZTeleOnClientDeath(index);
|
||||||
ZHPOnClientDeath(index);
|
ZHPOnClientDeath(index);
|
||||||
|
@ -225,6 +225,38 @@ InfectOnClientSpawn(client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client has been killed.
|
||||||
|
*
|
||||||
|
* @param client The client index.
|
||||||
|
* @param attacker The attacker index.
|
||||||
|
*/
|
||||||
|
InfectOnClientDeath(client, attacker)
|
||||||
|
{
|
||||||
|
// If attacker isn't valid, then stop.
|
||||||
|
if (!ZRIsValidClient(attacker))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If attacker isn't a human, then stop.
|
||||||
|
if (!InfectIsClientHuman(attacker))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If client isn't a zombie, then stop.
|
||||||
|
if (!InfectIsClientInfected(client))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add kill bonus to attacker's score.
|
||||||
|
new bonus = ClassGetKillBonus(index);
|
||||||
|
new score = ToolsClientScore(attacker, true, false);
|
||||||
|
ToolsClientScore(attacker, true, true, score + bonus);
|
||||||
|
}
|
||||||
|
|
||||||
/** Client has been hurt.
|
/** Client has been hurt.
|
||||||
*
|
*
|
||||||
* @param client The client index.
|
* @param client The client index.
|
||||||
|
@ -47,6 +47,17 @@ NapalmOnClientHurt(client, const String:weapon[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client has been killed.
|
||||||
|
*
|
||||||
|
* @param client The client index.
|
||||||
|
*/
|
||||||
|
NapalmOnClientDeath(client)
|
||||||
|
{
|
||||||
|
// Extinguish any flames to stop burning sounds.
|
||||||
|
ExtinguishEntity(client);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weapon has been fired.
|
* Weapon has been fired.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user