Jump to content
  • 0

item tracker and character name


IvanD

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

does anyone have this script?

-NPC that only accessable by admin account

when clicked, it shows list of all character who has the item number 30001

ex

SERVER: 40 PCS                     (TOTAL amount of item "30001" in the server)

Kathryn02 has 10

JayR has 7

Jeff has 23

and so on

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  255
  • Reputation:   232
  • Joined:  07/24/13
  • Last Seen:  

1 hour ago, IvanD said:

does anyone have this script?
-NPC that only accessable by admin account
when clicked, it shows list of all character who has the item number 30001
ex

SERVER: 40 PCS                     (TOTAL amount of item "30001" in the server)
Kathryn02 has 10
JayR has 7
Jeff has 23
and so on

	.@nameid = 30001;
	.@list = query_sql("SELECT `name`, amount FROM `inventory` LEFT OUTER JOIN `char` ON `char`.char_id = `inventory`.char_id WHERE nameid = "+.@nameid, .@char_name$, .@amount);
	for( .@i = 0; .@i < .@list; .@i++ ) {
		dispbottom "[" + .@char_name$[.@i] + "] has " + getitemname(.@nameid) + " " + .@amount[.@i] + " ea.";
		.@total_amount += .@amount[.@i];
	}
	dispbottom "[Total amount of " + getitemname(.@nameid) + " " + .@total_amount + " ea.]", 0x00FFFF;
	end;	

Try this.
Script read items only from inventory table.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

2 hours ago, Balfear said:

	.@nameid = 30001;
	.@list = query_sql("SELECT `name`, amount FROM `inventory` LEFT OUTER JOIN `char` ON `char`.char_id = `inventory`.char_id WHERE nameid = "+.@nameid, .@char_name$, .@amount);
	for( .@i = 0; .@i < .@list; .@i++ ) {
		dispbottom "[" + .@char_name$[.@i] + "] has " + getitemname(.@nameid) + " " + .@amount[.@i] + " ea.";
		.@total_amount += .@amount[.@i];
	}
	dispbottom "[Total amount of " + getitemname(.@nameid) + " " + .@total_amount + " ea.]", 0x00FFFF;
	end;	

Try this.
Script read items only from inventory table.

thank u it worked!

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