Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

split Commission

Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
05-06-2008 05:54
I have this script below that is suppose to give % to partner. What I would like it to do is give % to the creator and balance to the owner. Can anyone help Please.

Thanks
Justin



key partnerid = " "; //your partners KEY not name
integer pay = 10; // item price (if left at 10 it would sell for 10 lindens
float comission=10; // % comission your partner will make
//only scripters that know what they are doing with vendors edit below or edit at your own risk!
default
{
state_entry()
{
llSetText("",<1,1,1>,.75);
}
touch_start(integer num_detected)
{
if(llDetectedKey(0)==llGetOwner())
{
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}

run_time_permissions(integer perm)
{
if (perm & PERMISSION_DEBIT)
{
llOwnerSay("Permissions passed...ready to work";);
state run;
}
state_entry()
{
llSetPayPrice(PAY_HIDE, [pay, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
string obj = llGetInventoryName(INVENTORY_OBJECT, 0);
if(obj != "";)
{
llOwnerSay(obj + " is ready to be sold!";);
llSetText("Pay the vendor to buy " + obj + " for " + (string)pay +"L$", <1,1,1>, 1);
}
else
{
llOwnerSay("/me found no items to sell! Please put some in and touch again!";);
llResetScript();
}



}
{
llInstantMessage(id,"Thank you for your purchase!";);
string obj = llGetInventoryName(INVENTORY_OBJECT, 0);
llGiveInventory(id, obj);
float percentage = (float)pay/100*comission;
llInstantMessage(partnerid,llKey2Name(id)+" bought a " + obj + " ";);
}
}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llOwnerSay("Iventory changed....resetting...";);
llResetScript();
}
}
}
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
05-06-2008 06:02
partnerid = llGetCreator();

Put this in the state_entry, then the creator get the %

cu Georg
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
05-06-2008 06:11
I would have to remove all the partner from state and would I still need to put my ID number in where it says to. I've use this and it fails to recognize my ID # and pay me the percent. That's why I was hoping by changing something to creator it would work.

Thanks
Justin
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
05-06-2008 06:28
Hi Justin,

maybe I don't understand you really, but if you have that line in the state_entry, then you don't need any more keys.
The owner get the money and the % are automatically given to the creator.

If you try that with your own object, then it looks maybe a little strange, as you are the giver the owner and the creator :-)

cu Georg
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
05-06-2008 07:12
Thanks George.

What I want and I think that is it. I want to give the item to a new owner and he as owner gets a % and I as creator gets a %. In yours you don't have anywhere the % is broke down. Like 905 to owner and 10% to creator.

Maybe if you write out that script with what you have..I would understnd it better

Thanks
Justin sorry for confusion
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
05-06-2008 08:09
Okay, I got ..thanks George
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
05-06-2008 08:16
Hi Justin,

That script should do what you like.
In this line you split the money

float comission=10; // % comission your partner will make

In your case you are the partner and you get 10% of the amount and the owner get 90%.

If you like you can IM me inworld.

cu Georg
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
05-06-2008 08:17
Oh ok, I was too slow :-)

yw
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
05-06-2008 18:05
Hi George or anyone. I did like you said and it's not working.. please attempt to make me understand.. thanks