IvanD Posted October 25, 2020 Group: Members Topic Count: 61 Topics Per Day: 0.02 Content Count: 110 Reputation: 0 Joined: 11/13/17 Last Seen: July 24, 2022 Share Posted October 25, 2020 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 Quote Link to comment Share on other sites More sharing options...
0 Balfear Posted October 25, 2020 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 256 Reputation: 245 Joined: 07/24/13 Last Seen: March 24 Share Posted October 25, 2020 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. Quote Link to comment Share on other sites More sharing options...
0 IvanD Posted October 26, 2020 Group: Members Topic Count: 61 Topics Per Day: 0.02 Content Count: 110 Reputation: 0 Joined: 11/13/17 Last Seen: July 24, 2022 Author Share Posted October 26, 2020 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! Quote Link to comment Share on other sites More sharing options...
Question
IvanD
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.