User:Pyrii Akula/llRequestMoney

From Second Life Wiki
Jump to: navigation, search
Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: key llRequestMoney( key from, key to, string message );

Pyrii Akula's version of llRequestMoney() function request by User:SignpostMarv Martin

Requests an amount of money from user {from} and sends it to user {to} with a dialog box also containing the message {message} and returns a key of the request which can be compared to the key returned by partner function llReqMoneyID()

The subsequent transaction then triggers a money() event. The ID of the request can be called by llReqMoneyID() to see the the money event matches the called Request. If the money() event wasn't called from an llRequestMoney() based transaction, then llReqMoneyID() will return -1, this makes it possible to identify money() events that have been triggered by the pay box.

The amount to request is set by llSetPayPrice() and shown in the Request Money dialogue. This also means in the window is closed or the user wants to Pay via the old Right-Click > Pay... method, then that will follow the same method.
Returns a key Key ID for transaction that can be later recalled in the money() event by llReqMoneyID()

• key from Key of the user you're requesting money from
• key to Key of the user the money is going to
• string message Message displayed to the user in the request window

  • Requests are throttled to only once every 1-5 seconds (undecided)
  • {from} must be within the vicinity of the requesting object

Examples

<lsl>key G_TRANSACTION_ID; integer C_ITEM_COST = 400;

default { state_entry() { llSetPayPrice(PAY_HIDE, [C_ITEM_COST, PAY_HIDE, PAY_HIDE, PAY_HIDE]); } touch_start(integer total_number) { G_TRANSACTION_ID = llRequestMoney(llDetectedKey(0), llGetOwner(), "Payment for Super-Dooper TV Set"); }

money(key L_KEY, integer L_AMOUNT) { if(G_TRANSACTION_ID == llReqMoneyID() && C_ITEM_COST == L_AMOUNT) { llSay(0, "Thank you, payment recieved"); } else { llSay(0, "You either paid manually or the wrong amount, please click me to pay correctly"); } }

}</lsl>

Notes

Ideas for the Request Money dialog box: Parameter placements Example Call

See Also

Deep Notes

Search JIRA for related Issues

Signature

//function key llRequestMoney( key from, key to, string message );