![]() |
Problem with Player Vendor System - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Problem with Player Vendor System (/Thread-Problem-with-Player-Vendor-System) |
Problem with Player Vendor System - nobody2k - 02-27-2015 06:53 PM Hi all! I just started to script an own Player-vendor system, nothing special, just an easy to use system for max 10 items. Actually, it's based on an NPC "c_vendor" which I created, the Gump appears when I DClick on the NPC. I want to place the items inside the "vendor container" (the thing that opens up when you say "stock", it's layer 26) and store the Serial of every item in an own tag (TAG is stored at the NPC, so it's "tag.item1", "tag.item2", "tag.item3",... ) Now, when the GUMP shows up I want to display all the items (their name, amount an price). I tried that using <SERV.ITEMDEF.<TAG.item1>.NAME> ... but it only shows "0"^^ Using EVAL, gives the the same name "0", which is actually NOT the name of a mark scroll (in my example)... Could someone please help me, I just ran out of ideas ![]() thx in advance! greeting, Chris RE: Problem with Player Vendor System - darksun84 - 02-27-2015 07:51 PM Probably is caused by this: When you dclick(@charDclick) the vendor, the gump is sent to the player and the only reference inside the gump is the player and not the vendor. So it's actually looking in the player tags instead of looking in the vendor tags. The solution is to pass a reference (the vendor uid) along with the gump. Wrong Example PHP Code: ON=@CharDclick A simple right example is to store the vendor uid inside a player tag PHP Code: ON=@CharDclick Anyway, this solution will create other problem that you will discover sisi RE: Problem with Player Vendor System - nobody2k - 03-05-2015 10:42 PM Hi! Thank you for your answer! I worked around my problems and solved it by using the backpack of the Vendor NPC. ![]() I had to gump a whole new "buy script" then, but it is completed and working. ![]() |