#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
#define TSAY_LENGTH 79
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.2";
 
public admin_chat(HLCommand,HLData,HLUserName,UserIndex) {
	new i;
	new maxplayers = maxplayercount();
	new Data[MAX_DATA_LENGTH];
	new Name[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new User[MAX_NAME_LENGTH];
 
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	snprintf(Text, MAX_TEXT_LENGTH, "(Admin) %s: %s", User, Data);
	for(i=1; i<=maxplayers; i++) {
		strinit(Name);
		if(playerinfo(i,Name,MAX_NAME_LENGTH)==1) {
			if(access(ACCESS_CHAT,Name)!=0) {
				messageex(Name, Text, print_chat);
			}
		}
	}
	log(Text);
	return PLUGIN_HANDLED;
}
 
public plugin_init() {
	plugin_registerinfo("Admin Base Plugin","Basic Admin Mod commands.",STRING_VERSION);
 
	plugin_registercmd("admin_chat","admin_chat",ACCESS_CHAT,"admin_chat <msg>: Shows message only to other admins.");
	plugin_registercmd("admin_page","admin_chat",ACCESS_ALL,"admin_page <msg>: Shows message only to the admins.");
 
	return PLUGIN_CONTINUE;
}