Jump to content
  • 0

Question

Posted (edited)

Hi, I would like to request a change gm npc that can't be used when war of emperium is active. thanks

EDIT : change guild master NPC

Edited by Vitrue

6 answers to this question

Recommended Posts

Posted
prontera,0,0,0     script   Changer      100,{
if(agitcheck() ){
mes "War is currently in progress";
close;
}
mes " OK Please Input the name of the character";
mes "The player mus be online!";
next;
input #input$;
atcommand "@changegm "+#input$+"";
mes "Done!";
close;
}

Posted (edited)

Fine simple script but pls change this:

atcommand "@changegm "+#input$+"";

in this:

guildchangegm(getcharid(2), @input$);

And pls use a temporary character var, why permanent account?

You need to add an if when using this command:

if(getguildmaster(getcharid(2)) != strcharinfo(0)) { mes "You're not the guildmaster of this guild"; close; }

Also this If would make sense:

if(!getcharid(2)) { mes "You're in none guild!"; close;}

EDIT:

Here the corrected script:

prontera,0,0,0	 script   Changer	  100,{
if(!getcharid(2)) { mes "You're in none guild!"; close;}
if(getguildmaster(getcharid(2)) != strcharinfo(0)) { mes "You're not the guildmaster of this guild"; close; }
if(agitcheck()){
  mes "War is currently in progress";
  close;
}
mes "OK Please Input the name of the character";
mes "The player mus be online!";
next;
input @input$;
set @success, guildchangegm(getcharid(2), @input$);
if(!@success) { mes "Something's wrong, maybe the player doesn't exist."; close; }
mes "Done!";
close;
}

EDIT: Forgot a close; when failing lawl.

Edited by skyleo
Posted

Fine simple script but pls change this:

atcommand "@changegm "+#input$+"";

in this:

guildchangegm(getcharid(2), @input$);

And pls use a temporary character var, why permanent account?

You need to add an if when using this command:

if(getguildmaster(getcharid(2)) != strcharinfo(0)) { mes "You're not the guildmaster of this guild"; close; }

Also this If would make sense:

if(!getcharid(2)) { mes "You're in none guild!"; close;}

EDIT:

Here the corrected script:

prontera,0,0,0	 script   Changer	  100,{
if(!getcharid(2)) { mes "You're in none guild!"; close;}
if(getguildmaster(getcharid(2)) != strcharinfo(0)) { mes "You're not the guildmaster of this guild"; close; }
if(agitcheck()){
  mes "War is currently in progress";
  close;
}
mes "OK Please Input the name of the character";
mes "The player mus be online!";
next;
input @input$;
set @success, guildchangegm(getcharid(2), @input$);
if(!@success) { mes "Something's wrong, maybe the player doesn't exist."; }
mes "Done!";
close;
}

ahaha nice like this. !

Posted (edited)

But there's one thing I don't like at this script, maybe one could help us.

I save the returned value of the command in @success, but this is unneccesary because

there is a var which is fixed and has the last value an command returned.

But unfortunately I forgot his name ...

Edited by skyleo

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...