Yudax Posted December 21, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Share Posted December 21, 2012 Sir Im having this error, just recently. Ive been running this for 3 weeks with no errors. I dont know what happened. When you convert your coins to pvp points, and relog. It will reset back to 0. Please help me with this sir. Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 21, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 21, 2012 · Hidden by Mystery, December 22, 2012 - Duplicate as the beginning post. Hidden by Mystery, December 22, 2012 - Duplicate as the beginning post. Sir Im having this error, just recently. Ive been running this for 3 weeks with no errors. I dont know what happened. When you convert your coins to pvp points, and relog. It will reset back to 0. Please help me with this sir. Link to comment
Emistry Posted December 21, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: Tuesday at 12:58 PM Share Posted December 21, 2012 Topic Merged. Please dont create multiple topic for your issues... 1 topic is enough. Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 22, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 22, 2012 @Emistry Sorry, Just recently read that it should be posted in Linux ( 3rd party ). Thought this is a wrong section. bump Quote Link to comment Share on other sites More sharing options...
Brian Posted December 22, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted December 22, 2012 Looks like you have a custom script that inserted #cashpoints rows in your global_reg_value table? If you have any custom scripts that use query_sql to INSERT or UPDATE sql tables while the server is running and characters are logged in, they need to have proper checks for online/offline chars. It looks like what happened is: your script inserts a variable (#cashpoints) that did not exist yet for that player, then the player logs out and the map-server tried to save that variable too--thus the duplicate entry error. To fix these inconsistencies in your `global_reg_value` table, you could delete the #cashpoints rows your script inserted: DELETE FROM global_reg_value WHERE CAST(`str` AS BINARY) = '#cashpoints'; Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 22, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 22, 2012 (edited) /*** ** Script Request (Cash Trader NPC) ** Link: http://rathena.org/board/topic/57101-request-cash-trader/ ** By Slim ***/ prontera,186,264,4 script RO Coins Trader 437,{ //,677 set .@coinid,20103; mes "[^0000FFCash Trader^000000]"; mes "Hi ^ff8800"+strcharinfo(0)+"^000000,"; mes "Your Avenger Points: [^ff0000"+#cashpoints+"^000000]"; mes "~ ROCoins into PvP Points"; mes "~ PvP Points into ROCoins"; switch(select("^ff0000>^000000 Cancel:^0000ff>^000000 Exchange RO Coins to PvP Points:^0000ff>^000000 Exchange PvP Points to RO Coins")) { case 1: break; case 2: next; mes "[^0000FFCash Trader^000000]"; mes "Please input the amount of coins that you want to exchange."; mes "Note: Put ^0000ff0^000000 to exit."; L_inpcoin: input @hcoins; set @hhcoins,@hcoins; if(@hhcoins == 0) { break; } if(countitem(.@coinid) < @hhcoins) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcoin; } next; delitem .@coinid,@hhcoins; set #cashpoints,#cashpoints+@hhcoins*25; mes "[^0000FFCash Trader^000000]"; mes "You've exchanged (^ff0000"+@hhcoins+"^000000) "+getitemname(.@coinid)+"(s). Total PvP Points: [^0000ff"+#cashpoints+"^000000]"; dispbottom "[Cash Trader] You've exchanged ("+@hhcoins+") "+getitemname(.@coinid)+"(s). Total PvP Points: ["+#cashpoints+"]"; break; case 3: next; mes "[^0000FFCash Trader^000000]"; mes "Please input the amount of PvP Points that you want to exchange."; mes "Your Avenger Points: [^ff0000"+#cashpoints+"^000000]"; mes "Note: Put ^0000ff0^000000 to exit."; L_inpcash: input @hcash; set @hhcash,@hcash; if(@hhcash == 0) { break; } if(#cashpoints < @hhcash) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcash; } //I know they weight 0 but just in case you change its weight if (!checkweight(.@coinid,@hhcash)) { mes "* ^ff0000You're overweight please store some items.^000000"; dispbottom "[Cash Trader] You're overweight please store some items."; break; } next; set #cashpoints,#cashpoints-@hhcoins*25; getitem .@coinid,@hhcash/25; mes "[^0000FFCash Trader^000000]"; mes "You've exchanged (^ff0000"+@hhcash+"^000000) AvengerPoints to "+getitemname(.@coinid)+"(s). Total PvP Points: [^0000ff"+#cashpoints+"^000000]"; dispbottom "[Cash Trader] You've exchanged ("+@hhcash+") PvP Points to "+getitemname(.@coinid)+"(s). Total PvP Points: ["+#cashpoints+"]"; break; } close; } I tried many Coin to Cashpoints/PvP Points. All of them results to this: How shoul I Fix this?. I've updated to 17033 bumb Edited December 22, 2012 by jmusc10 Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 22, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 22, 2012 (edited) Looks like you have a custom script that inserted #cashpoints rows in your global_reg_value table? If you have any custom scripts that use query_sql to INSERT or UPDATE sql tables while the server is running and characters are logged in, they need to have proper checks for online/offline chars. It looks like what happened is: your script inserts a variable (#cashpoints) that did not exist yet for that player, then the player logs out and the map-server tried to save that variable too--thus the duplicate entry error. To fix these inconsistencies in your `global_reg_value` table, you could delete the #cashpoints rows your script inserted: DELETE FROM global_reg_value WHERE CAST(`str` AS BINARY) = '#cashpoints'; When im doe doing this DELETE FROM global_reg_value WHERE CAST(`str` AS BINARY) = '#cashpoints';. Will the cashpoints be reset back to 0? This is my script /*** ** Script Request (Cash Trader NPC) ** Link: http://rathena.org/board/topic/57101-request-cash-trader/ ** By Slim ***/ prontera,186,264,4 script ZileRO Coins Trader 437,{ //,677 set .@coinid,20103; mes "[^0000FFCash Trader^000000]"; mes "Hi ^ff8800"+strcharinfo(0)+"^000000,"; mes "Your Avenger Points: [^ff0000"+#cashpoints+"^000000]"; mes "~ ZileRO Coins into PvP Points"; mes "~ PvP Points into ZileRO Coins"; switch(select("^ff0000>^000000 Cancel:^0000ff>^000000 Exchange zRO Coins to PvP Points:^0000ff>^000000 Exchange PvP Points to zRO Coins")) { case 1: break; case 2: next; mes "[^0000FFCash Trader^000000]"; mes "Please input the amount of coins that you want to exchange."; mes "Note: Put ^0000ff0^000000 to exit."; L_inpcoin: input @hcoins; set @hhcoins,@hcoins; if(@hhcoins == 0) { break; } if(countitem(.@coinid) < @hhcoins) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcoin; } next; delitem .@coinid,@hhcoins; set #cashpoints,#cashpoints+@hhcoins*25; mes "[^0000FFCash Trader^000000]"; mes "You've exchanged (^ff0000"+@hhcoins+"^000000) "+getitemname(.@coinid)+"(s). Total PvP Points: [^0000ff"+#cashpoints+"^000000]"; dispbottom "[Cash Trader] You've exchanged ("+@hhcoins+") "+getitemname(.@coinid)+"(s). Total PvP Points: ["+#cashpoints+"]"; break; case 3: next; mes "[^0000FFCash Trader^000000]"; mes "Please input the amount of PvP Points that you want to exchange."; mes "Your Avenger Points: [^ff0000"+#cashpoints+"^000000]"; mes "Note: Put ^0000ff0^000000 to exit."; L_inpcash: input @hcash; set @hhcash,@hcash; if(@hhcash == 0) { break; } if(#cashpoints < @hhcash) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcash; } //I know they weight 0 but just in case you change its weight if (!checkweight(.@coinid,@hhcash)) { mes "* ^ff0000You're overweight please store some items.^000000"; dispbottom "[Cash Trader] You're overweight please store some items."; break; } next; set #cashpoints,#cashpoints-@hhcoins*25; getitem .@coinid,@hhcash/25; mes "[^0000FFCash Trader^000000]"; mes "You've exchanged (^ff0000"+@hhcash+"^000000) AvengerPoints to "+getitemname(.@coinid)+"(s). Total PvP Points: [^0000ff"+#cashpoints+"^000000]"; dispbottom "[Cash Trader] You've exchanged ("+@hhcash+") PvP Points to "+getitemname(.@coinid)+"(s). Total PvP Points: ["+#cashpoints+"]"; break; } close; } By the way I tried to remove this and restarted the server. It goes well without errors. But after I put this NPC. The duplicate entries again appears. Edited December 22, 2012 by jmusc10 Quote Link to comment Share on other sites More sharing options...
Capuche Posted December 22, 2012 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted December 22, 2012 (edited) That coz you have #cashpoints and #CASHPOINTS variables in global reg value. In your script, change #cashpoints by #CASHPOINTS (#CASHPOINTS is used when using @cash command) In global reg value delete #cashpoints Edited December 22, 2012 by Capuche Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 23, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 23, 2012 (edited) That coz you have #cashpoints and #CASHPOINTS variables in global reg value. In your script, change #cashpoints by #CASHPOINTS (#CASHPOINTS is used when using @cash command) In global reg value delete #cashpoints Is there any commands that will automatically delete #cashpoints? because in pvp, players earn i think #cashpoints and not #CASHPOINTS So in the NPC script. i will change #cashpoints --> #CASHPOINTS? I Also tried removing this script and it wont give any error Edited December 23, 2012 by jmusc10 Quote Link to comment Share on other sites More sharing options...
Brian Posted December 23, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted December 23, 2012 hmm I thought in the Athena Scripting Language, variable names are not case-sensitive (#test is the same as #TEST and #teST) So #cashpoints should be the same as #CASHPOINTS. In your script, can you try changing #cashpoints to #CASHPOINTS (all uppercase), then see if you still get those errors. Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 23, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 23, 2012 hmm I thought in the Athena Scripting Language, variable names are not case-sensitive (#test is the same as #TEST and #teST) So #cashpoints should be the same as #CASHPOINTS. In your script, can you try changing #cashpoints to #CASHPOINTS (all uppercase), then see if you still get those errors. I've tried changing to that server and still got errors. Quote Link to comment Share on other sites More sharing options...
Yudax Posted December 28, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 248 Reputation: 7 Joined: 11/27/12 Last Seen: July 21, 2016 Author Share Posted December 28, 2012 bump Quote Link to comment Share on other sites More sharing options...
Question
Yudax
Sir Im having this error, just recently. Ive been running this for 3 weeks with no errors. I dont know what happened. When you convert your coins to pvp points, and relog. It will reset back to 0. Please help me with this sir.
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.