llGiveMoney

From Second Life Wiki
Revision as of 07:31, 20 March 2007 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search

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)

Caveats

  • An object cannot pay another object.
  • Once a script has the PERMISSION_DEBIT permission it can empty an account of L$.
    • Fraud & theft are both Linden Lab violations and crimes.
All Issues ~ Search JIRA for related Bugs

Examples

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)
    {
        MAX += m;
        update();
    }
}

See Also

Events

•  money

Deep Notes

Search JIRA for related Issues

Signature

function integer llGiveMoney( key destination, integer amount );