LlSetPayPrice/ja - Second Life Wiki

LlSetPayPrice/ja

From Second Life Wiki

LlSetPayPrice/ja
Jump to: navigation, search
Image:Emblem-important-red.png セキュリティ 危険性

常に (常に!) あなたのmoney()イベントで支払われる額を確認しましょう. このUI要素はモーダレスで、過去に脆弱性のバグを持っています。 支払いのための制約手段だけのために、この関数を使用しないでください。クライアントソフトウェアがセキュアであることは一度も信用されていません。常に支払い額が予期された値であると、正当性を確認しましょう。

関数: llSetPayPrice( integer price, list quick_pay_buttons );

支払いのテキストフィールドの初期額と、なんらかのこのオブジェクトのPayが選択されたときに表示するダイアログの支払いボタンを設定します。

• integer price PAY_* 定数あるいは正数
• list quick_pay_buttons Four PAY_* 定数と(あるいは)複数の正数の値

この関数はmoneyイベントを実行しなかったステートから呼び出された場合は効果ありません。

定数 Alt 解説
PAY_HIDE -1
0
簡易支払いボタンを隠します。
PAY_DEFAULT -2 簡易支払いボタンに初期値を使用します。
ボタンの並び
1
2
3
4
初期値
$1 $5
$10 $20

警告

  • この関数はオブジェクトに支払い可能な金額の限界が保証されるものではないでしょう。

これは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");
        }
    }
}

関連項目

イベント

•  money

関数

•  llGiveMoney

ディープノート

要因

Bug - A problem which impairs or prevents the functions of the product. Open - The issue is open and ready for the assignee to start work on it.    llSetPayPriceが子プリム上では動きません - Marcoh Larsen!
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。