Jump to content
  • 0

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


donkeyg

Question


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

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 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


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

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