1 /* ======== Basic Admin tool ========
2 * Copyright (C) 2004-2006 Erling K. S�terdal
3 * No warranties of any kind
7 * Author(s): Erling K. S�terdal ( EKS )
9 * Menu code based on code from CSDM ( http://www.tcwonline.org/~dvander/cssdm ) Created by BAILOPAN
10 * Helping on misc errors/functions: BAILOPAN,LDuke,sslice,devicenull,PMOnoTo,cybermind ( most who idle in #sourcemod on GameSurge realy )
11 * ============================ */
13 #ifndef _INCLUDE_BATINTERFACE
14 #define _INCLUDE_BATINTERFACE
15 #include <ISmmPlugin.h>
17 #define ADMININTERFACE_VERSION 0
18 #define ADMININTERFACE_MAXACCESSLENGTHTEXT 50 // This is the maximum length of a "flag" access text.
20 //#include "BATMenu.h"
22 //extern menuId g_AdminMenu;
23 class AdminInterfaceListner
26 virtual void OnAdminInterfaceUnload()=0;
27 virtual void Client_Authorized(int id)=0;
33 virtual bool RegisterFlag(const char *Class,const char *Flag,const char *Description) = 0; // Registers a new admin access
34 virtual bool IsClient(int id) = 0; // returns false if client is bot, or NOT connected
35 virtual bool HasFlag(int id,const char *Flag) = 0; // returns true if the player has this access flag, lower case only
36 virtual int GetInterfaceVersion() = 0 ; // Returns the interface version of the admin mod
37 virtual const char* GetModName() = 0; // Returns the name of the current admin mod
38 virtual void AddEventListner(AdminInterfaceListner *ptr) = 0; // You should ALLWAYS set this, so you know when the "server" plugin gets unloaded
39 virtual void RemoveListner(AdminInterfaceListner *ptr) = 0; // You MUST CALL this function in your plugin unloads function, or the admin plugin will crash on next client connect.
42 class BATAdminInterface : public AdminInterface
45 bool RegisterFlag(const char *Class,const char *Flag,const char *Description); // Max 1 admin access at the time, returns true if done successfully
46 bool IsClient(int id); // returns false if client is bot, or NOT connected
47 bool HasFlag(int id,const char *Flag); // returns true if the player has this access flag
48 int GetInterfaceVersion() { return ADMININTERFACE_VERSION; } // Returns the interface version of the admin mod
49 const char* GetModName() { return "BAT"; } // Returns the name of the current admin mod
50 void AddEventListner(AdminInterfaceListner *ptr); // You should ALLWAYS set this, so you know when the "server" plugin gets unloaded
51 void RemoveListner(AdminInterfaceListner *ptr);
53 char GetFlagFromInt(int CharIndex);
54 bool CustomAccessExistence(const char *Flag);
56 class MyListener : public IMetamodListener
59 virtual void *OnMetamodQuery(const char *iface, int *ret);