Graal Pastebin

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

function onActionServerSide(trig) {
  if (trig == "buy") {
    echo("Trigger check");
    player.addweapon(params[2]);
    client.gold -= params[1];
  }
}
 
//#CLIENTSIDE
function onMouseDown() {
  if (mousex in | this.x, this.x + width | && mousey in | this.y, this.y + height | ) {
    Shop_Window1.visible = true;
  }
}
 
function SetItem(itemname, itemprice, itemdesc, realitem) {
  Shop_Text1.text = "Item:" SPC itemname;
  Shop_Text2.text = "Price:" SPC itemprice;
  Shop_MultiLine1.text = itemdesc;
  client.realitem = realitem;
  client.store1 = itemname;
  client.store2 = itemprice;
}
 
function Shop_Button1.onAction() {
  if (client.gold > client.store1 || client.gold == client.store1) {
    if (!(hasweapon((@client.realitem)))) {
      triggerserver("gui", this.name, "buy", client.store2, client.realitem);
    }
  }
}
  • 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