|
Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
|
04-16-2008 03:02
I've found an easy vendor script where I can add the items in a notecard. The problem is that I want to share all what I earn with my partner. In this script I can't find where is supposed to pay me and then to change it by adding my partner's avatar key. Any ideas? thanks in advance. Here goes the code... ... money(key id, integer amount) { if (amount == (integer)llList2String(prices,display)) { incSold(display); llGiveInventory(id, llList2String(items,display)); llWhisper(0,"Thank you for your purchase!"); } else { llWhisper(0,"Sorry that is the wrong amount for this item."); llGiveMoney(id, amount); } } } ... [\PHP]
|
|
Shyan Graves
Registered User
Join date: 10 Feb 2007
Posts: 52
|
04-16-2008 07:06
From: Cris Poliak I've found an easy vendor script where I can add the items in a notecard. The problem is that I want to share all what I earn with my partner. In this script I can't find where is supposed to pay me and then to change it by adding my partner's avatar key. Any ideas? thanks in advance. Here goes the code... ... money(key id, integer amount) { if (amount == (integer)llList2String(prices,display)) { incSold(display); llGiveInventory(id, llList2String(items,display)); llWhisper(0,"Thank you for your purchase!"  ; } else { llWhisper(0,"Sorry that is the wrong amount for this item."  ; llGiveMoney(id, amount); } } } ... } The money event is the place were you are paid by the customer and were you should pay your partner! For an easy implementation, store the ID of your partner in a global variable key gMyPartnerKey = "{add key here}"; integer gMyPartnerAmount = 0; [\PHP] then add after the line:
llWhisper(0,"Thank you for your purchase!"); [\PHP] the calculation and the paying of you partner, if you pay him the whole amount you can write:
llGiveMoney(gMyPartnerKey, amount); [\PHP] if you want to split, you write:
gMyPartnerAmount = ( amount / 2 ); llGiveMoney(gMyPartnerKey, gMyPartnerAmount); [\PHP] Hope that helps a bit ;) Regards Shyan
|
|
Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
|
04-16-2008 07:52
Wow !!! It helped me a lot. I was not sure if that event was the one which is going to pay me. Now I can split hehe.
Thank you very much Shyan.
|