Author Topic: Setting Admin Levels  (Read 1061 times)

how do you set the admin level? is it %client.isAdmin(0/1);? i told my friends to put that in the console but they said it gave an error, and i was wondering what was the correct way to toggle admin

%client.isadmin = 1; %client.isSuperAdmin=1;

Code: [Select]
%client.isAdmin = 1;
%client.isSuperAdmin = 0;
%client.sendPlayerListUpdate();
commandtoclient(%client,'setAdminLevel',1);
or
Code: [Select]
%client.isAdmin = 1;
%client.isSuperAdmin = 1;
%client.sendPlayerListUpdate();
commandtoclient(%client,'setAdminLevel',2);

thanks, then to deadmin, both isadmin and issuperadmin would be 0, and the adminlevel? also, for the sendplayerlistupdate, should i put that in a for loop to target everybody after deadmining people?

-code snip-

thanks, then to deadmin, both isadmin and issuperadmin would be 0, and the adminlevel? also, for the sendplayerlistupdate, should i put that in a for loop to target everybody after deadmining people?
Code: [Select]
%client.isAdmin = 1;                                       //is the actual setting of the persons status that the server references when the client tries to do something
%client.isSuperAdmin = 0;                            //like before but for super admin
%client.sendPlayerListUpdate();                      //this puts the S or A next to their name on their list they bring up with F2
commandtoclient(%client,'setAdminLevel',1);     //This tells the client to unlock the admin options gui, and not popup the box asking for a password
With comments.
 :cookieMonster:
Basically, you'd just do this to deadmin someone:
Code: [Select]
%client.isAdmin = 0;                                       //is the actual setting of the persons status that the server references when the client tries to do something
%client.isSuperAdmin = 0;                            //like before but for super admin
%client.sendPlayerListUpdate();                      //this puts the S or A next to their name on their list they bring up with F2
commandtoclient(%client,'setAdminLevel',0);     //This tells the client to unlock the admin options gui, and not popup the box asking for a password
Also, zack0wack0's code dosn't seem to include the green message that would say "%1 has become admin. (Manual)" you'd do that by
Code: [Select]
messageall('msgadminforce',"\c2" @ %client.name @ " has become admin. (Manual)");
Granted I'm not sure if it's supposed to be 'msgadminforce' exactly, but I can't find the correct one.

i kinda figured what each did, but this clears up any doubt i had :D
message is unnecessary for me, so i think i'll leave it out
for the %client.sendplayerlistupdate();, should i do that to every client or just the one i'm deadmining?

i kinda figured what each did, but this clears up any doubt i had :D
message is unnecessary for me, so i think i'll leave it out
for the %client.sendplayerlistupdate();, should i do that to every client or just the one i'm deadmining?
I can't tell if it means to send updates from %client to everyone or to client from everyone else.
But doing it to everyone can't hurt, so go for it.

well, from the server to ALL the clients, ie:
for(%i = 0; %i <= ClientGroup.getCount(); %i++)
{
   %person = ClientGroup.getObject(%i);
   %person.sendPlayerListUpdate();
}
instead of
%client.sendPlayerListUpdate();

well, from the server to ALL the clients, ie:
for(%i = 0; %i <= ClientGroup.getCount(); %i++)
{
   %person = ClientGroup.getObject(%i);
   %person.sendPlayerListUpdate();
}
instead of
%client.sendPlayerListUpdate();
yes, I know