Jump to content
  • 0
Sign in to follow this  
Total

Join or Create guild restrictions.

Question

Hello,


 


I want to make it so any account that has group_id = 1 not able to join or create a guild.


 


Is there a setting already available for this? if not how can i make this happen?


 


Your help is much appreciated.


Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

In clif.c

Find:

void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
{
	char name[NAME_LENGTH];
	safestrncpy(name, RFIFOP(fd,6), NAME_LENGTH);

	if(map->list[sd->bl.m].flag.guildlock) {
		clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
		return;
	}

	guild->create(sd, name);
}

And replace for:

 

void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
{
	char name[NAME_LENGTH];
	safestrncpy(name, RFIFOP(fd,6), NAME_LENGTH);

	if(sd->group_id == 1){
		clif->message(fd, "You cannot create a Guild.");
		return;
	}
	if(map->list[sd->bl.m].flag.guildlock) {
		clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
		return;
	}

	guild->create(sd, name);
}

Share this post


Link to post
Share on other sites
  • 0

Thank you, works perfect.

 

How about the joining guilds? can i make it so players cannot invite group_id = 1 players to their guild?

Inc clif.c

Find:

 

bool clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_session_data *t_sd) {
	if ( t_sd == NULL )// not online or does not exist
		return false;

	nullpo_retr(false, sd);
	nullpo_retr(false, t_sd);
	if ( map->list[sd->bl.m].flag.guildlock ) {
		clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
		return false;
	}

	if (t_sd->state.noask) {// @noask [LuzZza]
		clif->noask_sub(sd, t_sd, 2);
		return false;
	}

	guild->invite(sd,t_sd);
	return true;
}

Replace for:

 

bool clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_session_data *t_sd) {
	if ( t_sd == NULL )// not online or does not exist
		return false;

	nullpo_retr(false, sd);
	nullpo_retr(false, t_sd);
	if ( map->list[sd->bl.m].flag.guildlock ) {
		clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
		return false;
	}
        if(sd->group_id == 1){
            clif->message(fd, "You cannot create a Guild.");
            return false;
}
	if (t_sd->state.noask) {// @noask [LuzZza]
		clif->noask_sub(sd, t_sd, 2);
		return false;
	}

	guild->invite(sd,t_sd);
	return true;
}
Edited by Easycore

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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