Graal Pastebin
New PastePasted on January 5, 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); } 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 | ) { client.sel = p.account; } elseif(client.sel != NULL && client.sel == p.account) { triggerserver("gui", name, "sendwarpdata", mousex, mousey, p.account); client.sel = NULL; } } } if (mode == "right" && client.sel != NULL) { client.sel = NULL; } } /* The below is just something I added so I could identify if I have a player selected or not It isn't vital to have this and changing the players chat would do nicely too. */ function onTimeout() { if (client.sel != NULL) { MW_Window.visible = true; MW_Player.text = "Selected:" SPC client.sel; } else { MW_Window.visible = false; } setTimer(0.05); }