Jump to content
  • 0

Npc register guild and allow guild member access to map


MyNoobScriptz

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

Hi rathena i need npc register guild and guild member can access to map

thx

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

8 hours ago, MyNoobScriptz said:

thank you!!

but possible to change gm control and put name of guild member to register

please

yuno,165,80,3	script	Entrance Guard#guild	4_M_UNCLEKNIGHT,{
	if (getgroupid() >= 90)
		callsub S_Control;
	mes "[" + strnpcinfo(1) + "]";
	mes "I can take you to the area if you're in a registered guild.";
	next;
	switch(select("Enter area", "Finish conversation")) {
	case 1:
		if (!getcharid(2)) {
			mes "[" + strnpcinfo(1) + "]";
			mes "You are not in a guild.";
			close;
		}
		if (inarray($registered_guilds, getcharid(2)) < 0) {
			mes "[" + strnpcinfo(1) + "]";
			mes "Your guild did not register.";
			close;
		}
		mes "[" + strnpcinfo(1) + "]";
		mes "You're with the ^895818" + strcharinfo(2) + "^000000, correct?";
		mes "I will send you there.";
		close2;
		warp "que_qsch05",346,32;
		end;

	case 2:
		mes "[" + strnpcinfo(1) + "]";
		mes F_Bye;
		close;
	}

S_Control:
	if(select("Default NPC", "^0000FFGM Control^000000") == 1)
		return;
	switch(select("Register guild", "Remove all guilds", "Cancel")) {
	case 1:
		switch(select("Enter guild member name", "Enter guild name")) {
			case 1:
				input .@playername$;
				query_sql "SELECT `name`,`guild_id` FROM `char` WHERE `name` like '%"+.@playername$+"%'",.@p_name$,.@GID;
				query_sql "SELECT `name`,`guild_lv` FROM `guild` WHERE `guild_id` = "+.@GID,.@NAME$,.@GLVL; 
				if (getarraysize(.@p_name$) > 1) {
					mes "[" + strnpcinfo(1) + "]";
					mes "More than one player with this name was found.";
					mes "Type again. Be more specific, please!";
					close;
				}
				if (.@p_name$ == "") {
					mes "[" + strnpcinfo(1) + "]";
					mes "I didn't find anything. Check for typos. You don't need to input the whole name.";
					close;
				}
				if (!.@GID) {
					mes "[" + strnpcinfo(1) + "]";
					mes "" + .@p_name$ + " does not have a guild.";
					close;
				}
				break;

			case 2:
				input .@guildname$;
				query_sql "SELECT `guild_id`,`name`,`guild_lv` FROM `guild` WHERE `name` like '%"+.@guildname$+"%'",.@GID,.@NAME$,.@GLVL;
				if (getarraysize(.@GID) > 1) {
					mes "[" + strnpcinfo(1) + "]";
					mes "More than one guild with this name was found.";
					mes "Type again. Be more specific, please!";
					close;
				}
				if (!.@GID) {
					mes "[" + strnpcinfo(1) + "]";
					mes "I didn't find anything. Check for typos. You don't need to input the whole name.";
					close;
				}
				break;
		}
		
		getguildmember .@GID, 1;
		getguildmember .@GID, 2;
		.@QTM = $@guildmembercount;
		for(.@i=0; .@i < $@guildmembercount; .@i++)
			if (isloggedin($@guildmemberaid[.@i],$@guildmembercid[.@i]))
				.@online++;
		mes "[" + strnpcinfo(1) + "]";
		if (.@p_name$ != "" && .@p_name$ != getguildmaster(.@GID))
			mes "" + .@p_name$ + "'s guild";
		mes "Name: ^0000FF" + .@NAME$ + "^000000 (Lv " + .@GLVL + ")";
		mes "Master: " + getguildmaster(.@GID);
		mes "Members: "+.@QTM+" / Online: "+.@online;
		mes " ";
		if (inarray($registered_guilds, .@GID) >= 0) {
			mes "Guild registered already.";
			close;
		}
		mes "Are you sure you want to register this guild?";
		next;
		if(select("No", "Yes, register guild") == 1)
			close;
		.@i = getarraysize($registered_guilds);
		setarray $registered_guilds[.@i], .@GID;
		mes "[" + strnpcinfo(1) + "]";
		mes "Guild ^895818" + getguildname(.@GID) + "^000000 registered!";
		mes "Guild members can now enter.";
		close;
	case 2:
		mes "[" + strnpcinfo(1) + "]";
		mes "Are you sure you want to remove all registered guilds?";
		mes "^FF0000THIS CANNOT BE UNDONE.^000000";
		next;
		if(select("On second thought, no.", "I'm aware, go on.") == 1)
			close;
		deletearray $registered_guilds, getarraysize($registered_guilds);
		mes "[" + strnpcinfo(1) + "]";
		mes "Done.";
		close;
	case 3:
		end;
	}	
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi

yuno,165,80,3	script	Entrance Guard#guild	4_M_UNCLEKNIGHT,{
	mes "[" + strnpcinfo(1) + "]";
	mes "What do you want?";
	next;
	switch(select("Register guild", "Enter area", "Finish conversation")) {
	case 1:
		if (!getcharid(2)) {
			mes "[" + strnpcinfo(1) + "]";
			mes "You are not in a guild.";
			close;
		}
		if (inarray($registered_guilds, getcharid(2)) >= 0) {
			mes "[" + strnpcinfo(1) + "]";
			mes "Your guild registered already.";
			close;
		}
		.@i = getarraysize($registered_guilds);
		setarray $registered_guilds[.@i], getcharid(2);
		mes "[" + strnpcinfo(1) + "]";
		mes "Guild " + strcharinfo(2) + " registered!";
		mes "Guild members can now enter.";
		close;

	case 2:
		if (inarray($registered_guilds, getcharid(2)) < 0) {
			mes "[" + strnpcinfo(1) + "]";
			mes "Your guild did not register.";
			close;
		}
		mes "[" + strnpcinfo(1) + "]";
		mes "You're with the guild " + strcharinfo(2) + ", correct?";
		mes "I will send you there.";
		close2;
		warp "que_qsch05",346,32;
		end;

	case 3:
		mes "[" + strnpcinfo(1) + "]";
		mes F_Bye;
		close;
	}		
}

 

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

6 hours ago, Racaae said:

Hi

yuno,165,80,3	script	Entrance Guard#guild	4_M_UNCLEKNIGHT,{
	mes "[" + strnpcinfo(1) + "]";
	mes "What do you want?";
	next;
	switch(select("Register guild", "Enter area", "Finish conversation")) {
	case 1:
		if (!getcharid(2)) {
			mes "[" + strnpcinfo(1) + "]";
			mes "You are not in a guild.";
			close;
		}
		if (inarray($registered_guilds, getcharid(2)) >= 0) {
			mes "[" + strnpcinfo(1) + "]";
			mes "Your guild registered already.";
			close;
		}
		.@i = getarraysize($registered_guilds);
		setarray $registered_guilds[.@i], getcharid(2);
		mes "[" + strnpcinfo(1) + "]";
		mes "Guild " + strcharinfo(2) + " registered!";
		mes "Guild members can now enter.";
		close;

	case 2:
		if (inarray($registered_guilds, getcharid(2)) < 0) {
			mes "[" + strnpcinfo(1) + "]";
			mes "Your guild did not register.";
			close;
		}
		mes "[" + strnpcinfo(1) + "]";
		mes "You're with the guild " + strcharinfo(2) + ", correct?";
		mes "I will send you there.";
		close2;
		warp "que_qsch05",346,32;
		end;

	case 3:
		mes "[" + strnpcinfo(1) + "]";
		mes F_Bye;
		close;
	}		
}

 

thank you!!

but possible to change gm control and put name of guild member to register

please

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...