/* $ID plugin_signature.sma by HeyHeyHey (Sharpsniper) */
 
/* This is a fairly simple plugin but i havent written a plugin in months so i basicly have to restart. But anyway this plugin
 * Will let admins with 64 Access Level use Typesay, Centersay, Say commands and attach there name to. */
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
// Access Level to use command
#define ACCESS_SIG 64
 
// Version the plugin is made for
new StringVersion[MAX_DATA_LENGTH] = "2.50.50";
 
public admin_sig(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Message[MAX_DATA_LENGTH];
	new Style[MAX_DATA_LENGTH];
 
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	strbreak(Data,Style,Message,MAX_DATA_LENGTH);
	if (streq(Style,"csay")==1) {
		snprintf(Message, MAX_DATA_LENGTH, "%s - %s", User, Data);
		centersay(Message, 10, 10, 250, 10);
	} else if ( streq(Style, "tsay")==1) {
		snprintf(Message, MAX_DATA_LENGTH, "%s - %s", User, Data);
		typesay(Message,10,10,250,10);
	} else if ( streq(Style, "say")==1) {
		snprintf(Message, MAX_DATA_LENGTH, "%s - %s", User, Data);
		say(Message);
	} else {
		strstripquotes(Data);
		centersay(Data,10,15,250,10);
	}
	log_command(User,Command,Data);
	return PLUGIN_HANDLED;
}
 
public plugin_init() {
	plugin_registerinfo("Signature Attachment v1.0","Attaches Names to 3 types of say.",StringVersion);
 
	plugin_registercmd("admin_sig","admin_sig",ACCESS_SIG,"admin_sig <style> <message> - Displays a Say Command with the users name attached to it.");
	return PLUGIN_CONTINUE;
}