Forums Index >> Modding >> how do you make new admin logins?



Page : <1> :


How do you make them? (a.k.a. /min /dic /god)

//-----------------------------------------------------
// handle admin logins, boot the player if login fails.
function admin_login(%sender,%a2,%admin_type)
{
%pw = trim(firstWord(%a2));

If(%pw $= "PASSWORD")
{
%msg = "ADMIN LOGIN FAILED. YOU MUST SET YOUR OWN PASSWORD IN game/server/dash/prefs.cs!";
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
return;
}

If(%pw $= $pref::Server::AdminPassword)
{
if(%admin_type $= "admin")
%sender.isAdmin=1;
else if(%admin_type $= "stealth")
%sender.isStealthAdmin=1;
%a1 = "SERVER RESPONSE ";
%a2 = "SERVER RESPONSE: AUTHENTICATION SUCCESSFUL";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
}
else
if(%admin_type $= "Super")
%sender.isSuperAdmin=1;
%a1 = "SERVER RESPONSE ";
%a2 = "SERVER RESPONSE: AUTHENTICATION SUCCESSFUL,YOU ARE NOW A SUPER ADMIN";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
}
else
{
%a1 = "SERVER RESPONSE ";
%a2 = "SERVER RESPONSE: AUTHENTICATION FAILED";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
%name = %sender.nameBase;
%sender.delete( %name SPC $pref::Server::FailedAdminLogin);
schedule(1000,false,"centerprintall", %sender.nameBase SPC $pref::Server::FaliedAdminLogin ,4);
}
}

Am I on the right track?

Sunday, May 15, 2005 at 8:25:43 AM

You are, lots of bugs in there but you are
Oh then dont forget you need to make the commands check for the admin types, but thats included on my script :P


Sunday, May 15, 2005 at 10:15:19 AM

Yea I know that (basicially this)
if(!ClientIsAdmin(%sender,"/ki command failed you are not admin"))
return;

Would need to be this
if(!ClientIsSuperAdmin(%sender,"/ki command failed you are not Super admin"))
return;
Yea but im working on SERVER:RESPONCE first
thanks though

Sunday, May 15, 2005 at 1:14:14 PM

But HOW do I know if im getting close?

Friday, May 20, 2005 at 5:03:35 PM

Trial and error my friend... Trial and error XD

 

 

 

 

Friday, May 20, 2005 at 5:15:37 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald