Jump to content
  • 0

Online Guild Member


cahadeyelo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

Can i request a script that restricting them to go inside the castle if the online guild members are below 7.

-	script	woe_restriction	-1,{

OnPCLoadMapEvent:
	query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv;
	if( getmapflag(strcharinfo(3),mf_gvg_castle)){ if((BaseLevel < 175) || (getcharid(2) == 0) || (.@guild_lv < 43) ) { warp "prontera",155,182; dispbottom "[ Server ]: You doesn't have a guild or you don't have enough Base Level."; } }
	end;
}
aldeg_cas01	mapflag	loadevent
aldeg_cas02	mapflag	loadevent
aldeg_cas03	mapflag	loadevent
aldeg_cas04	mapflag	loadevent
aldeg_cas05	mapflag	loadevent
gefg_cas01	mapflag	loadevent
gefg_cas02	mapflag	loadevent
gefg_cas03	mapflag	loadevent
gefg_cas04	mapflag	loadevent
gefg_cas05	mapflag	loadevent
payg_cas01	mapflag	loadevent
payg_cas02	mapflag	loadevent
payg_cas03	mapflag	loadevent
payg_cas04	mapflag	loadevent
payg_cas05	mapflag	loadevent
prtg_cas01	mapflag	loadevent
prtg_cas02	mapflag	loadevent
prtg_cas03	mapflag	loadevent
prtg_cas04	mapflag	loadevent
prtg_cas05	mapflag	loadevent
schg_cas01	mapflag	loadevent
schg_cas02	mapflag	loadevent
schg_cas03	mapflag	loadevent
schg_cas04	mapflag	loadevent
schg_cas05	mapflag	loadevent
arug_cas01	mapflag	loadevent
arug_cas02	mapflag	loadevent
arug_cas03	mapflag	loadevent
arug_cas04	mapflag	loadevent
arug_cas05	mapflag	loadevent
nguild_alde	mapflag	loadevent
nguild_gef	mapflag	loadevent
nguild_pay	mapflag	loadevent
nguild_prt	mapflag	loadevent

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 2

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  666
  • Reputation:   674
  • Joined:  11/12/12
  • Last Seen:  

It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options:

script.c

/*==========================================
 *------------------------------------------*/
BUILDIN_FUNC(getguildinfo)
{
	struct guild *g = NULL;
	int result = 0;

	if ((g = guild_search(script_getnum(st,2))) != NULL) {
		int type = script_getnum(st,3);

		switch(type) {
			case 0:
				result = g->guild_lv;
				break;
			case 1:
				result = g->connect_member;
				break;
			case 2:
				script_pushstrcopy(st, g->name);
				return SCRIPT_CMD_SUCCESS;
			//case 3:
			//  etc...
			//	break;
			default:
				ShowError("buildin_getguildinfo: unknown type '%d'.\n", type);
				script_pushint(st, 0);
				return SCRIPT_CMD_FAILURE;
		}
	}

	script_pushint(st, result);
	return SCRIPT_CMD_SUCCESS;
}

def method:
BUILDIN_DEF(getguildinfo,"ii"),

 

Recompile your server, then your event would be:

OnPCLoadMapEvent:
	if (getmapflag(strcharinfo(3), mf_gvg_castle)) {
		.@guild_id = getcharid(2);
		
		if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) {
			dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00;
			warp "prontera", 155, 182;
		}
	}
	
	end;

 

Edited by Tokei
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

44 minutes ago, Tokei said:

It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options:


script.c

/*==========================================
 *------------------------------------------*/
BUILDIN_FUNC(getguildinfo)
{
	struct guild *g = NULL;
	int result = 0;

	if ((g = guild_search(script_getnum(st,2))) != NULL) {
		int type = script_getnum(st,3);

		switch(type) {
			case 0:
				result = g->guild_lv;
				break;
			case 1:
				result = g->connect_member;
				break;
			case 2:
				script_pushstrcopy(st, g->name);
				return SCRIPT_CMD_SUCCESS;
			//case 3:
			//  etc...
			//	break;
			default:
				ShowError("buildin_getguildinfo: unknown type '%d'.\n", type);
				script_pushint(st, 0);
				return SCRIPT_CMD_FAILURE;
		}
	}

	script_pushint(st, result);
	return SCRIPT_CMD_SUCCESS;
}

def method:
BUILDIN_DEF(getguildinfo,"ii"),

 

Recompile your server, then your event would be:


OnPCLoadMapEvent:
	if (getmapflag(strcharinfo(3), mf_gvg_castle)) {
		.@guild_id = getcharid(2);
		
		if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) {
			dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00;
			warp "prontera", 155, 182;
		}
	}
	
	end;

 

Indeed very useful thank you for this Tokei, hopefully 1 day you will released a custom src that comes from you :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

all your help and answers are purely reliable...thanks

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

On 12/11/2016 at 5:26 AM, Tokei said:

It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options:


script.c

/*==========================================
 *------------------------------------------*/
BUILDIN_FUNC(getguildinfo)
{
	struct guild *g = NULL;
	int result = 0;

	if ((g = guild_search(script_getnum(st,2))) != NULL) {
		int type = script_getnum(st,3);

		switch(type) {
			case 0:
				result = g->guild_lv;
				break;
			case 1:
				result = g->connect_member;
				break;
			case 2:
				script_pushstrcopy(st, g->name);
				return SCRIPT_CMD_SUCCESS;
			//case 3:
			//  etc...
			//	break;
			default:
				ShowError("buildin_getguildinfo: unknown type '%d'.\n", type);
				script_pushint(st, 0);
				return SCRIPT_CMD_FAILURE;
		}
	}

	script_pushint(st, result);
	return SCRIPT_CMD_SUCCESS;
}

def method:
BUILDIN_DEF(getguildinfo,"ii"),

 

Recompile your server, then your event would be:


OnPCLoadMapEvent:
	if (getmapflag(strcharinfo(3), mf_gvg_castle)) {
		.@guild_id = getcharid(2);
		
		if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) {
			dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00;
			warp "prontera", 155, 182;
		}
	}
	
	end;

 

sir can you extend the src code you made and add  the total castle count of a guild

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