Author Topic: is this Possible?  (Read 842 times)

Hey is it possible if i make a serverCmdadmins(%client)
And when i do the command all admin names will popup some where?
Is that possible?

Not by making all names of admins in a text command and make that popup.

Why not just open Server Control and look in the list?

On Topic: It is possible. I have no clue how to do it though.

Hey is it possible if i make a serverCmdadmins(%client)
And when i do the command all admin names will popup some where?
Is that possible?

Not by making all names of admins in a text command and make that popup.
where do you want them to pop up?

I think
for(%i = 0; %i < clientGroup.getCount(); %i++)
{
%i = %client;
if(%client.isAdmin())
{
echo(%client)
}
}
will work (could be wrong, been a while since I have done much with blockland or torque)
replace echo with whatever you want to do to find out the list of names, might I suggest using fileobject to write it into a txt doc?

for(%i = 0; %i < clientGroup.getCount(); %i++)
{
%i = %client;
if(%client.isAdmin || %client.isSuperAdmin)
{
echo(%client)
}
}
no, that won't work.
Code: [Select]
for(%i=0;%i<clientGroup.getCount();%i++) {
    %client = clientGroup.getObject(%i);
    if(isObject(%client)) {
        //do stuff here
    }
}

clientGroup.getObject gets the actual object of the client. and, of course this is serverside, which is not exactly what i think the OP is asking for.
yes, i know the formatting is frowned upon, shut up.
« Last Edit: September 11, 2011, 06:50:17 PM by Placid »

where do you want them to pop up?

I think
for(%i = 0; %i < clientGroup.getCount(); %i++)
{
%i = %client;
if(%client.isAdmin())
{
echo(%client)
}
}
will work (could be wrong, been a while since I have done much with blockland or torque)
replace echo with whatever you want to do to find out the list of names, might I suggest using fileobject to write it into a txt doc?

function serverCmdAdmin(%client)
{
     for(%i=0;%i<clientGroup.getCount();%i++)
     {
          %cl = clientGroup.getObject(%i);
          if(%cl.isAdmin || %cl.isSuperAdmin)
          {
               %add = (%add $= "") ? %add = %cl SPC %cl.name : %add = %add @ "\n" @ %cl SPC %cl.name;
          }
     }
     messageBoxOk("Admins",%add);
}

function serverCmdAdmin(%client)
{
     for(%i=0;%i<clientGroup.getCount();%i++)
     {
          %cl = clientGroup.getObject(%i);
          if(%cl.isAdmin || %cl.isSuperAdmin)
          {
               %add = (%add $= "") ? %add = %cl SPC %cl.name : %add = %add @ "\n" @ %cl SPC %cl.name;
          }
     }
     messageBoxOk("Admins",%add);
}


Clientgroup is server side.
messageboxok is client side.

Something needs to be changed.

I think there is a commandtoclient that will do a prompt, but I do not know if it is default.

Clientgroup is server side.
messageboxok is client side.

Something needs to be changed.

I think there is a commandtoclient that will do a prompt, but I do not know if it is default.

I want it server sided, because the gui that the code will be inn is server sided.

commandToClient(%client, 'MessageBoxOK', %title, %text);


Oh, excuse me for that error, remove my messageBoxOk and use the commandToClient(%client,'messageBoxOk',%title,%text);

wouldn't all of these list the admins that are on the server? and not all in general