Author Topic: How do i edit the "%1 has become Super/Admin Auto" text?  (Read 2388 times)

For instance, if an Admin or Super joins the message pops up green. How can i edit this?

IIRC, there's no pref to edit it and you'd need to rewrite AutoAdminCheck(); to change it. What I'd do is package AutoAdminCheck and make your own system. Save the BL IDs on a different file and, when they join, if their BLID is in said file, set isAdmin to true and display the message (messageAll('adminForce', %client.Name SPC "has become Admin (Auto)"); )

I think it's 'adminForce'. I'm not sure.

It's a lot of effort for little purpose..

I think it's 'adminForce'. I'm not sure.
MsgAdminForce, and i'm p sure case matters


You can break GameConnection::autoAdminCheck and create your own message..

Well, this is one way if you do it correctly.

If you're wondering how Reinforcements did it, I asked him. He didn't have RTB enabled and he didn't know that the auto admin system is default. So he made his own auto admin system.

If you're wondering how Reinforcements did it, I asked him. He didn't have RTB enabled and he didn't know that the auto admin system is default. So he made his own auto admin system.
Sure, yea, i wanna know

Instead of breaking the function, why not add your own branch like I mentioned in my previous post?

Close enough.

"Close" only counts in horseshoes and hand grenades, and computer programming is neither.

Sure, yea, i wanna know
Just don't use default auto admin, but you can use the same BLID storage system.  The moderator add-on uses it too.  Here's the key parts:
Code: [Select]
function serverCmdMod(%client, %player)
{  
   schedule(100, 0, Mod_addAutoStatus, %player);
   %player.isModerator = true;
}
function serverCmdDeMod(%client, %player)
{  
   schedule(100, 0, Mod_removeAutoStatus, %player);
   %player.isModerator = false;
}
      

function Mod_addAutoStatus(%client)
{
    $Pref::Server::AutoModList = addItemToList($Pref::Server::AutoModList,%client.bl_id);
    export("$Pref::Server::*","config/server/prefs.cs");  
}
function Mod_removeAutoStatus(%client)
{
$Pref::Server::AutoModList = removeItemFromList($Pref::Server::AutoModList,%client.bl_id);
export("$Pref::Server::*","config/server/prefs.cs");
}

Here's an excerpt from my cloud rank system that might help you in combining the local BLID storage from the moderator system with an admin system:
Code: [Select]
                       case "reg":
%client.isReg = 1;
messageAll('','<color:DDDDFF>%1 has become Regular (Cloud)', %client.name);
break;
case "mod":
%client.isModerator = 1;
%client.isStaff = 1;
messageAll('','<color:9999FF>%1 has become Moderator (Cloud)', %client.name);  
break;
case "admin":
makeAdminAuto(%client);
%client.isStaff = 1;
messageAll('','\c2%1 has become Admin (Cloud)', %client.name);  
break;
case "superadmin":
makeSuperAdminAuto(%client);
%client.isStaff = 1;
messageAll('','\c0%1 has become Super Admin (Cloud)', %client.name);  
break;


function makeAdminAuto(%client)
{
%client.isAdmin = 1;                                      
%client.isSuperAdmin = 0;                            
commandtoclient(%client,'setAdminLevel',1);     //This tells the client to unlock the admin options gui, and not popup the box asking for a password
%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
}


function makeSuperAdminAuto(%client)
{
%client.isAdmin = 1;                                    
%client.isSuperAdmin = 1;                            
commandtoclient(%client,'setAdminLevel',2);     //This tells the client to unlock the admin options gui, and not popup the box asking for a password
%client.sendPlayerListUpdate();                      //this puts the S or A next to their name on their list they bring up with F2
commandtoclient(%client,'setAdminLevel',2);     //This tells the client to unlock the admin options gui, and not popup the box asking for a password
}
« Last Edit: March 09, 2015, 05:03:08 AM by Tezuni 2.0 »

Just don't use default auto admin, but you can use the same BLID storage system.  The moderator add-on uses it too.  Here's the key parts:
Code: [Select]
function serverCmdMod(%client, %player)
{  
   schedule(100, 0, Mod_addAutoStatus, %player);
   %player.isModerator = true;
}
function serverCmdDeMod(%client, %player)
{  
   schedule(100, 0, Mod_removeAutoStatus, %player);
   %player.isModerator = false;
}
      

function Mod_addAutoStatus(%client)
{
    $Pref::Server::AutoModList = addItemToList($Pref::Server::AutoModList,%client.bl_id);
    export("$Pref::Server::*","config/server/prefs.cs");  
}
function Mod_removeAutoStatus(%client)
{
$Pref::Server::AutoModList = removeItemFromList($Pref::Server::AutoModList,%client.bl_id);
export("$Pref::Server::*","config/server/prefs.cs");
}

Here's an excerpt from my cloud rank system that might help you in combining the local BLID storage from the moderator system with an admin system:
Code: [Select]
-snip-
Tezuni. Just thought you might want to know that you're exporting the server prefs wrong. If the server crashes, you'll lose a few prefs. You're supposed to do:

Code: [Select]
export("$Pref::Server::*", "config/server/prefs.cs");
export("$Pref::Net::*", "config/server/prefs.cs", 1);

The last argument is a bool wether to append the prefs to the file or just overwrite the file.

Off Topic: Did your cloud bork up again? I was an admin, but a few days ago I came on and I was/am still only a regular. This has happened once before.
« Last Edit: March 09, 2015, 06:58:59 AM by jes00 »