Difference between revisions of "LlGiveMoney"

From Second Life Wiki
Jump to navigation Jump to search
(rewording, this isn't the place for caveats on theft of money this is a place for caveats of the function, changing to describe a caveat of how the function functions in regards to being irrevocable)
(Undo revision 71212, grammar doesn't parse , I'll add the irrevocability of perms to template. It is important that the general public knows there are consequences for misuse.)
Line 8: Line 8:
|caveats=*An object cannot pay another object.
|caveats=*An object cannot pay another object.
*Objects deeded to groups cannot give money (the permission cannot be granted).
*Objects deeded to groups cannot give money (the permission cannot be granted).
*Once a script has the PERMISSION_DEBIT permission it irrevocable and will be retained until object is de-rezzed or script is reset
*Use is limited to 30 payments in a 30 second interval for each resident on a region. Sustained overage will produce a script error and halt payments while the rate remains excessive. Historically, faster payments have failed intermittently.
*Use is limited to 30 payments in a 30 second interval for each resident on a region. Sustained overage will produce a script error and halt payments while the rate remains excessive. Historically, faster payments have failed intermittently.
*Once a script has the PERMISSION_DEBIT permission it can empty an account of L$.
**Fraud & theft are both {{LL|TOS}} violations and crimes. Misuse this function and you risk being banned and legal action. In addition LL may freeze the accounts of anyone the money is transfered to and restore it to it's rightful owners. This may involve retrieving it from third party exchanges and accounts on those exchanges being frozen. The system is not designed to be friendly towards fraud.
|examples=<lsl>integer AMOUNT = 10;
|examples=<lsl>integer AMOUNT = 10;
integer STASH = 50;
integer STASH = 50;
Line 67: Line 68:
|also_tests
|also_tests
|also_articles
|also_articles
|notes
|notes=
===Footnotes===
{{Footnotes}}
|cat1=Avatar
|cat1=Avatar
|cat2=Money
|cat2=Money

Revision as of 20:48, 11 June 2008

Summary

Function: integer llGiveMoney( key destination, integer 0)" style="border-bottom:1px dotted; cursor:help;">amount );

Transfer amount of L$ money from script owner to destination avatar.
Returns an integer that is always zero.

• key destination avatar key.
• integer amount number of L$, must be greater than zero, (amount > 0)

To run this function the script must request the PERMISSION_DEBIT permission with llRequestPermissions and it must be granted by the owner.

Caveats

Permissions
  • Do not depend upon the auto-grant status of permissions. Always use the run_time_permissions event.
  • If the script lacks the permission PERMISSION_DEBIT, the script will shout an error on DEBUG_CHANNEL and the operation fails (but the script continues to run).
  • If PERMISSION_DEBIT is granted by anyone other than the owner, then when the function is called an error will be shouted on DEBUG_CHANNEL.
  • Once the PERMISSION_DEBIT permission is granted there is no way to revoke it except from inside the script (for example, with a new llRequestPermissions call) or the script is reset or deleted.
  • An object cannot pay another object.
  • Objects deeded to groups cannot give money (the permission cannot be granted).
  • Use is limited to 30 payments in a 30 second interval for each resident on a region. Sustained overage will produce a script error and halt payments while the rate remains excessive. Historically, faster payments have failed intermittently.
  • Once a script has the PERMISSION_DEBIT permission it can empty an account of L$.
    • Fraud & theft are both Linden Lab violations and crimes. Misuse this function and you risk being banned and legal action. In addition LL may freeze the accounts of anyone the money is transfered to and restore it to it's rightful owners. This may involve retrieving it from third party exchanges and accounts on those exchanges being frozen. The system is not designed to be friendly towards fraud.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>integer AMOUNT = 10; integer STASH = 50;

update() {

   if(STASH >= AMOUNT)
       llSetText("I have L$"+(string)STASH + " to give away!");
   else
       llSetText("I have no L$ to give away :(");

}

default {

   state_entry()
   {
       llRequestPermissions(llGetOwner(), PERMISSION_DEBIT );  
   }
   run_time_permissions (integer perm)
   {
       if(perm & PERMISSION_DEBIT)
       {
           state ready;     
       }
   }

}

state ready {

   state_entry()
   {
       update();
   }
   touch_start(integer num)
   {
       if(STASH >= AMOUNT)
       {
           llGiveMoney(llDetectedKey(0), AMOUNT);
           STASH -= AMOUNT;
           update();
       }
       else
       {
           llWhisper(0, "No more money to give away :(");
       }
   }
   money(integer m)
   {
       STASH += m;
       update();
   }
}</lsl>

Notes

Footnotes

See Also

Events

•  run_time_permissions Permission receiving event
•  money

Functions

•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
•  llSetPayPrice

Articles

•  Script permissions

Deep Notes

Search JIRA for related Issues

Signature

function integer llGiveMoney( key destination, integer amount );