Jump to content
  • 0

How to delete all character's zenny in database?


Orc Lord

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   8
  • Joined:  11/10/11
  • Last Seen:  

Thank you.

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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 by Toshiro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   8
  • Joined:  11/10/11
  • Last Seen:  

no i don't have a bank, thank you so much for the code.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Topic Resolved? Ok to Close? I would like to start closing fixed topics... (aka, no reason to keep it open)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   6
  • Joined:  11/13/11
  • Last Seen:  

you have to set variables to removed or add zeny to a players.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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 by Toshiro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  128
  • Reputation:   4
  • Joined:  11/14/11
  • Last Seen:  

-	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

Link to comment
Share on other sites

  • 0

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

-	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 by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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 :))

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  128
  • Reputation:   4
  • Joined:  11/14/11
  • Last Seen:  

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 by simplynice
Link to comment
Share on other sites

  • 0

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

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?

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