Jump to content
  • 0

how to make it need to give 100 gold before change name


Question

Posted
prontera,194,181,3 script Name Changer 66,{
set .@npcname$, "[^ff0000Name Changer^000000]";


firstmenu:
mes .@npcname$;
mes "Would you like to change your name?";
switch(select("Yes:No")){
case 1:Firstcase:
mes .@npcname$;
mes "Very well. Input what you'd like to change it to.";
input .@newname$;
next;
if(getstrlen(.@newname$)>23){
mes .@npcname$;
mes "Your name cannot be longer than 23 english characters.";
select("Back");
goto Firstcase;end;
}
mes .@npcname$;
mes "Are you sure you want to change your name to "+.@newname$+"?";
switch(select("Yes:Back:No")){
case 1:
mes .@npcname$;
mes "Okie dokie!";
mes "You'll have to relog for you name to change.";
close2;
query_sql "UPDATE `char` SET `name` = '"+.@newname$+"' WHERE `char_id` = '"+getcharid(0)+"'";
end;
case 2:
goto firstmenu;end;
case 3:
mes .@npcname$;
mes "Okay. Come back if you change your mind.";
close;
}
}
}

how to make it need to give 100 gold before change name 

1 answer to this question

Recommended Posts

Posted

change

mes .@npcname$;
mes "Okie dokie!";
mes "You'll have to relog for you name to change.";
close2;
query_sql "UPDATE `char` SET `name` = '"+.@newname$+"' WHERE `char_id` = '"+getcharid(0)+"'";
end;

to

mes .@npcname$;
mes "You need to pay 100 gold.";
if( countitem(969) < 100 ) close;
delitem 969,100;
mes "Okie dokie!";
mes "You'll have to relog for you name to change.";
close2;
query_sql "UPDATE `char` SET `name` = '"+.@newname$+"' WHERE `char_id` = '"+getcharid(0)+"'";
end;

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