Graal Pastebin

New Paste
Pasted on January 7, 2012.
View the raw file

function onActionServerSide() {
  switch (params[0]) {
  case "sendwarpdata":
    with(findplayer(params[3])) {
      player.x = params[1];
      player.y = params[2];
    }
    break;
  }
}
 
//#CLIENTSIDE
function onCreated() {
  this.on = 0;
  setTimer(0.05);
  for (temp.pl : allplayers) {
    pl.client.selec = false;
    client.selec = false;
  }
}
 
function onKeyPressed(code, Key) {
  if (code == 160) {
    //shift key
    if (this.on == 0) {
      this.on = 1;
      player.chat = "(Mousewarp: ON)";
    } else {
      this.on = 0;
      player.chat = "(Mousewarp: OFF)";
    }
  }
}
 
function onMouseDown(mode) {
  if (mode == "left" && this.on == 1) {
    for (temp.p: players) {
      if (mousex in | temp.p.x - 1, temp.p.x + 3 | && mousey in | temp.p.y, temp.p.y + 2 | ) {
        if (p.client.selec == true) {
          player.chat = "[Selected by another player...]";
        } else {
          client.sel = p.account;
          p.client.selec = true;
          player.chat = "[Selected" SPC p.account @ "(" @ p.client.selec @")]";
        }
      }
      elseif(client.sel != NULL && client.sel == p.account) {
        triggerserver("gui", name, "sendwarpdata", mousex, mousey, p.account);
        p.client.selec = false;
        client.sel = NULL;
      }
    }
  }
  if (mode == "right" && client.sel != NULL) {
    client.sel = NULL;
    p.client.selec = false;
    player.chat = "[Cleared Selecion]";
  }
}
 
  • 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
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60