Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Splitting "Tips"

Mark Matador
Registered User
Join date: 26 Apr 2005
Posts: 10
06-29-2005 20:10
I know it is a relatively simple task for one avatar to tip another, but, does anyone know if its possible, and if so how, to split a tip in two, so that the proceeds can be divided between two (or more) avatars?

Obviously rounding off the L$ is gonna be just as important :)

I will also be needing to do this with vending machines in future, so a designer or land owner can get a "cut".

Any help would be much appreciated.

Thanx :)

Mark Matador.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
06-29-2005 21:01
Checkout the multi venders in the script library.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Mark Matador
Registered User
Join date: 26 Apr 2005
Posts: 10
06-30-2005 09:13
Thanx for that :)

LOL - am so new to scripting, didnt even know there was a library.

However, my first mission is to split a tip, and though I will need the multi-person vending later, I cant seem to "extract" the right info for spliting a tip for two people.

Any ideas on this?

Thanx.
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
06-30-2005 10:48
You can try this, just a warning have not tested it so try small amounts. It should work fine :) Remember to replace the partnerskey with his own or it won't work.


CODE
key partnerskey = "00000000-0000-0000-0000-000000000000";  //INSERT YOUR PARTNER'S KEY HERE, CAN BE FOUND USING llDetectedKey()
string thankyou = "Thank you for the tip."; //THIS IS THE MESSAGE TO THE PERSON WHO TIPS YOU

default
{
state_entry() //START OF SCRIPT WILL ASK YOU FOR PERMISSION TO DEBIT THIS ALLOWS YOU TO PAY YOUR PARTNER.
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
}

money(key id, integer amount) //THE MONEY EVENT IS TRIGGERED WHEN SOMEONE PAYS THE OBJECT. YOU WILL FIRST GET THE FULL AMOUNT OF THE TIP THEN YOU WILL PAY HALF OF IT TO YOUR PARTNER
{
llInstantMessage(id, thankyou); //IM THANKYOU TO THE PERSON WHO TIPPED
integer roughlyhalf = amount / 2; //DIVIDED THE AMOUNT THAT WAS PAID BY TWO, IF VALUE HAS A DECIMAL PLACE IT WILL BE DROPPED SO. IE: "2.5" WOULD BE JUST "2"
llGiveMoney(partnerskey,roughlyhalf); //OWNER PAYS PARTNER HALF. IF TIP IS AN ODD AMOUNT YOU WILL GET THE EXTRA L$1
llInstantMessage(partnerskey, llKey2Name(id) + " paid you L$" + (string)roughlyhalf + "."); //IM YOUR PARTNER FOR WHOM THE TIP WAS FROM & THE AMOUNT
}
}
Mark Matador
Registered User
Join date: 26 Apr 2005
Posts: 10
07-02-2005 15:40
thank you :) have modded it a bit and works great :)

my next mission is an elevator.lol..oh well - will post again if i need to..lol

cheers :)
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
07-02-2005 15:44
From: Mark Matador
thank you :) have modded it a bit and works great :)

my next mission is an elevator.lol..oh well - will post again if i need to..lol

cheers :)


Hank Ramos scripted a free one which is what I always use, but it'd probably be a good starting point if you want your own.. Drop me an IM in world and I'll send it to you next time I'm online
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.
---------------
Zapoteth Designs, Temotu (100,50)
---------------