• 0
Sign in to follow this  
caspa

change gm via npc using item

Question

can anybody tell me what i did wrong on the script? 

even though i type the correct name that's part of my guild it say's "hes not part of the guild" and even though the character i'm supposed to pass it on is online.. it say's the character is not online! can someone tell me WTF is going on? i'm lossing my mind LOL 😄

 
	change_gm:
if( agitcheck() ) {
   mes .npcname$;
   mes "You can't change the Guild Master while WoE is active! Come back later.";
   close;
}
mes .npcname$;
mes "Do you want to change the";
mes "leader of your Guild?";
next;
menu"Yes",c_gleader,"No",n_gleader;
	n_gleader:
    close;
	c_gleader:
if ( [email protected] == 0 ) goto L_NoGuild;
mes .npcname$;
mes "I require ^0000ff100 Bank Cards^000000 for";
mes "the labor.";
mes "  ";
mes "Do you have it?";
next;
menu "Yes",y_bank,"No",n_bank;
	n_bank:
    close;
	y_bank:
if(countitem([email protected]) < [email protected]) goto L_NoItem;
mes .npcname$;
mes "   ";
mes "^0000ff*Input New Guild Master*";
next;
input [email protected]$;
	//---------------------
query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql([email protected]$)+"'", [email protected]_id,[email protected]$;
//--------------------.
if ( [email protected]_id == getcharid(3) ) {
mes .npcname$;
mes "^ff0000You cant enter your own name.";
emotion e_swt;
close;
}
else if ( !getcharid( 2,[email protected]$ ) ) {
mes .npcname$;
mes "^ff0000"[email protected]$+" is not a member of your guild.";
	close;
}
if ( !isloggedin( [email protected]_id,[email protected]$ ) ) {
mes .npcname$;
mes "^ff0000"[email protected]$+" must be online.";
close;
}
mes .npcname$;
mes "Are you sure you want ^0000ff"[email protected]$+"^000000 to be the next Guild Master of ^ff0000"+ getguildname(getcharid(2))+"^000000?";
next;
menu "Yes",y_newgm,"No",n_newgm;
	n_newgm:
close;
	y_newgm:                                            
                
guildchangegm( [email protected],[email protected]$ );
    
delitem [email protected], [email protected];
	announce "[Guild Manager] : The leader of ["+getguildname([email protected])+" guild] has been pass to '"[email protected]$+"'",0,0xFF6347;
mes .npcname$;
mes "Guild Master has been successfully changed.";
mes "  ";
mes "Now, please ^ff0000RELOG^000000 to update the database.";
    
    close2;
    atcommand "@kick "+strcharinfo(0);
    end;
	L_NoItem:
mes .npcname$;
mes "^ff0000You do not have the required item.";
	close;

L_NoGuild:
mes .npcname$;
mes "^ff0000You are not in a guild.";
close;

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

try change

else if ( !getcharid( 2,[email protected]$ ) ) {
mes .npcname$;
mes "^ff0000"[email protected]yer$+" is not a member of your guild.";
	close;
}

into

else if ( !getcharid(2) || getcharid(2) != getcharid( 2,[email protected]$ ) ) {
	mes .npcname$;
	mes "^ff0000"[email protected]yer$+" is not a member of your guild.";
	close;
}

 

Share this post


Link to post
Share on other sites
  • 0
On 5/1/2019 at 5:46 AM, Emistry said:

try change

else if ( !getcharid( 2,[email protected]$ ) ) {
mes .npcname$;
mes "^ff0000"[email protected]yer$+" is not a member of your guild.";
	close;
}

into

else if ( !getcharid(2) || getcharid(2) != getcharid( 2,[email protected]$ ) ) {
	mes .npcname$;
	mes "^ff0000"[email protected]yer$+" is not a member of your guild.";
	close;
}

 

thank you [solved]

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

Loading...
Sign in to follow this