Jump to content
  • 0

Request count item in server


SweetyBerriiz

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/22/13
  • Last Seen:  

i want to count item in my server like countitem npc script

Edited by SweetyBerriiz
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


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

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.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Only inventory? or also includes items in storage, mail, auction and so on.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/22/13
  • Last Seen:  

Only inventory? or also includes items in storage, mail, auction and so on.

 

yes includes all

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/22/13
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

because your account is not yet save in your db unless you log out or wait for a minute.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/22/13
  • Last Seen:  

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

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