viewing paste topic/4595- whisp.c | C

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../map/pc.h"
#include "../map/clif.h"
#include "../common/HPMi.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 = {
    "whisp",        // Plugin name
    SERVER_TYPE_MAP,// Which server types this plugin works with?
    "0.1",          // Plugin version
    HPM_VERSION,    // HPM Version (don't change, macro is automatically updated)
};
 
int buildin_whisp_at(struct block_list *bl, va_list ap) {
    char *message = va_arg( ap, char* );
    clif->disp_overhead( bl, message );
    return true;
}
 
ACMD(whisp) {
    if ( !message || !*message )
        return false;
    map->foreachinrange( buildin_whisp_at, &sd->bl, 2, BL_PC, message );
    return true;
}
 
HPExport void plugin_init (void) {
    atcommand = GET_SYMBOL("atcommand");
    clif = GET_SYMBOL("clif");
    map = GET_SYMBOL("map");
    addAtcommand("whisp",whisp);
}
Viewed 1385 times, submitted by AnnieRuru.