Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

[Possible] Scripting Inquiry?...Open Question

Evan Otis
Rookie
Join date: 21 Jul 2004
Posts: 38
08-08-2004 16:52
Is there an existing method you folks have come across that allows a set amount of proceeds (comission) from an inworld 'sale' to be routed to a specific individual or ('storage')? Does this seem like a scripting issue?

Forgive the lack of phraseology/ cohesion in this question,
EO
[ANY/ALL ideas, info, feedback would be greatly appreciated...Thanks!]
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
08-08-2004 23:04
If you use a vendor or other scripted method of purchasing the item, you can use llGiveMoney to divert a portion of it. :)

-Adam
_____________________
Co-Founder / Lead Developer
GigasSecondServer
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
08-08-2004 23:09
You'll want to calculate the appropriate amount, then use llGiveMoney to give it to the correct person.

The way that works is the buyer has to pay the object, which then gives the buyer the item they've requested, rather than jst using the default "buy" UI function.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Evan Otis
Rookie
Join date: 21 Jul 2004
Posts: 38
Hmm... thanks... that starts to answer my questions...
08-09-2004 15:27
Are there ant examples of commission objects/scripting inworld? Is the only storage area for $ 'on oneself'?
Any elaboration of the above scripting would be VERY helpful.

Much Obliged,
EO
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
08-09-2004 18:55
Evan, Yes you can only store money on "yourself". If you need to keep an ammount of money seperate, the only way to do this is to create an alt account to keep as a sort of bank account. Which I'm sure owners of casino's would do so that someone doesn't win all of their money.

Here's an example of a script that should do what you want (i wrote this at work so haven't checked it ingame, so be warned it may give a syntax error).

CODE

//Payment Splitting Script
//by Rysidian Rubio. Free to redistribute, please do not sell this script.

//this script will accept payment for an item, and allow you to give shares of the money to 2 avatars other than the other.
//it will also reject the sale if not enough L$ is given, and return change if more than enough L$ is given.

//All you need to do is change the values for each person you want to give a share of the profits to, and the cost and ammount to give each person.

integer cost = 100; //cost of item for sale
key seller1 = "put avatar's key here"; //person (not owner) to give money to
integer seller1share = 30; //ammount per sale to give to person above

key seller2 = "put avatar's key here"; //person (not owner) to give money to. use "" if not needed.
integer seller2share = 50; //ammount per sale to give to person above

string saleitem = "name of thingy for sale"; //the item for sale must be in the object's inventory, type it's name here;

default
{

state_entry()
{
if ((seller1share + seller2share) > cost) //this section checks that you are not paying more money out than you are receiving for the sale.
{
llInstantMessage(llGetOwner(), "You are giving away more money per item that the cost of the item"); //sends you a message if you are giving away too much money
}
else
{
integer ownerprofit = cost - (seller1share + seller2share);
llInstantMessage(llGetOwner(), "you will receive L$" + ownerprofit + " per sale after giving shares to other contributors"); //tells you how much you will recieve per sale
}
}

money(key id, integer amount) //this section runs when someone gives money to the prim.
{
if (ammount == cost) //if correct price is given
{
llGiveInventory(id,"thingy for sale"); //give person who paid the item and give shares of the money to seller 1 & 2.
llGiveMoney(seller1,seller1share);
llGiveMoney(seller2,seller2share);
}

else if(ammount < cost) //if less than correct price is given
{
llGiveMoney(id,ammount); //return money to buyer and say message that wrong price.
llSay(0, llKey2Name(id) + " This item costs L$" + cost +", please pay correct ammount");
}

else if(ammount > cost) // if more than correct price is given
{
integer difference = ammount - cost; //work out the difference to give back as change
llGiveMoney(id,difference); //give change to buyer, then
llGiveInventory(id,"thingy for sale"); //give person who paid the item and give shares of the money to seller 1 & 2.
llGiveMoney(seller1,seller1share);
llGiveMoney(seller2,seller2share);
}
}
}

Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
08-10-2004 08:54
I posted some scripts that might help you in this thread:
/54/da/18915/1.html
Evan Otis
Rookie
Join date: 21 Jul 2004
Posts: 38
08-15-2004 05:48
Folks,

I appreciate your help so far...

Some of the prior responses have a 'pay-out' flavor to them... the application I'm brainstorming would be less casino-based, more akin 'consignment store commission'...

A secondary question has precipitated from such ideas-

Is there some sort of 'financial statement' disclosure solution/accountability/mutual reporting type of tool or script driven approach to this??

Thanks again [I suspect I may have to reword this one...],
EO