Transfer amount of L$ money from script owner to destination avatar.
integer llGiveMoney( key destination, integer amount );
Forced delay: 0.0 seconds. Energy: 10.0.
To run this function the script must request the PERMISSION_DEBIT permission with llRequestPermissions and it must be granted by the owner.
Returns an integer that is always zero. In contrast llTransferLindenDollars returns a key that can be used to match the function call to the resulting transaction_result event and the transaction history.
Permissions
// Pay 100 L$ to Fred Bloggs when he touches this prim, then die
// Compare this example with that shown under llTransferLindenDollars
string Recipient = "Fred Bloggs"; // Authorised recipient
integer Amount = 100; // Amount to pay Fred when he touches the prim
integer DebitPerms;
default
{
state_entry()
{
// Ask the owner for permission to debit their account
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions (integer perm)
{
if (perm & PERMISSION_DEBIT)
DebitPerms = TRUE;
}
touch_start(integer num_detected)
{
if (!DebitPerms)
return; // Cannot proceed - debit permissions not granted
if (llDetectedName(0) != Recipient)
return; // unauthorised person is touching - ignore
key id = llDetectedKey(0); // Get toucher's (i.e. Fred's) UUID
llGiveMoney(id, Amount); // Give him the money
llDie(); // Die so Fred can't keep taking money
}
}