Orc Lord Posted November 13, 2011 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 56 Reputation: 8 Joined: 11/10/11 Last Seen: September 3, 2013 Share Posted November 13, 2011 Thank you. Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted November 13, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 55 minutes ago Share Posted November 13, 2011 (edited) If you're using a SQL server, you just have to run the following query. UPDATE `char` SET `zeny`=0; If you have a bank npc or any other method to store Zeny, you should consider to check those stuff as well, as there might be more Zeny than actually are on the characters. Edited November 13, 2011 by Toshiro Quote Link to comment Share on other sites More sharing options...
0 Orc Lord Posted November 13, 2011 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 56 Reputation: 8 Joined: 11/10/11 Last Seen: September 3, 2013 Author Share Posted November 13, 2011 no i don't have a bank, thank you so much for the code. Quote Link to comment Share on other sites More sharing options...
0 Z3R0 Posted November 14, 2011 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 618 Reputation: 201 Joined: 11/09/11 Last Seen: June 14, 2024 Share Posted November 14, 2011 Topic Resolved? Ok to Close? I would like to start closing fixed topics... (aka, no reason to keep it open) Quote Link to comment Share on other sites More sharing options...
0 Green Minded Abuser Posted November 14, 2011 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 161 Reputation: 6 Joined: 11/13/11 Last Seen: September 24, 2013 Share Posted November 14, 2011 you have to set variables to removed or add zeny to a players. Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted November 14, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 55 minutes ago Share Posted November 14, 2011 (edited) I forgot to tell you, but if you run the sql query, all characters (or if you prefer even the whole server) must be offline, or online characters will still have their zeny. @Green Minded Abuser If you want to remove all zeny of a specific character under certain circumstances the set script command will be fine, but not if you want to remove all zeny at once (e.g. you had to check if you already deleted a player's zeny). Edited November 14, 2011 by Toshiro Quote Link to comment Share on other sites More sharing options...
0 simplynice Posted November 14, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 128 Reputation: 4 Joined: 11/14/11 Last Seen: April 13, 2016 Share Posted November 14, 2011 - script ZenyZeroAll -1,{ //this is for sql query using npc OnPCLogoutEvent: //you can do the login event set .@pname$,strcharinfo(0); query_sql "SELECT `char_id`,`account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@pname$)+"'", .@char_id,.@account_id,.@name$; if (!.@account_id) { end; //this will never happen =P } else { query_sql "UPDATE `char` SET `zeny`=0 WHERE `name` = '"+escape_sql(.@pname$)+"'"; end; //you can use the below code if you dont want the sql query //set zeny,zeny - 2000000000; //amount of zeny here } } try this Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted November 14, 2011 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Thursday at 04:49 PM Share Posted November 14, 2011 (edited) - script ZenyZeroAll -1,{ //this is for sql query using npc OnPCLogoutEvent: //you can do the login event set .@pname$,strcharinfo(0); query_sql "SELECT `char_id`,`account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@pname$)+"'", .@char_id,.@account_id,.@name$; if (!.@account_id) { end; //this will never happen =P } else { query_sql "UPDATE `char` SET `zeny`=0 WHERE `name` = '"+escape_sql(.@pname$)+"'"; end; //you can use the below code if you dont want the sql query //set zeny,zeny - 2000000000; //amount of zeny here } } try this You Script will cause the Zeny being Deleted EVERYTIME they logout... In fact it will never delete player's zeny... The server save player's info in SQL after the onPCLogOutEvent, so the sql value will be restore each time. @Toshiro's Script has solved this issue in Post #3 UPDATE `char` SET `zeny`=0; Method : [ Method 1 ] Just Shut Down the Server and Run the SQL Script. [ Method 2 ] Kick all the Character Out and Run the Script. ( Not Suggested for this Method ) Edited November 14, 2011 by Emistry Quote Link to comment Share on other sites More sharing options...
0 KeyWorld Posted November 14, 2011 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted November 14, 2011 You Script will cause the Zeny being Deleted everytime they logout...In fact it will never delete player's zeny... The server save player's info in SQL after the onPCLogOutEvent, so the sql value will be restore each time.(sorry for flooding ) Quote Link to comment Share on other sites More sharing options...
0 simplynice Posted November 14, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 128 Reputation: 4 Joined: 11/14/11 Last Seen: April 13, 2016 Share Posted November 14, 2011 (edited) You Script will cause the Zeny being Deleted everytime they logout...In fact it will never delete player's zeny... The server save player's info in SQL after the onPCLogOutEvent, so the sql value will be restore each time.(sorry for flooding ) Oh sorry..didn't know that it will store after the onPCLogOutEvent. The purpose of the code is not to shut the server down but just kick them all out and remove the NPC.Run the query above. Run the script, kick them and unload the NPC. xD Edited November 14, 2011 by simplynice Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted March 7, 2022 Group: Members Topic Count: 225 Topics Per Day: 0.14 Content Count: 798 Reputation: 12 Joined: 12/04/20 Last Seen: 3 hours ago Share Posted March 7, 2022 On 11/14/2011 at 6:18 AM, Toshiro said: If you're using a SQL server, you just have to run the following query. UPDATE `char` SET `zeny`=0; If you have a bank npc or any other method to store Zeny, you should consider to check those stuff as well, as there might be more Zeny than actually are on the characters. hello sir how to run this command in sql? Quote Link to comment Share on other sites More sharing options...
Question
Orc Lord
Thank you.
Link to comment
Share on other sites
10 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.