Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. function onActionServerSide(){
  2. switch(params[0]){
  3. case "buyhat":
  4. findplayer(player.account).addweapon("Hat - Loud");
  5. break;
  6. }
  7. }
  8. //#CLIENTSIDE
  9. function onCreated(){
  10. this.chat = "Shop GUI Test";
  11. this.x = this.x + 0.5;
  12. this.y = this.y + 0.5;
  13. }
  14. function onActionLeftMouse(){
  15. showWindow();
  16. sleep(0.05);
  17. showWindow();
  18. }
  19. function showWindow(){
  20. new GuiControl("HatTest_Window") {
  21. useownprofile = true;
  22. x = screenwidth / 2 - width / 2;
  23. y = screenheight / 2 - height / 2;
  24. width = 300;
  25. height = 200;
  26. with(profile) {
  27. opaque = true;
  28. fillcolor = {
  29. 0, 0, 0, 200
  30. };
  31. border = 3;
  32. bordercolor = {
  33. 0, 0, 0, 250
  34. };
  35. }
  36. }
  37.  
  38. new GuiBitmapButtonCtrl("HatTest_Icon"){
  39. x = HatTest_Window.x + 125;
  40. y = HatTest_Window.y + 30;
  41. width = 40;
  42. height = 40;
  43. normalbitmap = "Loud_icon.png";
  44. mouseoverbitmap = "Loud_icon.png";
  45. pressedbitmap = "Loud_icon.png";
  46. }
  47. new GuiMLTextCtrl("HatTest_Text") {
  48. profile = GuiBlueMLTextProfile;
  49. x = HatTest_Window.x + 1;
  50. y = HatTest_Window.y + 10;
  51. width = 298;
  52. height = 160;
  53. text = "<font size=22><font face =Verdana><b><font color = white><center><br></b><font color = white><font size = 16><br><br>Are you sure you would<br>like to buy this hat?";
  54. }
  55. new GuiBitmapButtonCtrl("HatTest_Back") {
  56. useownprofile = true;
  57. x = HatTest_Window.x + 125;
  58. y = HatTest_Window.y + 160;
  59. text = " Close";
  60. width = 47;
  61. height = 25;
  62. with(profile) {
  63. opaque = true;
  64. fillcolor = {
  65. 0, 0, 0, 250
  66. };
  67. border = 3;
  68. bordercolor = {
  69. 0, 0, 0, 250
  70. };
  71. }
  72. }
  73. new GuiBitmapButtonCtrl("HatTest_Buy") {
  74. useownprofile = true;
  75. x = HatTest_Window.x + 115;
  76. y = HatTest_Window.y + 130;
  77. text = " Purchase";
  78. width = 65;
  79. height = 25;
  80. with(profile) {
  81. opaque = true;
  82. fillcolor = {
  83. 0, 0, 0, 250
  84. };
  85. border = 3;
  86. bordercolor = {
  87. 0, 0, 0, 250
  88. };
  89. }
  90. }
  91. }
  92. function HatTest_Buy.onAction(){
  93. HatTest_Window.destroy();
  94. HatTest_Buy.destroy();
  95. HatTest_Back.destroy();
  96. HatTest_Text.destroy();
  97. HatTest_Icon.destroy();
  98. Purchased();
  99. return;
  100. }
  101. function HatTest_Back.onAction(){
  102. HatTest_Window.destroy();
  103. HatTest_Icon.destroy();
  104. HatTest_Buy.destroy();
  105. HatTest_Back.destroy();
  106. HatTest_Text.destroy();
  107. }
  108. function Purchased(){
  109. triggerserver("gui",this.name,"buyhat",player.account);
  110. say2("Hat Purchased! Check your"NL"inventory to equip it.");
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement