Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PLUS EMU] Super Wired: Give Diamonds [R2]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cammy" data-source="post: 437346" data-attributes="member: 46853"><p>This worked for me and I'm using R1.</p><p></p><p>Great release, thanks!</p><p>[doublepost=1533664180,1533249375][/doublepost]Can anyone help me? I tried changing it to give credits, it doesn't throw any errors however it's still giving me Diamonds.</p><p>[SPOILER="this"]</p><p>using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p>using System.Collections.Concurrent;</p><p></p><p>using Plus.Communication.Packets.Incoming;</p><p>using Plus.HabboHotel.Rooms;</p><p>using Plus.HabboHotel.Users;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Chat;</p><p>using Plus.Communication.Packets.Outgoing.Inventory.Purse;</p><p></p><p>namespace Plus.HabboHotel.Items.Wired.Boxes.Effects</p><p>{</p><p> class GiveCreditsBox : IWiredItem</p><p> {</p><p> public Room Instance { get; set; }</p><p></p><p> public Item Item { get; set; }</p><p></p><p> public WiredBoxType Type { get { return WiredBoxType.EffectGiveCredits; } }</p><p></p><p> public ConcurrentDictionary<int, Item> SetItems { get; set; }</p><p></p><p> public string StringData { get; set; }</p><p></p><p> public bool BoolData { get; set; }</p><p></p><p> public string ItemsData { get; set; }</p><p></p><p> public GiveCreditsBox(Room Instance, Item Item)</p><p> {</p><p> this.Instance = Instance;</p><p> this.Item = Item;</p><p> this.SetItems = new ConcurrentDictionary<int, Item>();</p><p> }</p><p></p><p> public void HandleSave(ClientPacket Packet)</p><p> {</p><p> int Unknown = Packet.PopInt();</p><p> string Coin = Packet.PopString();</p><p></p><p> this.StringData = Coin;</p><p> }</p><p></p><p> public bool Execute(params object[] Params)</p><p> {</p><p> if (Params == null || Params.Length == 0)</p><p> return false;</p><p></p><p> Habbo Owner = PlusEnvironment.GetHabboById(Item.UserID);</p><p> if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards"))</p><p> return false;</p><p></p><p> Habbo Player = (Habbo)Params[0];</p><p> if (Player == null || Player.GetClient() == null)</p><p> return false;</p><p></p><p> RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);</p><p> if (User == null)</p><p> return false;</p><p></p><p> if (String.IsNullOrEmpty(StringData))</p><p> return false;</p><p></p><p> int Amount;</p><p> Amount = Convert.ToInt32(StringData);</p><p> if (Amount > 10001)</p><p> {</p><p> Player.GetClient().SendNotification("You can't send +10000 credits.");</p><p> return false;</p><p> }</p><p> else</p><p> {</p><p> Player.GetClient().GetHabbo().Credits += Amount;</p><p> Player.GetClient().SendMessage(new CreditBalanceComposer(Player.GetClient().GetHabbo().Credits));</p><p></p><p> return true;</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/SPOILER]</p><p>EDIT: nvm I'm an idiot. <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="cammy, post: 437346, member: 46853"] This worked for me and I'm using R1. Great release, thanks! [doublepost=1533664180,1533249375][/doublepost]Can anyone help me? I tried changing it to give credits, it doesn't throw any errors however it's still giving me Diamonds. [SPOILER="this"] using System; using System.Linq; using System.Text; using System.Collections.Generic; using System.Collections.Concurrent; using Plus.Communication.Packets.Incoming; using Plus.HabboHotel.Rooms; using Plus.HabboHotel.Users; using Plus.Communication.Packets.Outgoing.Rooms.Chat; using Plus.Communication.Packets.Outgoing.Inventory.Purse; namespace Plus.HabboHotel.Items.Wired.Boxes.Effects { class GiveCreditsBox : IWiredItem { public Room Instance { get; set; } public Item Item { get; set; } public WiredBoxType Type { get { return WiredBoxType.EffectGiveCredits; } } public ConcurrentDictionary<int, Item> SetItems { get; set; } public string StringData { get; set; } public bool BoolData { get; set; } public string ItemsData { get; set; } public GiveCreditsBox(Room Instance, Item Item) { this.Instance = Instance; this.Item = Item; this.SetItems = new ConcurrentDictionary<int, Item>(); } public void HandleSave(ClientPacket Packet) { int Unknown = Packet.PopInt(); string Coin = Packet.PopString(); this.StringData = Coin; } public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) return false; Habbo Owner = PlusEnvironment.GetHabboById(Item.UserID); if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) return false; Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) return false; RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username); if (User == null) return false; if (String.IsNullOrEmpty(StringData)) return false; int Amount; Amount = Convert.ToInt32(StringData); if (Amount > 10001) { Player.GetClient().SendNotification("You can't send +10000 credits."); return false; } else { Player.GetClient().GetHabbo().Credits += Amount; Player.GetClient().SendMessage(new CreditBalanceComposer(Player.GetClient().GetHabbo().Credits)); return true; } } } } [/SPOILER] EDIT: nvm I'm an idiot. :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PLUS EMU] Super Wired: Give Diamonds [R2]
Top