Suggest default amounts for the pay text field and pay buttons of the appearing dialog when someone chooses to pay this object.

Syntax

void llSetPayPrice( integer price, list quick_pay_buttons );

Forced delay: 0.0 seconds. Energy: 10.0.

Parameters

integer price
PAY_* constant or positive value (including zero)
list quick_pay_buttons
Four PAY_* constants and/or positive integer values (zero is not shown)

Constants

ConstantAltDescription
PAY_HIDE-10Hides this quick pay button.
PAY_DEFAULT-2Use the default value for this quick pay button.
Button Order
12
34
Defaults
$1$5
$10$20

Caveats

Examples

This will give the user a dialog box without the price field and only one button with a value of 150.

llSetPayPrice(PAY_HIDE, [150,PAY_HIDE,PAY_HIDE,PAY_HIDE])
integer price = 10;

default
{
    state_entry()
    {
        llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
        llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_DEBIT)
            state cash;
    }
}

state cash
{
    state_entry()
    {
        llSetPayPrice(price, [price ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
    }
    money(key id, integer amount)
    {
        if(amount != price)
        {
            llGiveMoney(id, amount);
            llInstantMessage(id, "You paid "+(string)amount+", which is the wrong price, the price is: "+(string)price);
        }
        else
        {
            //insert your give code here.
            llInstantMessage(id, "You paid the right price");
        }
    }
}

See also

Events

Functions

Deep notes

Issues

Tests