Author Topic: Clear last save loaded  (Read 438 times)


You've suggested this before. It's incredibly easy code, here:
Code: [Select]
$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();
}
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.

what if you load again without doing the clearlastload thing

You've suggested this before. It's incredibly easy code, here:
Code: [Select]
$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();
}
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.

Thanks but how do I turn it into an event again?

you need to package the upload command to reset it
or add a time value between onloadplants to reset it

you need to package the upload command to reset it
or add a time value between onloadplants to reset it
serverLoadSaveFile_Start

All I did was include a very basic rendition of the core code needed for this. You can add more functionality yourself.

All I did was include a very basic rendition of the core code needed for this. You can add more functionality yourself.
But I don't know how to script.