Easycore 31 Posted October 27, 2015 (edited) Hi Hercules, Is there any way to disable disguise when character is die? Regards ~ Edited October 27, 2015 by Easycore Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted October 27, 2015 pj? Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted October 27, 2015 pj? Character* I forgot that "pj" is character in spanish Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 28, 2015 (edited) 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 October 28, 2015 by AnnieRuru 1 Easycore reacted to this Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted October 29, 2015 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. Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 30, 2015 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 Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted November 2, 2015 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? Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 16, 2015 @@Easycore curious, maybe you didn't enable "HPMHooking" in confplugin.conf ? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 16, 2015 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 checksOn 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 16, 2015 On pc_dead, add a null check.example ? o.o Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 16, 2015 if (sd == NULL) return 0; OR nullpo_retr(0,sd); 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 16, 2015 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 );} Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted November 16, 2015 Oh sorry, I already had solved this. Indeed, the problem was old version. @@AnnieRuru A part of the plugin I sent you (@pk) ,I took it out based on this topic Quote Share this post Link to post Share on other sites
Hi Hercules,
Is there any way to disable disguise when character is die?
Regards ~
Edited by EasycoreShare this post
Link to post
Share on other sites