Jump to content
  • 0
Sign in to follow this  
Angelmelody

How to overload npc_event_doall_sub

Question

#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/nullpo.h"#include "../map/npc.h"#include "../map/pc.h"#include "../map/script.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 = {	"temp",			// 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)};void npc_event_doall_sub(void *key, void *data, va_list ap){	struct event_data* ev = data;	int* c;	const char* name;	int rid;	nullpo_retv(c = va_arg(ap, int*));	nullpo_retv(name = va_arg(ap, const char*));	rid = va_arg(ap, int);	if (ev ) // Do not run on duplicates. [Paradox924X]  && !ev->nd->src_id 	{		if(rid && !strstr(name,"OnMyEvent")) { // a player may only have 1 script running at the same time			char buf[EVENT_NAME_LENGTH];			snprintf(buf, ARRAYLENGTH(buf), "%s::%s", ev->nd->exname, name);			npc->event_sub(map->id2sd(rid), ev, buf);		}		else {			script->run(ev->nd->u.scr.script, ev->pos, rid, ev->nd->bl.id);		}		(*c)++;	}}HPExport void plugin_init (void){	npc = GET_SYMBOL("npc");	script = GET_SYMBOL("script");	status = GET_SYMBOL("status");	npc->event_doall_sub = npc_event_doall_sub;}

I want to overload  npc_event_doall_sub function  but got  failed compiling ,Who can help me ?

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.