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
[Plus EMU] Custom Rig Command
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="JayC" data-source="post: 397523" data-attributes="member: 36373"><p>Okay, thank you for this information.</p><p></p><p>Check the Item class and let me see the code for there. Verify that the array in the habbo class is defined and being set properly. The emulator is on my other laptop, so when I return home tomorrow I can verify I did not leave out any code snippets. (Now that I am thinking about it I think there was another one... lmao)</p><p>[doublepost=1486084628,1486076582][/doublepost]Okay add this method to the Item.cs file (or verify it is there)</p><p></p><p>[CODE]public static string[] RandomizeStrings(string[] arr)</p><p> {</p><p> List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();</p><p> // Add all strings from array</p><p> // Add new random int each time</p><p> foreach (string s in arr)</p><p> {</p><p> list.Add(new KeyValuePair<int, string>(_random.Next(), s));</p><p> }</p><p> // Sort the list by the random number</p><p> var sorted = from item in list</p><p> orderby item.Key</p><p> select item;</p><p> // Allocate new string array</p><p> string[] result = new string[arr.Length];</p><p> // Copy values to array</p><p> int index = 0;</p><p> foreach (KeyValuePair<int, string> pair in sorted)</p><p> {</p><p> result[index] = pair.Value;</p><p> index++;</p><p> }</p><p> // Return copied array</p><p> return result;</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 397523, member: 36373"] Okay, thank you for this information. Check the Item class and let me see the code for there. Verify that the array in the habbo class is defined and being set properly. The emulator is on my other laptop, so when I return home tomorrow I can verify I did not leave out any code snippets. (Now that I am thinking about it I think there was another one... lmao) [doublepost=1486084628,1486076582][/doublepost]Okay add this method to the Item.cs file (or verify it is there) [CODE]public static string[] RandomizeStrings(string[] arr) { List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>(); // Add all strings from array // Add new random int each time foreach (string s in arr) { list.Add(new KeyValuePair<int, string>(_random.Next(), s)); } // Sort the list by the random number var sorted = from item in list orderby item.Key select item; // Allocate new string array string[] result = new string[arr.Length]; // Copy values to array int index = 0; foreach (KeyValuePair<int, string> pair in sorted) { result[index] = pair.Value; index++; } // Return copied array return result; }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
[Plus EMU] Custom Rig Command
Top