Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onActionServerSide(){
- switch(params[0]){
- case "buyhat":
- findplayer(player.account).addweapon("Hat - Loud");
- break;
- }
- }
- //#CLIENTSIDE
- function onCreated(){
- this.chat = "Shop GUI Test";
- this.x = this.x + 0.5;
- this.y = this.y + 0.5;
- }
- function onActionLeftMouse(){
- showWindow();
- sleep(0.05);
- showWindow();
- }
- function showWindow(){
- new GuiControl("HatTest_Window") {
- useownprofile = true;
- x = screenwidth / 2 - width / 2;
- y = screenheight / 2 - height / 2;
- width = 300;
- height = 200;
- with(profile) {
- opaque = true;
- fillcolor = {
- 0, 0, 0, 200
- };
- border = 3;
- bordercolor = {
- 0, 0, 0, 250
- };
- }
- }
- new GuiBitmapButtonCtrl("HatTest_Icon"){
- x = HatTest_Window.x + 125;
- y = HatTest_Window.y + 30;
- width = 40;
- height = 40;
- normalbitmap = "Loud_icon.png";
- mouseoverbitmap = "Loud_icon.png";
- pressedbitmap = "Loud_icon.png";
- }
- new GuiMLTextCtrl("HatTest_Text") {
- profile = GuiBlueMLTextProfile;
- x = HatTest_Window.x + 1;
- y = HatTest_Window.y + 10;
- width = 298;
- height = 160;
- 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?";
- }
- new GuiBitmapButtonCtrl("HatTest_Back") {
- useownprofile = true;
- x = HatTest_Window.x + 125;
- y = HatTest_Window.y + 160;
- text = " Close";
- width = 47;
- height = 25;
- with(profile) {
- opaque = true;
- fillcolor = {
- 0, 0, 0, 250
- };
- border = 3;
- bordercolor = {
- 0, 0, 0, 250
- };
- }
- }
- new GuiBitmapButtonCtrl("HatTest_Buy") {
- useownprofile = true;
- x = HatTest_Window.x + 115;
- y = HatTest_Window.y + 130;
- text = " Purchase";
- width = 65;
- height = 25;
- with(profile) {
- opaque = true;
- fillcolor = {
- 0, 0, 0, 250
- };
- border = 3;
- bordercolor = {
- 0, 0, 0, 250
- };
- }
- }
- }
- function HatTest_Buy.onAction(){
- HatTest_Window.destroy();
- HatTest_Buy.destroy();
- HatTest_Back.destroy();
- HatTest_Text.destroy();
- HatTest_Icon.destroy();
- Purchased();
- return;
- }
- function HatTest_Back.onAction(){
- HatTest_Window.destroy();
- HatTest_Icon.destroy();
- HatTest_Buy.destroy();
- HatTest_Back.destroy();
- HatTest_Text.destroy();
- }
- function Purchased(){
- triggerserver("gui",this.name,"buyhat",player.account);
- say2("Hat Purchased! Check your"NL"inventory to equip it.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement