Blockland Forums > Modification Help
Does every client have a number?
<< < (5/5)
Reinforcements:

--- Quote from: DYLANzzz on September 06, 2010, 03:38:12 PM ---I dont think you can get random hex value that way.

--- Code: ---function randomHex()
{
   for(%i=0; %i<6;%i++)
   {
      %rand = getRandom(0,15);
      switch(%rand)
      {
         case 10:
         %dig="A";

         case 11:
         %dig="B";

         case 12:
         %dig="C";

         case 13:
         %dig="D";

         case 14:
         %dig="E";

         case 15:
         %dig="F";

         default:
         %dig=%rand;
      }
      %hex=%hex@%dig;
   }
   return(%hex);
}
--- End code ---
You can call this fucntion I whipped up. Put it into your code. This would get a random number 0-15 (amount of choices a single hex digit could be) and if its 10-15 turns it into a letter.
It then combines it all into a single hex variable. Then it returns it.

--- End quote ---
Thanks!

--- Quote from: Chrono on September 06, 2010, 03:50:57 PM ---Broken code. Recheck it.

%rand = getrandom...
switch(%blah)
default:  %dig=%blah;

--- End quote ---
I thought it looked a little odd. Thanks to you too.
Reinforcements:
My mod beta worked! Thanks guys!
Bauklotz:

--- Quote from: ThinkInvisible on September 06, 2010, 11:19:16 AM ---A friend said that %a is the client

--- End quote ---

Actually no, a friend said that %a was the index of that player on the NPL_List (playerlist).
Reinforcements:

--- Quote from: Bauklotz on September 11, 2010, 12:57:41 AM ---Actually no, a friend said that %a was the index of that player on the NPL_List (playerlist).

--- End quote ---
Ho ho ho, an index you say? :D That may come in handy.
Navigation
Message Index
Previous page

Go to full version