Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. static string addColourToName(string playerName)
  2.         {
  3.             string[] chars = convertToArray(playerName);
  4.             string formatName = "";
  5.            
  6.             int b = 0;
  7.             int c = 0;
  8.             int n = 0;
  9.  
  10.             string endColor = "</color>";
  11.  
  12.             Loop:
  13.             for (int i = b; i < playerName.Length; i++)
  14.             {
  15.                 n++;
  16.                 formatName += $"{coloursUp[i - b]}{chars[i + b]}{endColor}";
  17.                 if (i > coloursUp.Count)
  18.                 { c++; break; }
  19.             }
  20.  
  21.             if (n < playerName.Length)
  22.             { b = (coloursUp.Count * c); goto Loop; }
  23.  
  24.             return formatName;
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement