LlGiveMoney
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: integer llGiveMoney( key destination, integer amount ); |
参数:
|
| 返回值:返回一个始终为零的整数。相比之下,lltransferlindendolars 返回一个键,该键可用于将函数调用匹配到生成的 transaction _ result 事件和事务历史。 |
| 注意事项 |
|---|
*不依赖于权限的自动授予状态。始终使用运行时权限事件。
*欺诈和盗窃都是 ll: 违反服务条款和犯罪条款。滥用这个功能,你就有被禁止和被起诉的危险。此外,我可以冻结任何人的帐户,钱被转移,并恢复到它的合法所有人。这可能包括从被冻结的交易所的第三方交易所和账户中取回它。这个系统对欺诈行为并不友好。 |
| 示例 |
|---|
示例一
// Pay 100 L$ to Fred Bloggs when he touches this prim, then die
// Compare this example with that shown under llTransferLindenDollars
string Recipient = "Fred Bloggs"; // Authorised recipient
integer Amount = 100; // Amount to pay Fred when he touches the prim
integer DebitPerms;
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); // Get toucher's (i.e. Fred's) UUID
llGiveMoney(id, Amount); // Give him the money
llDie(); // Die so Fred can't keep taking money
}
}
|
| 相关函数 |
|---|
| llGetPermissions--获得许可
llGetPermissionsKey--找到授予许可的探员 llRequestPermissions--请求权限 llTransferLindenDollars llSetPayPrice |
| 相关事件 |
|---|
| run time permissions--允许接收事件 |