Jump to content
  • 0

Display guild master and guild member


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

Hello can anyone help me on how to create a script whereas it would display some guild information like....

Guild Leader and the Guild Members of that Guild... Also the castle they own..... and i want it auto update whenever there is a change of guild members....

Edited by caspa
Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It's more like a script request.. whatever here for you.

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
.@m = 0;
.@cast_owned$ = "";
setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
	deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@c = query_sql( "SELECT `castle_id` FROM `guild_castle` WHERE `guild_id` = '"+ .@guild_id[ .@s ] +"'", .@castle_id );
for( .@i = 0; .@i < .@c; .@i++ )
	.@cast_owned$ = .@cast_owned$ + .castle$[ .@castle_id[ .@i ] ] + ( .@i == .@c -1 ? "" : ", " );

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( .@c ? .@cast_owned$ : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;



OnInit:
deletearray .castle$, getarraysize( .castle$ );	//- prevent duplicate
setarray .castle$, "Neuschwanstein",	"Hohenschwangau",	"Nuernberg",	"Wuerzburg",	"Rothenburg",
				"Repherion",		"Eeyolbriggar",		"Yesnelph",		"Bergel",		"Mersetzdeitz",
				"Bright Arbor",		"Scarlet Palace",	"Holy Shadow",	"Sacred Altar",	"Bamboo Grove Hill",
				"Kriemhild",		"Swanhild",			"Fadhgridh",	"Skoegul",		"Gondul",
				"Earth",			"Air",				"Water",		"Fire",			"Himinn",
				"Andlangr",			"Viblainn",			"Hljod",		"Skidbladnir",	"Mardol",
				"Cyr",				"Horn",				"Gefn",			"Bandis";
end;
}

Display :

- Number of guild (total)

- when you select a guild

-- display guild name, guild master, guild lvl, member online and castle owned by the guild

-- display all member name and check if they are online/offline

Works on rAthena only.

Edit including comment of nanakiwurtz

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


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

/no1

Error corrected. I don't know if it's better to put .@npc$ in OnInit label but it's just a little set so it doesn't need much ressource in both case.

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

/no1

Error corrected. I don't know if it's better to put .@npc$ in OnInit label but it's just a little set so it doesn't need much ressource in both case.

Sir capuche thank you so much for the script..... now i i was just wondering how to add a single letter that would define the list of name

this is the idea of what i'm trying to do :

[b]mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

It's more like a script request.. whatever here for you.

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
.@m = 0;
.@cast_owned$ = "";
setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
	deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@c = query_sql( "SELECT `castle_id` FROM `guild_castle` WHERE `guild_id` = '"+ .@guild_id[ .@s ] +"'", .@castle_id );
for( .@i = 0; .@i < .@c; .@i++ )
	.@cast_owned$ = .@cast_owned$ + .castle$[ .@castle_id[ .@i ] ] + ( .@i == .@c -1 ? "" : ", " );

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( .@c ? .@cast_owned$ : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;



OnInit:
deletearray .castle$, getarraysize( .castle$ );	//- prevent duplicate
setarray .castle$, "Neuschwanstein",	"Hohenschwangau",	"Nuernberg",	"Wuerzburg",	"Rothenburg",
				"Repherion",		"Eeyolbriggar",		"Yesnelph",		"Bergel",		"Mersetzdeitz",
				"Bright Arbor",		"Scarlet Palace",	"Holy Shadow",	"Sacred Altar",	"Bamboo Grove Hill",
				"Kriemhild",		"Swanhild",			"Fadhgridh",	"Skoegul",		"Gondul",
				"Earth",			"Air",				"Water",		"Fire",			"Himinn",
				"Andlangr",			"Viblainn",			"Hljod",		"Skidbladnir",	"Mardol",
				"Cyr",				"Horn",				"Gefn",			"Bandis";
end;
}

Display :

- Number of guild (total)

- when you select a guild

-- display guild name, guild master, guild lvl, member online and castle owned by the guild

-- display all member name and check if they are online/offline

Works on rAthena only.

Edit including comment of nanakiwurtz

Capuche!! how do edit this script so that it only reads 1 specific castle!! ( refer to the picture for what i want )

i want to make this script that it only reads the payg_cas03 because that's the castle needed to conquer in order to become the GOTW......

post-3628-0-81699800-1359736658_thumb.jpg

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Just put == in

(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )

mes (.@i + 1)+".  "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" ) + .@name_m$[ .@i ] +" "+ ( .@name_m$[ .@i ] == .@master$[ .@s ] ? "( L )" : "" ) +"^000000";

@xmaniacx

I don't understand well your request.

If you only want payg_cas03 castle... well something like this ?

prontera,155,155,5    script    Guild manager    56,{
//- Limit 128 guild names
//- NPC name
   .@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
   if( .@m ) {
       .@m = 0;
       .@cast_owned$ = "";
       setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
       for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
           deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
   }

// Count guild
// -----------
   query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

   mes .@npc$;
   mes " ";
   mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
   mes "Select a guild for more informations.";
   next;


// Menu display name guild
// -----------------------
   query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
                   .@guild_id, .@name$, .@master$, .@guild_lv );

   .@s = select( implode( .@name$, ":" ) ) -1;

   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
   for( .@i = 0; .@i < .@size; .@i++ )
       if( getcharid( 0,.@name_m$[ .@i ] ) )
           .@m++;

   mes .@npc$;
   mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
       "Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
       "Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
       "Members Online: ^0000FF"+ .@m +"^000000",
       "Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
   switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
       case 1:
           next;
           break;
       case 2:
           next;
           mes .@npc$;
           mes " ";
           mes "See you soon ^-^";
           close;
       case 3:
           next;
           goto L_list;
   }

   deletearray .@name_m$, getarraysize( .@name_m$ );
   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

   mes .@npc$;
   mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
       "- Red: currently ^FF0000offline^000000.",
       "- Green: currently ^00C957online^000000.",
       " ";

   for( .@i = 0; .@i < .@size; .@i++ )
       mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
   next;
   goto L_list;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Just put == in

(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )

mes (.@i + 1)+".  "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" ) + .@name_m$[ .@i ] +" "+ ( .@name_m$[ .@i ] == .@master$[ .@s ] ? "( L )" : "" ) +"^000000";

@xmaniacx

I don't understand well your request.

If you only want payg_cas03 castle... well something like this ?

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
if( .@m ) {
	.@m = 0;
	.@cast_owned$ = "";
	setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
	for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
		deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
}

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;
}

Well what i'm basically trying to say is that.......... in my server every, sunday at 9:00P.M - 10:00PM the castle payg_cas03 is active and whoever conquer this one will be the GOTW...... now what i want is that, whenever the WoE finishes and a certain guild conquer this castle..... like for example the maniac guild owns the Castle..... it would display the information of the guild (guildleader/nameofguild/guildmembers) on the flag........ so that when newbie people view the flag.... it would give them the information on what guild to target during the WoE session...... hope u get what i'm trying to say........

Edited by xmaniacx
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Like that ?

prontera,155,155,5    script    Guild manager    56,{
//- Limit 128 guild names
//- NPC name
   .@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
   if( .@m ) {
       .@m = 0;
       .@cast_owned$ = "";
       setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
       for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
           deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
   }

// Count guild
// -----------
   query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

   mes .@npc$;
   mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
   mes "^FF0000GOTW Information^000000",
       "Castle : "+ getcastlename( "payg_cas03" ),
       "Owned by Guild : "+getguildname( getcastledata( "payg_cas03",1 ) ),
       "^FF0000WANTED !^000000 Guild Leader : "+ getguildmaster( getcastledata( "payg_cas03",1 ) );
   next;


// Menu display name guild
// -----------------------
   query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
                   .@guild_id, .@name$, .@master$, .@guild_lv );

   .@s = select( implode( .@name$, ":" ) ) -1;

   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
   for( .@i = 0; .@i < .@size; .@i++ )
       if( getcharid( 0,.@name_m$[ .@i ] ) )
           .@m++;

   mes .@npc$;
   mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
       "Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
       "Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
       "Members Online: ^0000FF"+ .@m +"^000000",
       "Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
   switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
       case 1:
           next;
           break;
       case 2:
           next;
           mes .@npc$;
           mes " ";
           mes "See you soon ^-^";
           close;
       case 3:
           next;
           goto L_list;
   }

   deletearray .@name_m$, getarraysize( .@name_m$ );
   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

   mes .@npc$;
   mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
       "- Red: currently ^FF0000offline^000000.",
       "- Green: currently ^00C957online^000000.",
       " ";

   for( .@i = 0; .@i < .@size; .@i++ )
       mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
   next;
   goto L_list;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

Like that ?

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
if( .@m ) {
	.@m = 0;
	.@cast_owned$ = "";
	setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
	for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
		deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
}

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "^FF0000GOTW Information^000000",
	"Castle : "+ getcastlename( "payg_cas03" ),
	"Owned by Guild : "+getguildname( getcastledata( "payg_cas03",1 ) ),
	"^FF0000WANTED !^000000 Guild Leader : "+ getguildmaster( getcastledata( "payg_cas03",1 ) );
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;
}

Boss capu it's about nearly what i want i'd say 80%...........

I've check the script and there is a little bit too much information LOL.............

What i'd like is that when a player click's the flag.......

it would display something like this

mes [ GOTW Information ]";

mes "Castle : payg_cas03/Holy Shadow";

mes "Status : (null/unoccopied) <-- if not owned yet || occupied <-- if occupied";

mes "GM Leader : (none) <--- if not owned yet || guild leader name <-- if owned by a guild";

mes "GM Member : (none) <--- if not owned yet || list of guild member's name who owned the castle";

next;

menu "Enter Castle" "Cancel"

if enter caslte -->>

it would check the character if she/he is a part of the guild that owned the castle...

then if the castle has not been conquered it yet......

It would say "no guild has conquered this castle yet..... ";

something like this............

also i would still like it to have a green and red color if they're online or offline

Edited by xmaniacx
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@xmaniacx

It was a request far await from the topic... the topic is a little confused now. Post a new in script request next time.

prontera,155,155,5	script	GOTW Infos	56,{
//- NPC name
.@npc$ = "[ ^FF0000GOTW Informations^000000 ]";
//--------------------------------------

if( getcastledata( "payg_cas03",1 ) )
	.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ getcastledata( "payg_cas03",1 ) +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Castle : payg_cas03/"+ getcastlename( "payg_cas03" ),
	"Owned by Guild : "+ ( getcastledata( "payg_cas03",1 ) ? getguildname( getcastledata( "payg_cas03",1 ) ) : "none" ),
	"GM Leader : "+ ( getcastledata( "payg_cas03",1 ) ? ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + getguildmaster( getcastledata( "payg_cas03",1 ) ) +"^000000" : "none" ),
	"Members ^00C957online^000000 / ^FF0000offline^000000 : "+ ( .@size ? "" : "none" );
for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;

// Menu members
// ------------
if( select( "~ ^777777Enter castle^000000", "~ ^777777Cancel^000000" ) -1 ) {
	mes .@npc$;
	mes " ";
	mes "See you soon ^-^";
	close;
}
.@d = getcastledata( "payg_cas03",1 );
mes .@npc$;
if( !.@d ) {
	mes "No guild has conquered this castle yet !";
	close;
}
else if( .@d == getcharid(2) ) {
	mes "You are a member of the guild's castle !";
	close;
}
mes "I can't do nothing for you.";
close;

}

@caspa

It's done ? ^-^'

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

ohhh...... yes capuche!! mine was already done from the moment you've posted here.............. THANK YOU SO MUCH!!!! [PROBLEM SOLVED]

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

But there's already

Master Name: ^FFCC00"+ .@master$[ .@s ] +"^000000",

on the code, isn't it?

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