//================= Hercules Plugin =================
//= @bcstaff
//==== Autor: =======================================
//= GallaZ
//==== Version: =====================================
//= 1.0
//===================================================
#include <stdio.h>
#include <string.h>
#include "../common/HPMi.h"
#include "../map/script.h"
#include "../map/pc.h"
#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)
HPExport struct hplugin_info pinfo = {
"bcstaff", // Plugin name
SERVER_TYPE_MAP,// Which server types this plugin works with?
"1.0", // Plugin version
HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
};
// @bcstaff <0-global 1-local> <message>
ACMD(bcstaff){
int type = 0;
char atcmd_output[256];
char smsg[256];
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(smsg, '\0', sizeof(smsg));
if(!message || !*message || (sscanf(message, "%u %199[^\n]",&type, atcmd_output) < 2) || type > 1 || type < 0) {
clif->message(fd, "@bcstaff <0-global 1-local> <message>");
return false;
}
switch(type) {
case 0:
sprintf(smsg, "[Staff]: %s", atcmd_output);
clif->broadcast2(&sd->bl, smsg, strlen(smsg) + 1, 0xCCFF00, 0x190, 12, 0, 0, (send_target)type);
break;
case 1:
sprintf(smsg, "[Staff]: %s", atcmd_output);
clif->broadcast2(&sd->bl, smsg, strlen(smsg) + 1, 0x00CCFF, 0x190, 12, 0, 0, (send_target)type);
break;;
default:
break;
}
return true;
}
HPExport void plugin_init (void) {
clif = GET_SYMBOL("clif");
addAtcommand("bcstaff",bcstaff);
}