Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question about llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);

Ryak Ulrik
Registered User
Join date: 8 Jan 2009
Posts: 4
01-08-2009 14:56
Hey guys, new SLer and new scripter here(although I'm very good with vb.net/java/c#).

Does llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); (when using a prim to pay money to a client) generate a permission popup box on the object owner's(me) screen?

IE, if I am offline and someone activates the script to get paid, does it pay them or do I have to be online to authorize it?



Also, on a side note, I've seen some blogs/articles saying you can't dynamically set the amount of L$ to pay out? IE if I wanted the script code to generate the number to pay out, and would pay out differently based on who was touching it. Is this true? Or am I reading wrong?

Thanks for your help!
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
01-08-2009 17:22
From: Ryak Ulrik
Hey guys, new SLer and new scripter here(although I'm very good with vb.net/java/c#).

Does llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); (when using a prim to pay money to a client) generate a permission popup box on the object owner's(me) screen?

IE, if I am offline and someone activates the script to get paid, does it pay them or do I have to be online to authorize it?

It pays them, whether or not you are online, so long as it's got the permissions. Typically you ask for debit permissions in state_entry() and the script keeps them.

From: Ryak Ulrik


Also, on a side note, I've seen some blogs/articles saying you can't dynamically set the amount of L$ to pay out? IE if I wanted the script code to generate the number to pay out, and would pay out differently based on who was touching it. Is this true? Or am I reading wrong?

Thanks for your help!


I've never tried it but I can't think of any reason why you can't pay out different sums to different people depending on touches a prim. There's nothing in http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGiveMoney to suggest that would a problem.
Ryak Ulrik
Registered User
Join date: 8 Jan 2009
Posts: 4
01-09-2009 08:23
Thanks a bunch!
Yingzi Xue
Registered User
Join date: 11 Jun 2008
Posts: 144
01-09-2009 08:32
All you need is test code in your touch event to check who is touching the object and what amount they're to be given. Use llKey2Name to get the person's name for any chat messages you want to use. Use llGiveMoney(user_key,amount); to pay them. It should be pretty simple. Something like this...

From: someone

integer max_amount;
key my_known_user;

defaults()
{
max_amount = 500;
my_known_user = (insert key here);
}

default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
}
touch_start(integer touches)
{
if (llDetectedOwner(0) == my_known_user)
{
llInstantMessage(llDetectedOwner(0),"Hello "+llKey2Name(llDetectedOwner(0))+", you've got bucks! Your cut is 20% of $500L.";);
llGiveMoney(llDetectedOwner(0),(max_amount/100)*20);
}
}
}


If you have a lot of users you may want to use a list to store them. Of course, you don't have to go by UUID, you can use some other criteria.