関数: llSetPayPrice( integer price, list quick_pay_buttons );
支払いのテキストフィールドの初期額と、なんらかのこのオブジェクトのPayが選択されたときに表示するダイアログの支払いボタンを設定します。
| • integer
| price
| –
| PAY_* 定数あるいは正数
|
|
| • list
| quick_pay_buttons
| –
| Four PAY_* 定数と(あるいは)複数の正数の値
|
|
この関数はmoneyイベントを実行しなかったステートから呼び出された場合は効果ありません。
例
これはpriceフィールドを除いて、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");
}
}
}
この項目はあなたにとって参考にならない項目ですか?もしかしたら
LSL Wikiの関連した項目が参考になるかもしれません。