Jump to content
  • 0

Name Changer NPC won't work correctly..


Brawly

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  12/14/12
  • Last Seen:  

Hello guys,

 

I'm quite new to all of this and just can't figure out what makes this npc not work.

 

It's supposed to change your Character's name if you have the item Passport and 10m zeny in your inventory.

 

The ????? in line 16 & 36 have yet to be changed to the Passports ID. (I did however test the npc with a legit id)

 

The Npc shows up ingame but clicking on it won't do anything.

 

 

The code can be found here:

 

http://pastebin.com/dQMwixDS

 

 

Apparently when I leave the following part  out it works: (Atleast I guess that's where the problem has to be. The code worked before I added anything for the item check)

if(countitem(???????) || Zeny < 10000000) {  ///?????? durch passport ID ersetzen
                                mes "Not enough requirements";
                                close;
                        }

Thank you in advance!

Edited by Brawly
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

On 8/28/2015 at 1:37 AM, Brawly said:

Hehe danke Akito. :)

 

Will try this out later today and post whether it worked.

 

On 8/28/2015 at 1:06 AM, EL Dragon said:

here 

caspen,132,233,6	script	Name Changer	445,{

set .@Item,6153; // 1 x Special Exchange Ticket  
set .@Cost,10000000; // 10 Mio Zeny

        mes "Hello, I can change your name in a matter of seconds!";
        mes "Please remember that a minimum of 4 characters is needed";
        mes "and the maximum of 23 characters may not be exceeded.";
        mes "All I need is your ^FF0000"+getitemname(.@item)+"^000000 and a fee of ^FF0000"+.@Cost+"^000000z.";
        menu "I don't like my name anymore..",one,"Who cares?!",two;
                one:
                        query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;       
                        set @GID,getcharid(2);
                        if(!@GID==0){
                                mes "Please leave your guild first before you change name.";
                                close;
                        }
                        mes "Input name...";
                        input .@name$;
						next;
                        if (countitem(.@Item) && Zeny <.@Cost) {
                                mes "Not enough requirements";
                                close;
                        } else {
                        if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
                                mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
                                close;
                        }
                        if(.@name$ == strcharinfo(0)) {
                                mes "You cannot enter same name.";
                                close;
                        }
                        query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+.@name$+"'",.@existing$;
                        if(.@name$ == .@existing$){
                                mes "Name already exists.";
                                close;
                        }                              
                        mes "New name: "+.@name$+"";
                        query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
                        sleep2 1000;
                        delitem .@Item,1;   
                        set Zeny,Zeny-.@Cost;
                        mes "Name successfully changed, please relog to see changes.";
                        close;
                two:
                        emotion e_sob;
                        end;
}
}

Gruß Agito, Akito , AzathoRO  /meh

did someone has the sql of this script

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

1 hour ago, GM Winter said:

 

did someone has the sql of this script

i think if your server are running with sql database it's no need SQL script

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

14 hours ago, hendra814 said:

i think if your server are running with sql database it's no need SQL script

omg my bad while testing this script i edit the sql to my online server while im testing it in my test server haha thank you.
one more problem the script didn't delete the item required and zeny fee.

im also searching how to put some logs for it and 7days cooldown before they can use it again
and if possible not to allowed the special characters in ign and limit the char name to max 15 letters only

 

12345.png

Edited by GM Winter
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

the ????? part need to change to requirement item_id, did you tried change it before?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  12/14/12
  • Last Seen:  

the ????? part need to change to requirement item_id, did you tried change it before?

 

Hi, yes I changed the questionmarks to a legit ID to test the npc, but it still didn't work.

Edited by Brawly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   259
  • Joined:  04/25/12
  • Last Seen:  

Try

if(countitem(id)<1 || Zeny<quantity)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  12/14/12
  • Last Seen:  

Try

if(countitem(id)<1 || Zeny<quantity)

 

thanks, I will try it out later!

 

But normally <1 isn't needed, correct?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

here 

caspen,132,233,6	script	Name Changer	445,{

set .@Item,6153; // 1 x Special Exchange Ticket  
set .@Cost,10000000; // 10 Mio Zeny

        mes "Hello, I can change your name in a matter of seconds!";
        mes "Please remember that a minimum of 4 characters is needed";
        mes "and the maximum of 23 characters may not be exceeded.";
        mes "All I need is your ^FF0000"+getitemname(.@item)+"^000000 and a fee of ^FF0000"+.@Cost+"^000000z.";
        menu "I don't like my name anymore..",one,"Who cares?!",two;
                one:
                        query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;       
                        set @GID,getcharid(2);
                        if(!@GID==0){
                                mes "Please leave your guild first before you change name.";
                                close;
                        }
                        mes "Input name...";
                        input .@name$;
						next;
                        if (countitem(.@Item) && Zeny <.@Cost) {
                                mes "Not enough requirements";
                                close;
                        } else {
                        if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
                                mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
                                close;
                        }
                        if(.@name$ == strcharinfo(0)) {
                                mes "You cannot enter same name.";
                                close;
                        }
                        query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+.@name$+"'",.@existing$;
                        if(.@name$ == .@existing$){
                                mes "Name already exists.";
                                close;
                        }                              
                        mes "New name: "+.@name$+"";
                        query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
                        sleep2 1000;
                        delitem .@Item,1;   
                        set Zeny,Zeny-.@Cost;
                        mes "Name successfully changed, please relog to see changes.";
                        close;
                two:
                        emotion e_sob;
                        end;
}
}

Gruß Agito, Akito , AzathoRO  /meh

Edited by EL Dragon
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  12/14/12
  • Last Seen:  

Hehe danke Akito. :)

 

Will try this out later today and post whether it worked.

Edited by Brawly
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...