Jump to content
  • 0
Easycore

Undisguise when player die

Question

12 answers to this question

Recommended Posts

  • 0

hmm ...

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"deadnodisguise", // 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 pc_disguise_pre( struct map_session_data *sd, int class_ ) { // disable player from disguise	if ( pc_isdead(sd) )		hookStop();	return 0;}int pc_dead_pre( struct map_session_data *sd, struct block_list *src ) { // undisguise when player die	if ( sd->disguise != -1 )		pc->disguise(sd, -1);	return 0;}HPExport void plugin_init (void) {	addHookPre( "pc->disguise", pc_disguise_pre );	addHookPre( "pc->dead", pc_dead_pre );}
sry that I no longer writing source, only plugins

 

EDIT: sry there are 2 checks

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

 

hmm ...

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"deadnodisguise", // 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 pc_disguise_pre( struct map_session_data *sd, int class_ ) { // disable player from disguise	if ( pc_isdead(sd) )		hookStop();	return 0;}int pc_dead_pre( struct map_session_data *sd, struct block_list *src ) { // undisguise when player die	if ( sd->disguise != -1 )		pc->disguise(sd, -1);	return 0;}HPExport void plugin_init (void) {	addHookPre( "pc->disguise", pc_disguise_pre );	addHookPre( "pc->dead", pc_dead_pre );}
sry that I no longer writing source, only plugins

 

EDIT: sry there are 2 checks

Thank you for help me. I'll try this at night ~

 

@@AnnieRuru Your plugin doesn't work me. The map-server is crash.

But don't worry, I'll use OnPCDieEvent for this.

Share this post


Link to post
Share on other sites
  • 0

OnPCDieEvent can only undisguise player when died, but still allow GMs to @disguise when died

that's why I did a plugin

 

just test again, it actually works

maybe your hercules still use the old plugin format that still needs GET_SYMBOL stuff

Share this post


Link to post
Share on other sites
  • 0

OnPCDieEvent can only undisguise player when died, but still allow GMs to @disguise when died

that's why I did a plugin

 

just test again, it actually works

maybe your hercules still use the old plugin format that still needs GET_SYMBOL stuff

How can check this?

Share this post


Link to post
Share on other sites
  • 0

hmm ...

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"deadnodisguise", // 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 pc_disguise_pre( struct map_session_data *sd, int class_ ) { // disable player from disguise	if ( pc_isdead(sd) )		hookStop();	return 0;}int pc_dead_pre( struct map_session_data *sd, struct block_list *src ) { // undisguise when player die	if ( sd->disguise != -1 )		pc->disguise(sd, -1);	return 0;}HPExport void plugin_init (void) {	addHookPre( "pc->disguise", pc_disguise_pre );	addHookPre( "pc->dead", pc_dead_pre );}
sry that I no longer writing source, only pluginsEDIT: sry there are 2 checks
On pc_dead, add a null check.

 

 

Probably thats why its a crash, if Easycore was using old version, he probably wouldnt be able to compile plugin, sincw hercules.h was added with the removal of GET_SYMBOL

Share this post


Link to post
Share on other sites
  • 0

now that make some sense

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"deadnodisguise", // Plugin name	SERVER_TYPE_MAP,// Which server types this plugin works with?	"0.2",			// Plugin version	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)};int pc_disguise_pre( struct map_session_data *sd, int class_ ) { // disable player from disguise	nullpo_retr( 0, sd ); 	if ( pc_isdead(sd) )		hookStop();	return 0;}int pc_dead_pre( struct map_session_data *sd, struct block_list *src ) { // undisguise when player die	nullpo_retr( 0, sd ); 	if ( sd->disguise != -1 )		pc->disguise(sd, -1);	return 0;}HPExport void plugin_init (void) {	addHookPre( "pc->disguise", pc_disguise_pre );	addHookPre( "pc->dead", pc_dead_pre );}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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