Jump to content
  • 0
Sign in to follow this  
chojuro

Plugins error 1charpergm account

Question

1charpergm_0.2a.c: In function ‘plugin_init’:
1charpergm_0.2a.c:53:65: error: macro "addHookPre" passed 3 arguments, but takes just 2
  addHookPre( chr, make_new_char_sql, char_make_new_char_sql_pre );
                                                                 ^
1charpergm_0.2a.c:53:2: error: ‘addHookPre’ undeclared (first use in this function)
  addHookPre( chr, make_new_char_sql, char_make_new_char_sql_pre );
  ^
1charpergm_0.2a.c:53:2: note: each undeclared identifier is reported only once for each function it appears in
1charpergm_0.2a.c:54:65: error: macro "addHookPre" passed 3 arguments, but takes just 2
  addHookPre( chr, parse_char_select, char_parse_char_select_pre );
                                                                 ^
1charpergm_0.2a.c: At top level:
1charpergm_0.2a.c:31:12: warning: ‘char_make_new_char_sql_pre’ defined but not used [-Wunused-function]
 static int char_make_new_char_sql_pre( struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, int *starting_job, uint8 *sex) {
            ^
1charpergm_0.2a.c:40:13: warning: ‘char_parse_char_select_pre’ defined but not used [-Wunused-function]
 static void char_parse_char_select_pre( int *fd, struct char_session_data **sd, uint32 *ipl ) {
             ^
make[1]: *** [../../plugins/1charpergm_0.2a.so] Error 1
make[1]: Leaving directory `/root/hercules/src/plugins'
make: *** [plugin.1charpergm_0.2a] Error 2
//===== Hercules Plugin ======================================
//= 1charpergm
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 0.2a
//===== Compatible With: ===================================== 
//= Hercules 2019-02-16
//===== Description: =========================================
//= make each GM account can only have 1 character slot
//===== Topic ================================================
//= http://herc.ws/board/topic/11215-one-char-per-gm-account/?do=findComment&comment=90332
//===== Additional Comments: =================================  
//= simple trick, only allow them to create/login the character on slot 0
//============================================================

#include "common/hercules.h"
#include "char/char.h"
#include "common/nullpo.h"
#include "common/socket.h"
//#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"1charpergm",
	SERVER_TYPE_CHAR,
	"0.2a",
	HPM_VERSION,
};

static int char_make_new_char_sql_pre( struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, int *starting_job, uint8 *sex) {
	nullpo_retr(-2, *sd);
	if ( *slot != 0 && (*sd)->group_id > 10 ) {	// change 10 to minimum gm level
		hookStop();
		return -2;
	}
	return 0;
}

static void char_parse_char_select_pre( int *fd, struct char_session_data **sd, uint32 *ipl ) {
	int slot = RFIFOB(*fd, 2);
	if ( slot != 0 && (*sd)->group_id > 10 ) {
		RFIFOSKIP(*fd, 3);
		chr->creation_failed(*fd, -4);
		hookStop();
	}
	return;
}
int (*make_new_char_sql) (struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style);
void (*parse_char_select) (int fd, struct char_session_data* sd, uint32 ipl);

HPExport void plugin_init (void) {
	addHookPre( chr, make_new_char_sql, char_make_new_char_sql_pre );
	addHookPre( chr, parse_char_select, char_parse_char_select_pre );
}

 

this is the plugins i used any idea how to fixed this?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

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.