Jump to content
  • 0
Legend

@storeitem error

Question

Im having trouble while compiling @storeitem plugin by Ind,

this is what i got:
 

1>------ Build started: Project: @storeitem, Configuration: Release Win32 ------1>  @storeitem.c1>[email protected](39): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(325) : see declaration of 'sscanf'1>[email protected](46): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(371) : see declaration of 'sprintf'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](79): error C2065: 'mob' : undeclared identifier1>[email protected](79): error C2223: left of '->db' must point to struct/union1>[email protected](114): warning C4013: 'ACMD_A' undefined; assuming extern returning int1>[email protected](114): error C2065: 'storeitem' : undeclared identifier1>[email protected](114): warning C4047: 'function' : 'bool (__cdecl *)(const int,map_session_data *,const char *,const char *,AtCommandInfo *)' differs in levels of indirection from 'int'1>[email protected](114): warning C4024: 'function through pointer' : different types for formal and actual parameter 2========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

 

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Im having trouble while compiling @storeitem plugin by Ind,

this is what i got:

 

 

1>------ Build started: Project: @storeitem, Configuration: Release Win32 ------1>  @storeitem.c1>[email protected](39): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(325) : see declaration of 'sscanf'1>[email protected](46): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(371) : see declaration of 'sprintf'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](79): error C2065: 'mob' : undeclared identifier1>[email protected](79): error C2223: left of '->db' must point to struct/union1>[email protected](114): warning C4013: 'ACMD_A' undefined; assuming extern returning int1>[email protected](114): error C2065: 'storeitem' : undeclared identifier1>[email protected](114): warning C4047: 'function' : 'bool (__cdecl *)(const int,map_session_data *,const char *,const char *,AtCommandInfo *)' differs in levels of indirection from 'int'1>[email protected](114): warning C4024: 'function through pointer' : different types for formal and actual parameter 2========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Its not updated since a year maybe :P

Share this post


Link to post
Share on other sites
  • 0

 

Im having trouble while compiling @storeitem plugin by Ind,

this is what i got:

 

1>------ Build started: Project: @storeitem, Configuration: Release Win32 ------1>  @storeitem.c1>[email protected](39): warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(325) : see declaration of 'sscanf'1>[email protected](46): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>          C:Program Files (x86)Microsoft Visual Studio 10.0VCincludestdio.h(371) : see declaration of 'sprintf'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](74): error C2039: 'get_group_level' : is not a member of 'pc_interface'1>          d:[aaa] ragnarok server projectsvn trunktrunksrcplugins../map/pc.h(736) : see declaration of 'pc_interface'1>[email protected](79): error C2065: 'mob' : undeclared identifier1>[email protected](79): error C2223: left of '->db' must point to struct/union1>[email protected](114): warning C4013: 'ACMD_A' undefined; assuming extern returning int1>[email protected](114): error C2065: 'storeitem' : undeclared identifier1>[email protected](114): warning C4047: 'function' : 'bool (__cdecl *)(const int,map_session_data *,const char *,const char *,AtCommandInfo *)' differs in levels of indirection from 'int'1>[email protected](114): warning C4024: 'function through pointer' : different types for formal and actual parameter 2========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Its not updated since a year maybe :P

 

The plugin is already working (credits to ind & Angelmelody) , just one more question... How can i store item even if the character/account is not online?

Here's the full code:

 

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <string.h>#include <stdlib.h>#include "../common/HPMi.h"#include "../map/atcommand.h"#include "../map/clif.h"#include "../map/itemdb.h"#include "../map/intif.h"#include "../map/mob.h"#include "../map/status.h"#include "../map/unit.h"#include "../map/pet.h"#include "../map/pc.h"#include "../map/storage.h"#include "../common/HPMDataCheck.h"/* Designed by Beowulf/Nightroad, HPM port by [Ind/Hercules] */HPExport struct hplugin_info pinfo = {	"@storeitem",	// 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)};ACMD(storeitem) {	struct map_session_data *pl_sd;	struct item item_tmp;	struct item_data *item_data;	char item_name[ITEM_NAME_LENGTH];	char character[NAME_LENGTH];	int number = 0, item_id;	int get_count, i, pet_id, ref = 0;	memset(item_name, '0', sizeof(item_name));	if (!message || !*message || sscanf(message, "%49s %d %d %23[^n]", item_name, &number, &ref, character) < 4) {		clif->message(fd, "(usage: @storeitem <item name or ID> <quantity> <refine> <char name>).");		return false;	}	if( ref < 0 || ref > MAX_REFINE ) {		char output_p[124];		sprintf(output_p,"<refine> %d is out of bounds, limit is 0~%d. @storeitem failed.",ref,MAX_REFINE);		clif->message(fd,output_p);		return false;	}	if (number <= 0)		number = 1;	item_id = 0;	if ((item_data = itemdb->search_name(item_name)) != NULL || (item_data = itemdb->exists(atoi(item_name))) != NULL)			item_id = item_data->nameid;	else {		clif->message(fd, atcommand->msg_table[19]); // Invalid item ID or name.		return false;	}	/* only weapon (4) and armors (5) can refine, refineable item db field also applies */	if( ( item_data->type != 4 && item_data->type != 5 ) || item_data->flag.no_refine )			ref = 0;	get_count = number;		if (!itemdb->isstackable2(item_data)) { 		get_count = 1;	}	pet_id = pet->search_petDB_index(item_id, PET_EGG);	if (item_data->type == 4 || item_data->type == 5 || item_data->type == 7 || item_data->type == 8) {		get_count = 1;	}		if ((pl_sd = map->nick2sd(character)) != NULL) {		if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can add items only to groups of equal or lower level			for (i = 0; i < number; i += get_count) {					if (pet_id >= 0) {						pl_sd->catch_target_class = pet->db[pet_id].class_;						intif->create_pet(pl_sd->status.account_id, pl_sd->status.char_id,									(short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv,									(short)pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate,									100, 0, 1, pet->db[pet_id].jname);					} else {						memset(&item_tmp, 0, sizeof(item_tmp));						item_tmp.nameid = item_id;						item_tmp.identify = 1;						item_tmp.refine = ref;						storage->open(pl_sd);/* without open/close procedure the client requires you to relog to access storage properly */						storage->additem(pl_sd, &item_tmp, get_count);						storage->close(pl_sd);					}				}			clif->message(fd, atcommand->msg_table[18]); // Item created.		} else {			clif->message(fd, atcommand->msg_table[81]); // Your GM level don't authorise you to do this action on this player.			return false;		}	} else {		clif->message(fd, atcommand->msg_table[3]); // Character not found.		return false;	}		return true;}HPExport void plugin_init (void) {	atcommand = GET_SYMBOL("atcommand");	storage = GET_SYMBOL("storage");	clif = GET_SYMBOL("clif");	pc = GET_SYMBOL("pc");	map = GET_SYMBOL("map");	itemdb = GET_SYMBOL("itemdb");	intif = GET_SYMBOL("intif");	pet = GET_SYMBOL("pet");	addAtcommand("storeitem", storeitem);}

Share this post


Link to post
Share on other sites

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...

×
×
  • Create New...

Important Information

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