0 Toshiro Posted November 13, 2011 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
0 Orc Lord Posted November 13, 2011 Author Posted November 13, 2011 no i don't have a bank, thank you so much for the code. Quote
0 Z3R0 Posted November 14, 2011 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
0 Green Minded Abuser Posted November 14, 2011 Posted November 14, 2011 you have to set variables to removed or add zeny to a players. Quote
0 Toshiro Posted November 14, 2011 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
0 simplynice Posted November 14, 2011 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
0 Emistry Posted November 14, 2011 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
0 KeyWorld Posted November 14, 2011 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
0 simplynice Posted November 14, 2011 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
0 Sallycantdance Posted March 7, 2022 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
Question
Orc Lord
Thank you.
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.