SphereCommunity
Referring Problem - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Referring Problem (/Thread-Referring-Problem)



Referring Problem - pinku - 10-01-2013 06:40 PM

Hey all!

I want to refer & log a player who bought something from my DIALOG.
However, I didn't find the right way to do this..

When you say BUY, the NPC will open a DIALOG.
On clicking button 1, you try to buy...

Code:
...
...
ONBUTTON=1
IF (<SRC.GOLD> >= <tag.bla>)
SRC.NEWITEM = <tag.blabla>
SRC.ACT.BOUNCE
SRC.GOLD -= <tag.bla>
SERV.LOG <SRC.ACCOUNT>:<SRC.NAME>:<SRC.UID> bought a <tag.bla> for <tag.blabla>.
...
...

My problem is that on "SERV.LOG" I can't refer to the player who bought the item. It always refer to nothing or to the NPC. I believe I tried everything, even non sense for this. (CONT, OBJ, whatever else), so I'm clearly doing something wrong. c_c

Most of times it shows 0:0:0 or NPC_NAME:NPC_UID.

What is the possible solution for this?

Thanks for reading & for your patience!


RE: Referring Problem - XuN - 10-01-2013 07:33 PM

How do you call that dialog?, on WHO?

ON=Buy
dialog d_buy//will open the dialog ON npc with SRC yourself

src.dialog d_buy//will open the dialog on YOURSELF so you DON'T need src


RE: Referring Problem - pinku - 10-01-2013 07:49 PM

Funny..

When I tried just DIALOG and SERV.LOG <NAME>:<ACCOUNT>:<UID>, it did not work for me. It logged the NPC name.

Now that I called the dialog with SRC.DIALOG and SERV.LOG <SRC.NAME>:<SRC.ACCOUNT>:<SRC.UID> it works just fine...

well, thank you XuN! Much appreciated help!