public LSL_String llTransferLindenDollars(LSL_String destination, LSL_Integer amt)
{
LSL_String transferID = UUID.Random().ToString();
IMoneyModule moneyMod = World.RequestModuleInterface<IMoneyModule>();
LSL_String data = "";
LSL_Integer success = LSL_Integer.FALSE;
TaskInventoryItem item = m_host.TaskInventory[m_itemID];
UUID destID;
if (item.PermsGranter == UUID.Zero || (item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
data = llList2CSV(new LSL_Types.list("MISSING_PERMISSION_DEBIT"));
else if (!UUID.TryParse(destination, out destID))
data = llList2CSV(new LSL_Types.list("INVALID_AGENT"));
else if (amt <= 0)
data = llList2CSV(new LSL_Types.list("INVALID_AMOUNT"));
else if (World.UserAccountService.GetUserAccount(World.RegionInfo.AllScopeIDs, destID) == null)
data = llList2CSV(new LSL_Types.list("LINDENDOLLAR_ENTITYDOESNOTEXIST"));
else if (m_host.ParentEntity.OwnerID == m_host.ParentEntity.GroupID)
data = llList2CSV(new LSL_Types.list("GROUP_OWNED"));
else if (moneyMod != null)
{
success = moneyMod.Transfer(UUID.Parse(destination), m_host.OwnerID, amt, "");
data = llList2CSV(success ? new LSL_List(destination, amt) : new LSL_Types.list("LINDENDOLLAR_INSUFFICIENTFUNDS"));
}
else
data = llList2CSV(new LSL_Types.list("SERVICE_ERROR"));
m_ScriptEngine.PostScriptEvent(m_itemID, m_host.UUID, new EventParams(
"transaction_result", new Object[] {
transferID, success, data},
new DetectParams[0]), EventPriority.FirstStart);
return transferID;
}