LlTransferLindenDollars/ja

From Second Life Wiki
Jump to navigation Jump to search

要約

関数: key llTransferLindenDollars( key destination, integer amount );

amount L$ のお金をスクリプトのオーナーから destination のアバターへ転送します。
このkeyはtransaction historyに表示されます。もし処理が成功すれば、transaction_resultを key で返します。

• key destination アバターの UUID
• integer amount L$ の額, ゼロより大きくないといけない (amount > 0)

実行するには、llRequestPermissions による PERMISSION_DEBIT 権限がオーナーから与えられなければなりません。 transaction_resultの返り値を使用しない場合、この機能の代わりにllGiveMoneyを使用することを考慮してください。

警告

  • 権限の自動付与に頼らないようにしましょう。常に run_time_permissions イベントを使用しましょう。
  • スクリプトに PERMISSION_DEBIT の権限が不足していると、スクリプトはエラーを DEBUG_CHANNEL で叫び、操作に失敗します (しかしスクリプトは処理を続けます)。
  • PERMISSION_DEBIT がオーナー以外の人から許可され、関数が呼び出されると、 DEBUG_CHANNEL でエラーが叫ばれます。
  • いったん PERMISSION_DEBIT 権限が付与されると、スクリプトの中で (例えば、新しい llRequestPermissions 呼び出しなどにより) 権限をはく奪することができません。スクリプトはオブジェクトが derez (削除、取り外し、取り込み) されない限り権限が失われません。
  • オブジェクトからほかのオブジェクトへ払うことはできません。
  • グルーブに譲渡したオブジェクトは、お金を渡すことができません (権限は付与されません) 。
  • 地域でその住人が所有しているスクリプト全体で、30 秒間に 30 回の支払制限があります。支払いが度を過ぎるとスクリプトエラーを発生させ、過剰レートが収まるまでは支払いを中断します。以前は、ペースの速い支払いは飛び飛びに失敗していました。
  • 一度 PERMISSION_DEBIT 権限を持ったスクリプトは、アカウントの L$ を空にできます。
    • 詐欺と窃盗はLinden Labの違反と犯罪の両方にあたります。この関数を悪用すると、BAN されたり、法的措置がとられたりするリスクを冒すこととなります。さらに、LL はお金が振り込まれたアカウントを差し止め、正当な持ち主にお金を返すこともあります。関係のない取引によるものも差し戻しされ、取引にかかわったアカウントが差し止められることもあります。このシステムは詐欺師に親切なようにはできていません。
All Issues ~ Search JIRA for related Bugs

サンプル

// Pay 100 L$ to Fred Bloggs when he touches this prim
// Die if the transfer of funds was successful, else keep running

string  Recipient = "Fred Bloggs";      // Authorised recipient
integer Amount = 100;                   // Amount to pay Fred when he touches the prim

integer DebitPerms;
key     TransactionID;

default
{
    state_entry()
    {
        // Ask the owner for permission to debit their account
        llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
    }

    run_time_permissions (integer perm)
    {
        if  (perm & PERMISSION_DEBIT)
            DebitPerms = TRUE;
    }

    touch_start(integer num_detected)
    {
        if (!DebitPerms)
            return;  // Cannot proceed - debit permissions not granted
        if (llDetectedName(0) != Recipient)
            return;  // unauthorised person is touching - ignore

        key id = llDetectedKey(0);
        TransactionID = llTransferLindenDollars(id, Amount);
    }

    transaction_result(key id, integer success, string data)
    {
        if (id != TransactionID)
            return;          // Ignore if not the expected transaction
        
        if (success)
        {
            llOwnerSay( "Transfer of L$ to " + Recipient + " was successful");
            llSleep(1.0);
            llDie();          // Die so Fred can't keep taking money
        }
        else
            llOwnerSay( "Transfer of L$ failed");
            // Keep the script running so Fred can try again
    }
}

注意点

  • released on main server channel on 3-Dec-2011

関連項目

イベント

•  run_time_permissions 権限取得イベント
•  transaction_result
•  money

関数

•  llGetPermissions 付与されている権限を取得します
•  llGetPermissionsKey 権限を許可したエージェントを取得します
•  llRequestPermissions 権限を要求します
•  llGiveMoney
•  llSetPayPrice

記事

•  権限/スクリプト

特記事項

Search JIRA for related Issues

Signature

function key llTransferLindenDollars( key destination, integer amount );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。