Jump to content
  • 0

Guild Storage Password Error


awesomazingxed

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

Can anyone help me here. Thanks in advance

 

9r1zee.png


 
// ALTER TABLE  `guild` ADD  `storage_restriction` INT( 11 ) NOT NULL DEFAULT  '0'

-	script	Gstorage	-1,{
	.@char_id = getcharid(0);
	.@guild_id = getcharid(2);

if( !.@guild_id ){
	mes "You dont have any guild.";
}else{
	query_sql( "SELECT `storage_restriction` FROM `guild` WHERE `guild_id` = '"+.@guild_id+"'",.@restriction );
	query_sql( "SELECT `position` FROM `guild_member` WHERE `char_id` = '"+.@char_id+"'",.@position );

	switch( select( "Access Guild Storage",( .@position )?"":"Edit Restriction" ) ){
		Case 1:
			if( .@restriction && .@restriction & ( 2 << .@position ) ){
				mes "Your position cant access this Storage..";
			}else{
				mes "Storage opened.";
				guildopenstorage();
			}
			break;
		Case 2:
			query_sql( "SELECT `position`,`name` FROM `guild_position` WHERE `guild_id` = '"+.@guild_id+"'",.@guild_position,.@guild_position_name$ );
			do{
				.@menu$ = "";
				.@i = 1;
				while( .@i < .guild_max_position ){
					.@menu$ = .@menu$ + (( .@restriction & ( 2 << .@i) )?"^FF0000[Disabled]":"^EE55FF[Enabled]" )+" "+.@guild_position_name$[.@i] +"^000000" +":";
					.@i++;
				}
				mes "Select a Position";
				mes "^FF0000RED - Disable Access^000000";
				.@i = select( .@menu$+":Done" );
				if( .@i <= .guild_max_position ){
					.@bitvalue = ( 2 << .@i );
					if( .@restriction & .@bitvalue ){
						.@restriction -= .@bitvalue;
						mes "Position : ^0055FF"+.@guild_position_name$[.@i]+"^000000 granted Storage Access.";
					}else{ 
						mes "Position : ^0055FF"+.@guild_position_name$[.@i]+"^000000 disabled Storage Access.";
						.@restriction += .@bitvalue;
					}
					next;
				}
			}while( select( "Continue Edit","Finished Edit" ) == 1 );
			query_sql( "UPDATE `guild` SET `storage_restriction` = '"+.@restriction+"' WHERE `guild_id` = '"+.@guild_id+"'" );
			mes "Guild Storage Restriction updated.";
		default: break;
	}
}
close;

OnInit:
.guild_max_position = 20;
end;
}
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

What emulator are you using ??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

What emulator are you using ??

 

Eathena

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Try this one. not tested.

// ALTER TABLE  `guild` ADD  `storage_restriction` INT( 11 ) NOT NULL DEFAULT  '0'

-	script	Gstorage	-1,{
	set .@char_id = getcharid(0);
	set .@guild_id = getcharid(2);

if( !.@guild_id ){
	mes "You dont have any guild.";
}else{
	query_sql( "SELECT `storage_restriction` FROM `guild` WHERE `guild_id` = '"+.@guild_id+"'",.@restriction );
	query_sql( "SELECT `position` FROM `guild_member` WHERE `char_id` = '"+.@char_id+"'",.@position );

	switch( select( "Access Guild Storage",( .@position )?"":"Edit Restriction" ) ){
		Case 1:
			if( .@restriction && .@restriction & ( 2 << .@position ) ){
				mes "Your position cant access this Storage..";
			}else{
				mes "Storage opened.";
				guildopenstorage();
			}
			break;
		Case 2:
			query_sql( "SELECT `position`,`name` FROM `guild_position` WHERE `guild_id` = '"+.@guild_id+"'",.@guild_position,.@guild_position_name$ );
			do{
				.@menu$ = "";
				.@i = 1;
				while( .@i < .guild_max_position ){
					.@menu$ = .@menu$ + (( .@restriction & ( 2 << .@i) )?"^FF0000[Disabled]":"^EE55FF[Enabled]" )+" "+.@guild_position_name$[.@i] +"^000000" +":";
					.@i++;
				}
				mes "Select a Position";
				mes "^FF0000RED - Disable Access^000000";
				.@i = select( .@menu$+":Done" );
				if( .@i <= .guild_max_position ){
					.@bitvalue = ( 2 << .@i );
					if( .@restriction & .@bitvalue ){
						.@restriction -= .@bitvalue;
						mes "Position : ^0055FF"+.@guild_position_name$[.@i]+"^000000 granted Storage Access.";
					}else{ 
						mes "Position : ^0055FF"+.@guild_position_name$[.@i]+"^000000 disabled Storage Access.";
						.@restriction += .@bitvalue;
					}
					next;
				}
			}while( select( "Continue Edit","Finished Edit" ) == 1 );
			query_sql( "UPDATE `guild` SET `storage_restriction` = '"+.@restriction+"' WHERE `guild_id` = '"+.@guild_id+"'" );
			mes "Guild Storage Restriction updated.";
		default: break;
	}
}
close;

OnInit:
.guild_max_position = 20;
end;
}

@TC Why not upgrade your emulator to the latest like rAthena?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

still not working~

Link to comment
Share on other sites


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

The conversion can be done by refer this

http://rathena.org/board/topic/78263-scripting-faqtipstricks/?p=267219

 

eathena doesnt support direct variable assigning. must use set

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