SphereCommunity
vendor system not transfering to bank - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: vendor system not transfering to bank (/Thread-vendor-system-not-transfering-to-bank)



vendor system not transfering to bank - babazar - 12-12-2013 09:03 AM

little snippet of our vendor system, its not sending bought items to a bank or even bag pack

on=1
If (<distance> > 5)
src.sysmessage <def.toofar>
findid.i_m_vendorfala.remove
return 1
endif
If !(<tag0.itemsavenda>)
src.sysmessage <def.noitems_forsale>
sdialog d_vendor_owner_pod
return 1
endif
local.lastp=<src.p>
local.flags=<src.region.flags>
src.region.flags=0
src.p 1,1
serv.newitem=i_backpack
new.name=Vendor Bag
new.color=39
new.cont=<src.findlayer.29>
f_retirar_items <new>
tag.itemsavenda=0
src.sysmessage <def.items_banked1>
findid.i_m_vendorfala.remove
src.p=<local.lastp>
src.region.flags=<local.flags>
src.update


[function f_retirar_items]
IF (<tag0.itemsavenda>)
local.itotais=<tag.itemsavenda>
local.item=1
FOR <local.itotais>
try uid.<tag.iuid<eval <local.item>>>.tag.dispid2=
try uid.<tag.iuid<eval <local.item>>>.cont=<hval <argn1>>
try tag.iuid<eval <local.item>>
try tag.desc<eval <local.item>>
try tag.preco<eval <local.item>>
local.item += 1
ENDFOR
ENDIF

I can post there serveral hundard lines, but it will prob boar you.


RE: vendor system not transfering to bank - Avatar - 12-13-2013 12:10 AM

So you want to send vendor's backpack to owner bank box right ?
I like to show you how to send items from vendor to owner like below. Cant actually look at your script in order not to cause any miss understanding. You can just implement what i will mention to your script easily, i would say.

It is simple like the following.

Just reffered to uid of vendor's backpack ;

ref1= <findlayer.layer_pack.uid> // thinking that uid is the vendor. You can easily satisfy this by any function you gonna create.
// So if you assign any tag to vendor to remember who is owner , that would be helpful like, consider we have tag like tag.owner_vendor = <src.uid> thinking that src is the owner. You can add this while creation of vendor. Once its establish, vendor knows who is master. Or you can just refer to memorytype i guess. Its your choice.

ref2= <tag.owner_vendor>
ref1.cont = <ref2.findlayer.layer_bankbox.uid> // instead of this you can easily assign ref3 as ref3=<ref2.findlayer.layer_bankbox.uid>

So this will transfer vendor's backpack to owner's bank box.

If you want to just send items one by one you can do the following ;

forcont <ref1> 0 // 0 will count anything in the backpack
cont <ref3>
endfor

Hope, this will help.


RE: vendor system not transfering to bank - babazar - 12-13-2013 01:08 AM

Sorry this is part of our player vendor system.. It's supposed to transfer a sold item to the buyers bank box


RE: vendor system not transfering to bank - Avatar - 12-13-2013 01:23 AM

Does not matter, just referred to item as ref1 = <item uid> then as i said, cont it via ref2 which can be player like ref2 = <player uid>
ref1 = <argo.uid> // for instance if you are targeting an item ? or whatever it is just configure this,
ref2 = <src.uid> or whoever it is.

ref1.cont <ref2.findlayer.layer_box.uid>

I'm just showing you the logic, not the whole scripting issue. Because it wont help you later. I can implement my knowledge to your scripting but this will not make you better. Just make a bit brain storming on it. Try to understand what i'm telling you.


RE: vendor system not transfering to bank - babazar - 12-13-2013 07:05 AM

sorted the issue thanks Big Grin