SweetyBerriiz Posted August 19, 2013 Posted August 19, 2013 (edited) i want to count item in my server like countitem npc script Edited August 19, 2013 by SweetyBerriiz Quote
Patskie Posted August 20, 2013 Posted August 20, 2013 Only inventory? or also includes items in storage, mail, auction and so on. Quote
SweetyBerriiz Posted August 20, 2013 Author Posted August 20, 2013 Only inventory? or also includes items in storage, mail, auction and so on. yes includes all Quote
x13th Posted August 20, 2013 Posted August 20, 2013 (edited) You need SQL statement. prontera,157,95,4 script ahue 602,{ query_sql ("SELECT SUM(nameid) FROM `auction` WHERE `nameid` = '569'", @auction); query_sql ("SELECT SUM(amount) FROM `inventory` WHERE `nameid` = '569'", @inventory); query_sql ("SELECT SUM(amount) FROM `storage` WHERE `nameid` = '569'", @storage); query_sql ("SELECT SUM(amount) FROM `cart_inventory` WHERE `nameid` = '569'", @cartinventory); query_sql ("SELECT SUM(amount) FROM `mail` WHERE `nameid` = '569'", @mail); set sum, @inventory + @storage + @cartinventory + @mail + @auction; mes sum; close; } Edited August 20, 2013 by x13th Quote
SweetyBerriiz Posted August 20, 2013 Author Posted August 20, 2013 i write like this already but it's not realtime you can try 1. @item 4001 5ea 2. relogin 3. click your npc, npc will return 5 to you 4. @item 4001 5ea again 5. click your npc , npc will return 5 same before it's not realtime, npc must return 10 not 5 when i @item again and not relogin Quote
x13th Posted August 20, 2013 Posted August 20, 2013 because your account is not yet save in your db unless you log out or wait for a minute. Quote
Emistry Posted August 20, 2013 Posted August 20, 2013 it should be like this...http://upaste.me/raw/54d5fb and..you are unable to do a realtime count since saving data into database required some time or event to trigger it. 1 Quote
SweetyBerriiz Posted August 20, 2013 Author Posted August 20, 2013 ahh , i already know why not recommend to make server function like this because it's must query item every table if item have a lot server will work heavily Quote
Question
SweetyBerriiz
i want to count item in my server like countitem npc script
Edited by SweetyBerriiz7 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.