aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs49
1 files changed, 47 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 09cd4af..2d1b02d 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -36,6 +36,7 @@ using libsecondlife;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Environment; 37using OpenSim.Region.Environment;
38using OpenSim.Region.Environment.Interfaces; 38using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Modules;
39using OpenSim.Region.Environment.Modules.LandManagement; 40using OpenSim.Region.Environment.Modules.LandManagement;
40using OpenSim.Region.Environment.Scenes; 41using OpenSim.Region.Environment.Scenes;
41using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; 42using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
@@ -1609,8 +1610,42 @@ namespace OpenSim.Region.ScriptEngine.Common
1609 1610
1610 public int llGiveMoney(string destination, int amount) 1611 public int llGiveMoney(string destination, int amount)
1611 { 1612 {
1613 LLUUID invItemID=InventorySelf();
1614 if(invItemID == LLUUID.Zero)
1615 return 0;
1616
1612 m_host.AddScriptLPS(1); 1617 m_host.AddScriptLPS(1);
1613 NotImplemented("llGiveMoney"); 1618
1619 if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
1620 return 0;
1621
1622 if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0)
1623 {
1624 LSLError("No permissions to give money");
1625 return 0;
1626 }
1627
1628 LLUUID toID=new LLUUID();
1629
1630 if(!LLUUID.TryParse(destination, out toID))
1631 {
1632 LSLError("Bad key in llGiveMoney");
1633 return 0;
1634 }
1635
1636 IMoneyModule money=World.RequestModuleInterface<IMoneyModule>();
1637
1638 if(money == null)
1639 {
1640 NotImplemented("llGiveMoney");
1641 return 0;
1642 }
1643
1644 bool result=money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount);
1645
1646 if(result)
1647 return 1;
1648
1614 return 0; 1649 return 0;
1615 } 1650 }
1616 1651
@@ -5101,7 +5136,17 @@ namespace OpenSim.Region.ScriptEngine.Common
5101 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons) 5136 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons)
5102 { 5137 {
5103 m_host.AddScriptLPS(1); 5138 m_host.AddScriptLPS(1);
5104 NotImplemented("llSetPayPrice"); 5139
5140 if(quick_pay_buttons.Data.Length != 4)
5141 {
5142 LSLError("List must have 4 elements");
5143 return;
5144 }
5145 m_host.ParentGroup.RootPart.PayPrice[0]=price;
5146 m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0];
5147 m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1];
5148 m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2];
5149 m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3];
5105 } 5150 }
5106 5151
5107 public LSL_Types.Vector3 llGetCameraPos() 5152 public LSL_Types.Vector3 llGetCameraPos()