Blockland Forums > Modification Help
Spring Break Madness (Challenge Complete!)
<< < (9/49) > >>
Bauklotz:
Fixed:

--- Code: ---$saveKDR = true;
function GameConnection::loadKDR(%this) {
   %fo = new fileObject();
   %fo.openForRead("confifg/server/KDR/" @ %this.bl_id @ ".dat");
   %this.kills = %fo.readLine();
   %this.deaths = %fo.readLine();
   %fo.close();
   %fo.delete();
}
function GameConnection::saveKDR(%this) {
   %fo = new fileObject();
   %fo.openForWrite("confifg/server/KDR/" @ %this.bl_id @ ".dat");
   %fo.writeLine(%this.kills);
   %fo.writeLine(%this.deaths);
   %fo.close();
   %fo.delete();
}
function gameConnection::updateKDR(%this) {
   %this.clanSuffix = %this.firstClanSuffix SPC "\c7[\c4" @ %this.getKDR() @ "\c7";
}
function gameConnection::getKDR(%this) {
   return %this.kills - %this.deaths;
}
package KDR {
   function GameConnection::autoAdminCheck(%this) {
      if($saveKDR) {
         %this.loadKDR();
         %this.updateKDR();
      }
      return parent::autoAdminCheck(%this);
   }
   function gameConnection::onDeath(%this, %pl, %cl, %type, %loc) {
      parent::onDeath(%this, %pl, %cl, %type, %loc);
      if(%cl !$= %this)
         %cl.kills++;
      %this.deaths++;
      %this.updateKDR();
      if($saveKDR)
         %this.saveKDR();
   }
};
activatePackage(KDR);

--- End code ---
Deathwishez:
That's the general idea, but that's not a ratio. I use kill/deaths.

If you really want to ruin the event, go ahead. However, I doubt you could pump out 8 add-ons in 5 days.
Sicarius:
7 have something to do with vehicle theft? Grand Theft Auto RPs here we come...
Placid:
Looks very, very cool.
Bauklotz:

--- Quote from: Deathwishez on March 15, 2011, 08:38:53 AM ---I doubt you could pump out 8 add-ons in 5 days.

--- End quote ---

It took five minutes to make the KDR script.
Navigation
Message Index
Next page
Previous page

Go to full version