Blockland Forums > Modification Help
Spring Break Madness (Challenge Complete!)
Deathwishez:
The Boundary Script has been released!
Future add-ons will be released in the same thread (Link: http://forum.blockland.us/index.php?topic=147720.0)
The poll has been reset.
Let Round 2 begin!
Wesley Williams:
Yay for boundaries! We need more genius mods like these :)
Kill/Death ratios will be neat too.
I can't believe I was stupid to realize what the other mods are... good job can't wait for the epic hidden mod to hopefully come out ;)
Kiwi:
The Dogfight Player is still superior after the boundaries.
I think I pick the map after the playertype.
Bauklotz:
I should totally quickly make all the non-released add-ons quickly and release them before Boom gets around to it.
:cookieMonster:
EDIT:
wow i seem bored. took like 5 minutes, although no RTB prefs
--- 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 mFloatLength(%this.kills / %this.deaths, 2);
}
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 ---
includes easy way to get a player's KDR outside this mod (client.getKDR())
Kiwi:
Thanks Bauklotz now we have one more vote for the map. XD
I gonna test your script right away.