Chloe Dibou
Registered User
Join date: 4 Dec 2006
Posts: 2
|
12-22-2009 06:52
Hello all,
I was wondering if there was a function that could be turned on or off so that an object would either stop accepting money or take it in when used. Basically I want to create a tip jar that a percentage of the tip goes to someone else. You touch it to get the yellow popup come up to be able to send money to someone else. Now the only thing is if you click on deny then the person that owns the jar will get all the money. What I want to do is allow the tip jar to only allow money to be taken if they choose "accept" on the yellow popup.
Is there a function like this available so the object will not accept money on rez but can be turned on at a later point?
Thanks for any help
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
12-22-2009 08:30
The yellow pop up has nothing to do with accepting money. The yellow pop up is for the owner of the object exclusively. By accepting the yellow pop up request, the owner accepts that money are taken from the owner's account by the script. The only way a tip jar can pay money to someone, is by taking money from the owners account. It would be a terrific idea to search this forum and the script libraries for 'tip jar'  Tip jars have been scripted over and over again, during the years.
_____________________
From Studio Dora
|
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
|
12-22-2009 08:40
The yellow popup is only for taking money from the owner. It appears when llRequestPermissions(PEMISSION_DEBIT) is called. Accepting money from people only happens when there is a money event in the active state. So if you enter a state with a money event only after PERMISSION_DEBIT has been granted the object will not accept any money until the yellow popup has been granted. Something like this: default { state_entry() { llSetText("TipJar not active. \nTouch to activate.",<.984, .686, .365>,.8); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); }
run_time_permissions (integer perm) { if (perm == PERMISSION_DEBIT) state active; else llOwnerSay("I need those permissions. Please touch me to try again."); }
touch_start(integer num_detected){ if (llDetectedKey(0) == llGetOwner()) llResetScript(); else llSay(0,"Only the owner can activate me."); }
on_rez( integer sparam ) { llResetScript(); } }
state active { state_entry() { llSetText("Gimme money.",<.984, .686, .365>,.8); }
money(key id, integer amount) { Do stuff to distribute the money to others. } on_rez( integer sparam ) { llResetScript(); } }
|
Chloe Dibou
Registered User
Join date: 4 Dec 2006
Posts: 2
|
Tip Jar help
12-22-2009 10:07
Thanks so much Ron. The info you gave me will help me greatly. That is exactly what I was looking for.
|