llSetPayPrice(integer price, list quick_pay_buttons)
Sets the
values of the
buttons and the
text box
default for the Pay dialog -- when a
user right-clicks on the
object and selects "Pay",
llSetPayPrice will affect what buttons exist, what their values are, and whether or not there is a manual payment text entry box.
The number of
quick_pay_buttons is limited to 4. If there are more than 4 items in the list, the extra values are ignored.
A space appears instead of a button if its value is:
- not of TYPE_INTEGER
- zero
- PAY_HIDE.
If the value of a button is less than 1, it is not displayed unless its value is
PAY_DEFAULT, in which case the value presented is the default value for that button position.
If
price is set to
PAY_HIDE, the Manual Money Input Box (MMIB) is hidden.
This
function has no effect if the
state that it's used in does not implement a
money event handler.
Note: The pay price popup is a property of the
prim.
Resetting or deleting the script will not reset it to default. Only calling
llSetPayPrice with the default settings will.
Security Warning |
Always (ALWAYS!) check the amount paid in your money() event. This UI element isn't modal, and has had bugs exploited in the past.
Never trust the client software to be secure.
|
|
Button Order:
Defaults:
Special Values | Value | Alternate | Description |
PAY_HIDE | -1 | 0 | Hides the button or MMIB |
PAY_DEFAULT | -2 | | Uses the default value for this quick pay button or the MMIB (in the case of the MMIB it is set to the last value typed in) |
Examples:
//Disable pay box
llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
//Restrict to one price
llSetPayPrice(PAY_HIDE, [50, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
//Restrict to one price (alternative)
llSetPayPrice(PAY_HIDE, [50]);
//Reset to default
llSetPayPrice(PAY_DEFAULT, [PAY_DEFAULT, PAY_DEFAULT, PAY_DEFAULT, PAY_DEFAULT]);
Lucca Kitty: Anyone else have any issues getting this to work in any prim other than root?
Meroth Junge: I don't think that is an issue. I can see no reason that a linked object should accept payment.
Yumi Murakami: However, linked objects do in fact accept payment - the money event is correctly routed to the appropriate clicked prim - so this may be a bug.
Merlin Alphabeta: I once made a raffle ticket game where people bought the actual ticket prims from the linked object - good sample for a reason why a linked object should accept payment, and proof that it works (and has been for a long time)
Harald Nomad: Data Linden claims this is a feature, not a bug (7/4/07). Child prims can have a script with a money event and can accept payments, but the script cannot set the payment buttons, like in the root prim. However, can't find any documentation that supports his claim.
Kidsune Kirax: It's true, you can use money() in child prims, but you can't set the payment buttons. But, you can tell the child prim to send a link message to the root, and thus the root sets the payment buttons, which then works fine.
This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.
Functions | money