Jump to content
  • 0

change gm via npc using item


caspa

Question


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

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 ( .@gid == 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(.@itemid) < .@itemreq) goto L_NoItem;
mes .npcname$;
mes "   ";
mes "^0000ff*Input New Guild Master*";
next;
input .@player$;
	//---------------------
query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@player$)+"'", .@acc_id,.@player$;
//--------------------.
if ( .@acc_id == getcharid(3) ) {
mes .npcname$;
mes "^ff0000You cant enter your own name.";
emotion e_swt;
close;
}
else if ( !getcharid( 2,.@player$ ) ) {
mes .npcname$;
mes "^ff0000"+.@player$+" is not a member of your guild.";
	close;
}
if ( !isloggedin( .@acc_id,.@player$ ) ) {
mes .npcname$;
mes "^ff0000"+.@player$+" must be online.";
close;
}
mes .npcname$;
mes "Are you sure you want ^0000ff"+.@player$+"^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( .@gid,.@player$ );
    
delitem .@itemid, .@itemreq;
	announce "[Guild Manager] : The leader of ["+getguildname(.@gid)+" guild] has been pass to '"+.@player$+"'",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;

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

try change

else if ( !getcharid( 2,.@player$ ) ) {
mes .npcname$;
mes "^ff0000"+.@player$+" is not a member of your guild.";
	close;
}

into

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

 

Link to comment
Share on other sites

  • 0

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

On 5/1/2019 at 5:46 AM, Emistry said:

try change


else if ( !getcharid( 2,.@player$ ) ) {
mes .npcname$;
mes "^ff0000"+.@player$+" is not a member of your guild.";
	close;
}

into


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

 

thank you [solved]

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