PDA

View Full Version : check for master plugin



Beau_M
12-26-2008, 02:57 AM
Hmm, probably something very simple I'm missing here but can't find an example of it anywhere. How do you check (from lscript of course) if a master plugin is running? I've been hunting all day with no success, even a point in the general direction of the answer would be handy!

dballesg
12-26-2008, 04:23 AM
Hi,

I found this long ago on an open source script, I think was a faulkernmano one, or maybe Dodgy's one.



msActive = false;
curScene = Scene();
// Gets the masterhandlers applied on the scene
mhlist = curScene.server("MasterHandler");

// If there is any master handler on the scene
if(mhlist)
{
counter = size(mhlist);
// Loop them
for(x = 1; x <= counter; x++)
{
// If found our Master Script options
if(mhlist[x] == "Name of Master Script")
{
msActive = true;
break;
}
}
}

// If wasn't found
if(!msActive)
{
// Apply it
ApplyServer("MasterHandler", "Name of Master Script");
}

Hope that is what you are looking for.

David

Beau_M
12-26-2008, 06:05 AM
Does the job perfectly. Thanks :)