
 ======================================================
 Reborn 1.12 PATCH; | ADMIN EXTRA-VARS FUNCTIONALITY |
 ======================================================
 by Sor (& my thanks to Razo[R]apid!)
 =----------------------------------------------------=
 .PK3 Version: v1.0
 Patch Version: RC3.105+ REQUIRED
 -----------------------------------
 ------------------- 
 --- COPY/EDIT:
 A) All files related to this modification for MoHAA RC3.105 
 are free to be modified in any proportion and for any reason.
 
 B) Keep this header in this file in any case. However, you may
 add your own nickname/contact information underneath to it.

 C) If you changed the files in any way, please state so clearly
 when submitting the modified software for public download.

 Feel free to ask me any help regarding problems/bugs when 
 playing this Mod or regarding the modification of this Mod.

 ------------------- 
 GIVE CREDIT WHERE CREDIT IS DUE; FIRSTLY BY KEEPING THIS
 HEADER AND SECONDLY BY CREDITTING Sor OR $oldier of Ra WHEN 
 SUBMITTING THE ORIGINAL OR MODIFIED SOFTWARE FOR DOWNLOAD.
 FURTHERMORE, YOU MAY CREDIT YOURSELF FOR YOUR OWN MODIFICATIONS.
 ---------------------------------------------
 --- CONTACT:
 Webs: 	www.x-null.net | www.mohaairborne.co.cc
 ======================================================


//////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////// F E A T U R E S ///////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////

If client logs in as ClientAdmin, his player entity will be tagged with the following variable:
.isAdmin
	NIL => no admin
	1 => authorized and recognized as admin

.adminLogin
	NIL => error (check console)
	"" => no login data has been found for detected admin (check console)
	string => name that client used to log in the clientAdmin system

.adminRights
	NIL => error (check console)
	0 => no rights found for specified ClientAdmin? (check console)
	int => numeric rights of the specified ClientAdmin 

.adminAccess = array (of the ClientAdmin's ACCESSLEVELS)
	NIL => error
	size 1 array => ACCESSLEVEL_MAX rights for the specified ClientAdmin
	size X array => slot 1 to slot X will sum up the calculated ACCESSLEVEL_ rights for the specified ClientAdmin





//////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// U S E ////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////

INSTALLATION REQUIREMENTS:

	Reborn 1.12 Patch Release Candidate 3.105 or higher.
	MoHAA server

INSTALLATION:

	1. place the .pk3 file in the main/ directory.
	2. add/combine the supplied DMprecache script with yours;

		exec global/adminMain.scr

	3. add/combine the connected event (global/events/connected.scr) with yours, only 3 lines need to be copied/added:

		if (level.adminFunctions) {
			thread global/adminMain.scr::newPlayer local.player
		}

	4. use described vars above in your scripts!
	5. advanced users may just use the adminFunc.scr script or functions for their mods.





//////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// N O T E S //////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////

Prefab for parsing the .adminAccess player variable:

	if (<player>.adminAccess) {
		// absolute MAX, more than all available ACCESSLEVELS added together.
		if (<player>.adminAccess.size == 1) {
			// do stuff
		} else {
			local.start = 1 // start at 0 if you want to include "ACCESSLEVEL_LOGIN", else use 1
			for (local.i = local.start; local.i <= (<player>.adminAccess.size - local.start); local.i++) {
				// do stuff
			}
		}
	}


IF one of the following situations apply to you:

 'Help! Console is displaying errors when trying to access the new vars, and player entity .isAdmin == 1??'
 'Help! Console displayed the following error: 
	~^~^~^~ ERROR|ADMIN_MAINFUNC[adminMain.scr]: Admin login detected, but no data has been found by function 'findLastAdminData' using searchrange: 1024! Could it be RCON login? ~^~^~^~
 but the admin logged in via ClientAdmin??'


THEN you might want to:
	1. open the .PK3 file and open global/adminMain.scr
	2. find ' level.QCLog_searchrange ' and
	3. read the comment above this line very carefully!




