I want zombies to gain points only when they are killed by the enemy team.
I used the following codes but they didn't work.
I've added this to onplayerspawned(); and it's working now. However, I still want to know why don't the codes above work.
I used the following codes but they didn't work.
Code:
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
if(self.doZombie && eAttacker.team == "allies")
{
self.bounty += 75;
self notify("CASH");
}
Code:
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
if(self.doZombie && self.sMeansOfDeath != "MOD_SUICIDE")
{
self.bounty += 75;
self notify("CASH");
}
Code:
if(self.doZombie && eAttacker != self)
{
self.bounty += 75;
self notify("CASH");
}
Code:
if(eAttacker.team == "allies")
{
eAttacker notify("pointkill");
self.bounty += 75;
self notify("CASH");
}
I've added this to onplayerspawned(); and it's working now. However, I still want to know why don't the codes above work.
Code:
if(self.pers["suicides"] >= 1)
{
self.pers["suicides"] = 0;
self.bounty -= 75;
self notify("CASH");
}