Advertisement
Guest User

Untitled

a guest
Mar 21st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. function onActionServerSide() {
  2. if (params[0] == "sendchat") {
  3. for (pl : allplayers) {
  4. if (pl.level == findplayer(params[3]).level) {
  5. triggerclient("gui", this.name, "displaychat", params[1], params[2]);
  6. }
  7. }
  8. }
  9. }
  10.  
  11.  
  12. //#CLIENTSIDE
  13. function onCreated() {
  14. onTimeOut();
  15. }
  16.  
  17. function onPlayerLogin(pl) {
  18. ChatBar.width = 300;
  19. ChatBar.alpha = 0.6;
  20. ChatBar.useownprofile = true;
  21. ChatBar.profile.bitmap = "Test_textedit.png";
  22. ChatBar.height = 25;
  23. ChatBar.y = GraalControl.height - 28;
  24. ChatBar.x = 5;
  25. }
  26.  
  27. function onTimeOut() {
  28. if (ChatBar.visible = true) {
  29. ShowChat();
  30. if (this.dropdown == true) {
  31. Chat_WindowScroll.scrollto(100000, 100000);
  32. this.dropdown = false;
  33. }
  34. }
  35. else {
  36. this.dropdown = true;
  37. Chat_Window.hide();
  38. Chat_WindowScroll.hide();
  39. }
  40. setTimer(0.05);
  41. }
  42.  
  43. function ShowChat() {
  44. Chat_Window.show();
  45. Chat_WindowScroll.show();
  46.  
  47. new GuiScrollCtrl("Chat_WindowScroll") {
  48. profile = GuiBlueScrollProfile;
  49. x = 5;
  50. y = GraalControl.height - 130;
  51. width = 300;
  52. height = 100;
  53. hScrollBar = "dynamic";
  54. vScrollBar = "alwaysOn";
  55.  
  56. new GuiMLTextCtrl("Chat_Window") {
  57. profile = GuiBlueMLTextProfile;
  58. horizsizing = "width";
  59. width = 279;
  60. }
  61. }
  62. }
  63.  
  64. function onPlayerChats() {
  65. Chat_WindowScroll.scrollto(100000, 100000);
  66. triggerserver("gui", this.name, "sendchat", player.account, player.chat, player.account);
  67. }
  68.  
  69. function ChatBar.onAction(){
  70. }
  71.  
  72. function onActionClientside() {
  73. if (params[0] == "displaychat") {
  74. Chat_Window.addtext(params[1] @ ":" SPC params[2] @ "<p></p>", true);
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement