if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
clif->message(fd, msg_fd(fd,250)); // You have already opened your storage. Close it first.
return false;
}
if (sd->state.storage_flag == STORAGE_FLAG_GUILD) {
clif->message(fd, msg_fd(fd,251)); // You have already opened your guild storage. Close it first.
return false;
}
if (!pc_has_permission(sd, PC_PERM_BYPASS_NOSTORAGE) && (map->list[sd->bl.m].flag.nogstorage & 1)) { // mapflag nogstorage already defined? can't open :c
clif->message(fd, msg_fd(fd, 1161)); // You currently cannot open your storage. (there is no other messages...)
return false;
}
if ((i = guild->getposition(g, sd)) < 0 || !(g->position.mode & GPERM_STORAGE)) { clif->message(fd, msg_fd(fd, 1202)); // You do not have permission to use the guild storage. return false; }
if( gstorage->open(sd) ) { clif->message(fd, msg_fd(fd,1201)); // Your guild's storage has already been opened by another member, try again later. return false; }
Hi Guys,
I added the code in red text. everything is working well.
Updated. currently working on mine. please give a try and tell me if somethings wrong.
Database:
you need to change your datatype of mode to smallint in in your guild_position table
message.conf
//1202 FREE - You do not have permission to use the guild storage.
1202: You do not have permission to use the guild storage.
mmo.h
enum guild_permission { // Guild permissions
GPERM_INVITE = 0x01,
GPERM_EXPEL = 0x10,
GPERM_STORAGE = 0x100,
GPERM_ALL = GPERM_INVITE | GPERM_EXPEL | GPERM_STORAGE,
GPERM_MASK = GPERM_ALL,
};
storage.h
* Acceptable values for map_session_data.state.storage_flag
*/
enum storage_flag {
STORAGE_FLAG_CLOSED = 0, // Closed
STORAGE_FLAG_NORMAL = 1, // Normal Storage open
STORAGE_FLAG_GUILD = 2, // Guild Storage open
STORAGE_FLAG_NOPERMISSION = 3, //Gstorage no permission
atcommand.c
ACMD(guildstorage)
{
int i;
struct guild* g;
g = sd->guild;
if (!sd->status.guild_id) {
clif->message(fd, msg_fd(fd,252)); // You are not in a guild.
return false;
}
if (sd->npc_id || sd->state.vending || sd->state.prevend || sd->state.buyingstore || sd->state.trading)
return false;
if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
clif->message(fd, msg_fd(fd,250)); // You have already opened your storage. Close it first.
return false;
}
if (sd->state.storage_flag == STORAGE_FLAG_GUILD) {
clif->message(fd, msg_fd(fd,251)); // You have already opened your guild storage. Close it first.
return false;
}
if (!pc_has_permission(sd, PC_PERM_BYPASS_NOSTORAGE) && (map->list[sd->bl.m].flag.nogstorage & 1)) { // mapflag nogstorage already defined? can't open :c
clif->message(fd, msg_fd(fd, 1161)); // You currently cannot open your storage. (there is no other messages...)
return false;
}
if ((i = guild->getposition(g, sd)) < 0 || !(g->position.mode & GPERM_STORAGE)) {
clif->message(fd, msg_fd(fd, 1202)); // You do not have permission to use the guild storage.
return false;
}
if( gstorage->open(sd) ) {
clif->message(fd, msg_fd(fd,1201)); // Your guild's storage has already been opened by another member, try again later.
return false;
}
clif->message(fd, msg_fd(fd,920)); // Guild storage opened.
return true;
}
update details
Share this post
Link to post
Share on other sites