Jump to content
  • 0

item tracker and character name


Question

Posted

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

 

 

2 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted
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!

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...