Trying to make a donate link
|
|
Unmitigated Gall
Registered User
Join date: 16 Jun 2005
Posts: 24
|
04-28-2008 07:33
Hi there,
I am trying to get a simple way to donate money in a script, yet I can't seem to get the GiveMoney command to simply open a dialog menu to find out how much the person wants to give? It seems that should be the default action, what am I missing about this? I have no problem with a preset amount, but I rally want this to be up to each person donating.
Permissions are set fine, just wonder if there is a simple way to make an amount dialog box to open?
llGiveMoney((key) message, 0);
|
|
Blaine Goldlust
Registered User
Join date: 26 Apr 2008
Posts: 2
|
04-28-2008 07:52
You will need to request the permission from the owner of the donation box. The permissions you need to request is to debit.
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
You will need this to be granted for the money event to work.
money()
With the money event in the script you will then get the pay option on the pie menu when the donation box is right clicked.
I would recommend you you request the permissions as soon as the box is rezzed in world or when the box changes ownership using the changed() event
Hope that helps you a bit.
EDIT -----
If you are wanting to give money then the function should be llGiveMoney(key,amount);
The key being the key of the person you wish to give to and the amount being the amount of lindens you wish to give. ---
- Blaine
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
04-28-2008 08:55
Whoa. You want to have the script give money from the owner to other residents, or you want the object to accept money? Those are very different things. If you want it the script to give money from the owner to other residents, you'll need PERMISSION_DEBIT as mentioned above, and probably llDialog() and a listen to ask the owner how much to give (be VERY careful about only accepting messages from the owner!!!). If you simply want the object to ACCEPT donations TO the owner, you really only need the following script: default { money(key id, integer amount) {} }
Though you can do extra things like set the amount in the payment window with llSetPayPrice() (you'd do that in the 'state_entry' handler of the default state, most likely), keep track of total donations and/or send a thank-you message from the 'money' handler with llWhisper(), llSay(), llInstantMessage(), or whatever, and all kinds of other little nifty features. Do a search for "tip jar" in this forum and you'll find all kinds of info. http://www.lslwiki.net/lslwiki/wakka.php?wakka=LindenDollar
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
04-28-2008 08:59
hahahahaha And this my friends, is why you create and have an alt for testing permissions and scripts, ESPECIALLY when it comes to MONEY.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
04-28-2008 09:20
Your issue is with llSetPayPrice, not llGiveMoney. llGiveMoney is for the owner of the script to give money to the avatar. You'll have a pretty popular donation box if works in reverse! Anywho, try this: default { on_rez (integer foo) { llResetScript(); } state_entry() { llSetText ("Donation Box",<1,1,0>,1); llRequestPermissions (llGetOwner(), PERMISSION_DEBIT); }
run_time_permissions(integer perm) { if (perm & PERMISSION_DEBIT) { llSetPayPrice (PAY_DEFAULT , [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]); llOwnerSay ("Donation Box Online"); } else { state idol; } } money (key giver, integer amount) { llSay (0,"Thank you " + llKey2Name (giver) + " for your donation of $" + (string)amount + "L!!!"); llSetText ("Last donation: $" + (string)amount + "L by\n" + llKey2Name (giver),<1,1,1>,1); }
touch_start(integer total_number) { llSay(0, "Touched."); } }
state idol { state_entry() { llSetText ("Donation Box OFFLINE\nTouch to reset.",<1,0,0>,1); } touch_start (integer foo) { if (llDetectedKey (0) == llGetOwner()) { llResetScript(); } } }
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
04-28-2008 09:26
From: Johan Laurasia Your issue is with llSetPayPrice, not llGiveMoney. llGiveMoney is for the owner of the script to give money to the avatar. You'll have a pretty popular donation box if works in reverse!
Anywho, try this: Your script still requests the PERMISSION_DEBIT permission, which it never uses because it never calls llGiveMoney(). I highly recommend NOT doing that. Giving someone what you claim to be a donation box that accepts money, and having them see a dialog when they touch or rez it asking for debit permissions so the box can GIVE money isn't the best way to inspire trust.
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
04-28-2008 09:34
From: Hewee Zetkin Your script still requests the PERMISSION_DEBIT permission, which it never uses because it never calls llGiveMoney(). I highly recommend NOT doing that. Giving someone what you claim to be a donation box that accepts money, and having them see a dialog when they touch or rez it asking for debit permissions so the box can GIVE money isn't the best way to inspire trust. The guy wants to use a pay box, the only way to use it is to request permission, and put in a money event. The script is open source, so what's being done inside it is wide open for anyone to see. Also, you need the money event to do what I'm doing inside the money event there. Besides, the OP was saying he had permissions set already, so apparently he's doing something after a donation anyways, hence needs debit permissions (even though no payout is occurring).
|
|
Unmitigated Gall
Registered User
Join date: 16 Jun 2005
Posts: 24
|
LEt me explain a little more..
04-28-2008 09:38
The Person is to be wearing a HUD, and there is a button that they press to give the donation. I already stated that I am not having an issue with permissions. My Debit permissions are set up fine and work fine.
My sole issue is I just want a simple dialog box to open to allow the person wearing the hud to be able to donate whatever amount they wish, not a predetermined amount as the llgivemoney function seems to require.
|
|
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
|
04-28-2008 09:41
From: Unmitigated Gall The Person is to be wearing a HUD, and there is a button that they press to give the donation. I already stated that I am not having an issue with permissions. My Debit permissions are set up fine and work fine.
My sole issue is I just want a simple dialog box to open to allow the person wearing the hud to be able to donate whatever amount they wish, not a predetermined amount as the llgivemoney function seems to require. Can't you call different llGiveMoney() functions for each button or something? /me has never used debit permissions or money functions
_____________________
Tutorials for Sculpties using Blender! Http://www.youtube.com/user/BlenderSL
|
|
Unmitigated Gall
Registered User
Join date: 16 Jun 2005
Posts: 24
|
04-28-2008 09:51
Hmmmm... I really just wanted a single donate button that allowed the user to decide how much.. The Tip Jar scripts allow for this type of dialog, but require the owner to be the one getting th donation. Perhaps If I could get a profile to open from LSL then the user could click the pay button there to donate. Any work around command in LSL to get a profile page to open?
|
|
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
|
04-28-2008 09:52
From: Unmitigated Gall Hmmmm... I really just wanted a single donate button that allowed the user to decide how much.. The Tip Jar scripts allow for this type of dialog, but require the owner to be the one getting th donation. Perhaps If I could get a profile to open from LSL then the user could click the pay button there to donate. Any work around command in LSL to get a profile page to open? I mean one button that opens a dialog, and each dialog button calls a different iteration of llGiveMoney() Seems that's what you're trying to do?
_____________________
Tutorials for Sculpties using Blender! Http://www.youtube.com/user/BlenderSL
|
|
Unmitigated Gall
Registered User
Join date: 16 Jun 2005
Posts: 24
|
04-28-2008 09:54
I get what your saying. I guess that is an interesting workaround.
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
04-28-2008 10:07
Oh, I didnt realize that the object was a hud owned by the GIVER... I've never seen a donation hud before, and was assuming it was an object owned by the donation receiver...
you cannot use the 'pay' option that you're trying to use with a HUD device.
|
|
Unmitigated Gall
Registered User
Join date: 16 Jun 2005
Posts: 24
|
04-28-2008 10:21
Hi Johann,
Actually I think the work around is what Hewee and Kiera suggest about the dialog and the listen command. The llGivemoney function does work fine in the hud though, just have to get the amount to give sorted out dynamically from the user.
Thanks list for the ideas!!
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
04-28-2008 10:39
From: Unmitigated Gall Hi Johann,
Actually I think the work around is what Hewee and Kiera suggest about the dialog and the listen command. The llGivemoney function does work fine in the hud though, just have to get the amount to give sorted out dynamically from the user.
Thanks list for the ideas!! Sure, no problem... yeah, llGiveMoney works, but not setting up the 'pay' option...
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
04-29-2008 13:05
Another reason why we need an llInput() command to compliment the llDialog(), so much easyer than seting a timer, a listen and saying "you have 15 seconds to enter the amount on channel /125467
|