My thought here is that:
If victim has a bounty, killer gets the bounty money.
If victim does not have a bounty, killer gets +$50 bounty + $10
If victim has a bounty and Self Deletes, people get alerted.
If victim Self Deletes, nothing special happens.
EVERYTHING works. Almost. For some reason, it doesn't detect Self Deletes. Also, it doesn't give the death icons.
Any ideas?
package deathtest{
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc){
//Check for Self Delete
if((%this == %sourceClient) && (%this.bounty > 0)){
messageAll("",%this.name @ " coulden't take the pressure and ended the chase himself!");
}
else if(%this == %sourceClient)
{
}
else if(%this.bounty > 0)
{
%trans = %this.bounty;
messageAll("","\c2" @ %sourceClient.name @ "\c6 killed \c0" @ %this.name @ "\c6 and collected \c0$" @ %trans @ "\c6!");
%sourceClient.cash += %trans;
}
else
{
%sourceClient.bounty += 50;
messageAll("","\c0" @ %sourceclient.name @ "\c6 now has a \c0$" @ %sourceclient.bounty @ "\c6 bounty on him for killing \c2" @ %this.name @ "\c0");
messageClient(%sourceClient.name,"","\c6You looted \c0$10\c6 off \c3" @ this.name @ "\c6's corpse.");
%sourceClient.cash += 10;
}
Parent::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc);
}
};
activatepackage(deathtest);