Advertisement
Guest User

here u go

a guest
Apr 18th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. //Variables
  2. public static string[] players = new string[1000];
  3. public static int[] points = new int[1000];
  4. public static Connection conn;
  5. public static Client client;
  6. //OnMessage
  7.  
  8. private static void OnMessage(object sender, PlayerIOClient.Message m)
  9. {
  10. switch (m.Type)
  11. {
  12. case "init":
  13. conn.Send("init2");
  14. break;
  15. case "add":
  16. players[m.GetInt(0)] = m.GetString(1);
  17. points[m.GetInt(0)] = 0;
  18. break;
  19. case "say":
  20. if(m.GetString(1) == "!points")
  21. {
  22. conn.Send("say", players[m.GetInt(0)] + "> You have " + points[m.GetInt(0)].ToString() + " points.");
  23. }
  24. break;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement