Graal Pastebin

New Paste
Pasted on November 13, 2011.
View the raw file

function onActionServerSide() {
  if (params[0] == "purchase") {
    client.gold -= abs(params[2]);
    player.addweapon(params[1]);
  }
}
 
//#CLIENTSIDE
 
// Your other code..
 
public function displayItem(itemname, itemprice, itemdesc, realitem) {
  this.shop_price = itemprice;
  this.shop_realitem = realitem;
  Shop_Text1.text = "Item:" SPC itemname;
  Shop_Text2.text = "Price:" SPC itemprice;
  Shop_MultiLine1.text = itemdesc;
  Shop_Window1.visible = true;
}
 
function Shop_Button1.onAction() {
  if (client.gold >= this.shop_price) {
    if (findweapon(this.shop_realitem) != NULL) {
      triggerserver("gui", this.name, "purchase", this.shop_realitem, this.shop_price);
    }
  }
}
 
function Shop_Button2.onAction() {
  Shop_Window1.visible = false;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31