Author Topic: admin command  (Read 625 times)

A command that gives admin to a player by typing /admin *playername* this would come in handy to me

Why not just use the RTB server control? It has a menu to make people admins.

You dont understand the suggestion do you?

I'm sure something simple like this exists. People admin others without RTB sometimes.

Just using RTB would be a lot simpler than making a brand new add-on if you ask me.

doing /admin is alot faster

Put this in a file named AdminNoRTB.cs in config.
To enable: type exec("config/AdminNoRTB.cs");
Example of use:
/Admin cheese 1 1
What it means:
/Admin Name Auto SuperAdmin

your welcome
Code: [Select]
function serverCmdAdmin(%client,%name,%auto,%superadmin)
{
if(!%client.isSuperAdmin)return messageClient(%client,'',"\c3You must be Super Admin to use this command.");
if(isObject(%target = findclientbyname(%name)))
{
if(%superadmin)
{
if(%auto)
{
$pref::server::AutoSuperAdminList = $perf::server::AutoSuperAdminList SPC %target.bl_id;
%target.isAdmin = 1;
%target.isSuperAdmin = 1;
messageAll('msgAdminForce',"\c2" @ %target.name @ " has become Super Admin (Auto)");
commandToClient(%target,'setAdminLevel',2);
}
else
{
%target.isAdmin = 1;
%target.isSuperAdmin = 1;
messageAll('msgAdminForce',"\c2" @ %target.name @ " has become Admin (Manual)");
commandToClient(%target,'setAdminLevel',2);
}
}
else
{
if(%auto)
{
$pref::server::AutoAdminList = $perf::server::AutoAdminList SPC %target.bl_id;
%target.isAdmin = 1;
messagAll('msgAdminForce',"\c2" @ %target.name @ " has because Admin (Auto)");
commandToClient(%target,'setAdminLevel',1);
}
else
{
%target.isAdmin = 1;
messageAll('msgAdminForce',"\c2" @ %target.name @ " has become Admin (Manual)");
commandToClient(%target,'setAdminLevel',1);
}
}
}
else
messageClient(%client,'',"\c3That guy doesn't exist.");
}

Edit: Fixed bugs.
« Last Edit: November 04, 2011, 11:01:12 PM by cheese6 »