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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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