ItsMods

Full Version: Problem with some coding...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone make suicide don't count as a kill?

http://pastebin.com/JHdPhEJz

Code from Zxz's gungame

Suicide is this:
Code:
self doDamage(30, self.origin, self, self, 0, "MOD_FALLING", 0, "napalm_mp");
Where is "zxz" being notified from?
(01-03-2011, 14:17)waffles Wrote: [ -> ]Where is "zxz" being notified from?
Code:
Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
(01-03-2011, 14:25)alistair3149 Wrote: [ -> ]
(01-03-2011, 14:17)waffles Wrote: [ -> ]Where is "zxz" being notified from?
Code:
Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)

First change:

Code:
self waittill("zxz");

to:

Code:
self waittill("zxz", sMeansOfDeath );

Then in the Callback_PlayerKilled function, find where the self notify( "zxz" ) is, and change it to this:

Code:
self notify( "zxz", sMeansOfDeath );

This will allow you to check the type of death the player just experienced. Add a simple IF statement checking if the type is MOD_SUICIDE.
Look for Callback_PlayerKilled and add this after:
Code:
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);

Code:
if(eAttacker == self)
    self.kills--;