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 Q&A
Value cannot be null (User Profile) (PLUS)
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="MasterJiq" data-source="post: 459486" data-attributes="member: 69646"><p>Hello,</p><p></p><p>Could someone please help me, I mean tell me which one I have to fix? When I clicked on user profile it appeared just like %count% & relationship seems not work.</p><p></p><p>[ATTACH=full]10563[/ATTACH]</p><p>[ATTACH=full]10564[/ATTACH]</p><p></p><p>On the emulator, I got this error message:</p><p></p><p>Exception:</p><p>System.ArgumentNullException: Value cannot be null.</p><p>Parameter name: source</p><p> at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending)</p><p> at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)</p><p> at Plus.Communication.Packets.Incoming.Users.GetRelationshipsEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\Incoming\Users\GetRelationshipsEvent.cs:line 20</p><p> at Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\PacketManager.cs:line 154</p><p> at Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\Haziq\Desktop\Emulator\HabboHotel\GameClients\GameClient.cs:line 73</p><p></p><p>Thanks. Hope someone could help me</p><p>[automerge]1587771768[/automerge]</p><p>GetRelationshipsEvent.cs</p><p></p><p>[CODE=csharp]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Users;</p><p>using Plus.Communication.Packets.Outgoing.Users;</p><p></p><p>namespace Plus.Communication.Packets.Incoming.Users</p><p>{</p><p> class GetRelationshipsEvent : IPacketEvent</p><p> {</p><p> public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)</p><p> {</p><p> Habbo Habbo = PlusEnvironment.GetHabboById(Packet.PopInt());</p><p> if (Habbo == null)</p><p> return;</p><p></p><p> var rand = new Random();</p><p> Habbo.Relationships = Habbo.Relationships.OrderBy(x => rand.Next()).ToDictionary(item => item.Key, item => item.Value);</p><p></p><p> int Loves = Habbo.Relationships.Count(x => x.Value.Type == 1);</p><p> int Likes = Habbo.Relationships.Count(x => x.Value.Type == 2);</p><p> int Hates = Habbo.Relationships.Count(x => x.Value.Type == 3);</p><p></p><p> Session.SendPacket(new GetRelationshipsComposer(Habbo, Loves, Likes, Hates));</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="MasterJiq, post: 459486, member: 69646"] Hello, Could someone please help me, I mean tell me which one I have to fix? When I clicked on user profile it appeared just like %count% & relationship seems not work. [ATTACH=full]10563[/ATTACH] [ATTACH=full]10564[/ATTACH] On the emulator, I got this error message: Exception: System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending) at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector) at Plus.Communication.Packets.Incoming.Users.GetRelationshipsEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\Incoming\Users\GetRelationshipsEvent.cs:line 20 at Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\PacketManager.cs:line 154 at Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\Haziq\Desktop\Emulator\HabboHotel\GameClients\GameClient.cs:line 73 Thanks. Hope someone could help me [automerge]1587771768[/automerge] GetRelationshipsEvent.cs [CODE=csharp]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Users; using Plus.Communication.Packets.Outgoing.Users; namespace Plus.Communication.Packets.Incoming.Users { class GetRelationshipsEvent : IPacketEvent { public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Habbo Habbo = PlusEnvironment.GetHabboById(Packet.PopInt()); if (Habbo == null) return; var rand = new Random(); Habbo.Relationships = Habbo.Relationships.OrderBy(x => rand.Next()).ToDictionary(item => item.Key, item => item.Value); int Loves = Habbo.Relationships.Count(x => x.Value.Type == 1); int Likes = Habbo.Relationships.Count(x => x.Value.Type == 2); int Hates = Habbo.Relationships.Count(x => x.Value.Type == 3); Session.SendPacket(new GetRelationshipsComposer(Habbo, Loves, Likes, Hates)); } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Value cannot be null (User Profile) (PLUS)
Top