Author Topic: Bounty Problems  (Read 923 times)

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?

Code: [Select]
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);

perhaps package over serverCmdSelf Delete(%client) ?

Meh, just an idea.
Like, when a person Self Deletes, have it check whether the person is bountied, do stuff, then just execute the parent.

Either you didn't post all of the script, or the problem is with %this.bounty

When you commit Self Delete %sourceClient turns out to equal to nothing, but %this has a value. That's why when trying to compare the two the script simply overlooks it.

So, this script works. Finally, something I did all by my selfs <3