Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- join("guiprofiles");
- function onActionBuyHat() {
- temp.hat_name = params[1];
- temp.hat_price = params[2];
- echo("Buying" SPC temp.hat_name);
- if (temp.hat_name in clientr.questhats.tokenize(",")) {
- return;
- } else {
- if (!(player.rupees = > temp.hat_price)) {
- echo(player.account SPC "doesn't have enough!");
- } else {
- player.rupees -= temp.hat_price;
- player.clientr.questhats.add(temp.hat_name);
- }
- }
- }
- //#CLIENTSIDE
- function onCreated() {
- DrawGUI();
- }
- function DrawGUI() {
- new GuiControl("HatShop_StatusBar") {
- useownprofile = true;
- width = 155;
- height = 20;
- x = screenwidth / 2 - width / 2;
- y = screenheight / 2 - height / 2 - height * 3.75;
- visible = false;
- profile.opaque = true;
- profile.border = 1;
- profile.fillcolor = {
- 0, 0, 0, 200
- };
- new GuiTextCtrl("HatShop_Text") {
- useownprofile = true;
- width = 155;
- height = 20;
- x = 5;
- y = 0;
- profile.fontstyle = "b";
- }
- }
- new GuiControl("HatShop_StatusBar2") {
- useownprofile = true;
- width = 155;
- height = 20;
- x = screenwidth / 2 - width / 2;
- y = screenheight / 2 - height / 2 - height * 4.9;
- visible = false;
- profile.opaque = true;
- profile.border = 1;
- profile.fillcolor = {
- 0, 0, 0, 200
- };
- new GuiTextCtrl("HatShop_Text2") {
- useownprofile = true;
- width = 155;
- height = 20;
- x = 5;
- y = 0;
- profile.fontstyle = "b";
- }
- }
- new GuiControl("HatShop_Window") {
- npcname = this;
- profile = "DefaultBacking";
- width = 155;
- height = 125;
- x = screenwidth / 2 - width / 2;
- y = screenheight / 2 - height / 2;
- visible = false;
- new GuiShowImgCtrl("HatShop_HatImage") {
- width = 50;
- height = 50;
- x = 50;
- y = 15;
- }
- new GuiShowImgCtrl("HatShop_Buy") {
- image = "delt_iphone_hatbuttonbuy.png";
- width = 66;
- height = 40;
- x = 10;
- y = 75;
- }
- new GuiShowImgCtrl("HatShop_Close") {
- image = "delt_iphone_hatbuttonclose.png";
- width = 66;
- height = 40;
- x = 80;
- y = 75;
- }
- }
- }
- function onMouseDown() {
- if (mousex in | this.x, this.x + 2 | && mousey in | this.y, this.y + 2 | ) {
- SetHat(this.hat_name, this.hat_price, this.hat_icon, this.hat_title);
- }
- }
- function SetHat(hat_name, hat_price, hat_icon, hat_title) {
- HatShop_Window.visible = true;
- HatShop_StatusBar2.visible = true;
- HatShop_StatusBar.visible = true;
- HatShop_Text.text = "Price:" SPC hat_price;
- HatShop_HatImage.image = hat_icon;
- HatShop_Text2.text = hat_title;
- }
- function HatShop_Buy.onMouseDown() {
- if (HatShop_Window.npcname == this) {
- triggeraction(this.x, this.y, "BuyHat", "", this.hat_name, this.hat_price);
- }
- }
- function HatShop_Close.onMouseDown() {
- HatShop_Window.visible = false;
- HatShop_StatusBar.visible = false;
- HatShop_StatusBar2.visible = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement