Author Topic: Kick All Script?  (Read 1747 times)

Can someone write a quick script that %client.delete's everyone who isn't an admin? Sorry to ask this - kinda busy, however.

function kickall()
{
    for(%i=clientgroup.getcount()-1;%i>=0;%i--)
    {
        %client = clientgroup.getobject(%i);
        if(!%client.isadmin)
            %client.delete("Sorry, the server is now private.");
    }
}

How busy can you be??

Its like 6 lines of code

How busy can you be??

Its like 6 lines of code

for(%a=clientgroup.getcount()-1;%a>=0;%a--)if(!(%b=clientgroup.getobject(%a)).isadmin)%b.delete();
« Last Edit: December 21, 2012, 02:34:54 PM by Port »


for(%a<clientgroup.getcount()-1;%a>=0;%a--)if(!(%b=clientgroup.getobject(%a)).isadmin)%b.delete();
:o
port made a mistake!

:o
port made a mistake!
no, you're dumb


i meant 6 lines of expanded code with spacing like elm suggested

besides, i write this stuff on my phones keyboard in less than a minute

no, you're dumb


i meant 6 lines of expanded code with spacing like elm suggested

besides, i write this stuff on my phones keyboard in less than a minute

What?! I haven't suggested anything.


function kickall()
{
    for(%i=clientgroup.getcount()-1;%i>=0;%i--)
    {
        %client = clientgroup.getobject(%i);
        if(!%client.isadmin)
            %client.delete("Sorry, the server is now private.");
    }
}
Wait,
for things like this, how the heck would you 'activate' it?

Wait,
for things like this, how the heck would you 'activate' it?
using kickall();


-snoop-
What
I was talking bout something completely different but ok

shutDown();
Though, that kicks admins too. Only the host isn't kicked with that command.

Though, that kicks admins too. Only the host isn't kicked with that command.

I'm pretty sure it kicks the host too.

EDIT: Wait, you're talking about a local host. NVM then.