Blockland Forums > Suggestions & Requests
Clear last save loaded
ScratchTehEPICSpaceDude:
/title
Treynolds416:
You've suggested this before. It's incredibly easy code, here:
--- Code: ---$LastLoad = new SimSet();
package lastLoad
{
function fxDTSBrick::onLoadPlant(%brick)
{
Parent::onLoadPlant(%brick);
if(isObject(%brick))
$LastLoad.add(%brick);
}
};
activatePackage(lastLoad);
function ServerCmdClearLastLoad(%client)
{
if(!%client.isAdmin)
return;
while(%delete = $LastLoad.getObject(0))
%delete.delete();
$LastLoad.delete();
$LastLoad = new SimSet();
}
--- End code ---
And stfu other coders about the object check before adding to the set, other functions may have packaged onLoadPlant to delete the brick in certain circumstances.
otto-san:
what if you load again without doing the clearlastload thing
ScratchTehEPICSpaceDude:
--- Quote from: Treynolds416 on July 03, 2012, 03:40:42 PM ---You've suggested this before. It's incredibly easy code, here:
--- Code: ---$LastLoad = new SimSet();
package lastLoad
{
function fxDTSBrick::onLoadPlant(%brick)
{
Parent::onLoadPlant(%brick);
if(isObject(%brick))
$LastLoad.add(%brick);
}
};
activatePackage(lastLoad);
function ServerCmdClearLastLoad(%client)
{
if(!%client.isAdmin)
return;
while(%delete = $LastLoad.getObject(0))
%delete.delete();
$LastLoad.delete();
$LastLoad = new SimSet();
}
--- End code ---
And stfu other coders about the object check before adding to the set, other functions may have packaged onLoadPlant to delete the brick in certain circumstances.
--- End quote ---
Thanks but how do I turn it into an event again?
phflack:
you need to package the upload command to reset it
or add a time value between onloadplants to reset it