Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   testplayer(mousex,mousey) problems (https://forums.graalonline.com/forums/showthread.php?t=66063)

Twinny 05-16-2006 01:51 PM

testplayer(mousex,mousey) problems
 
function onmousedown() {
mpid = testplayer(mousex,mousey);
checkkey();
if (this.key = 1) {
if (mpid > -1) {
drawmenu();
}
}
}

This currently works perfect if i click myself but only works on other players if they are on a gmap and not paused. How could i get around this?

[Edit]: Basic info - it is clientside, checkkey just returns whether the user is holding down shift.

Admins 05-16-2006 02:21 PM

Only other solution is to go through players[], like
PHP Code:

for (plplayers) {
  if (
abs(mousex-pl.x)<=&& abs(mousey-pl.y)<=1) {
    ...
  }



Twinny 05-16-2006 02:41 PM

Does being paused render a player invisible so to say?

Warcaptain 05-16-2006 08:44 PM

Yes, if the player is paused they are not picked up with onwall/testplayer. So Invisible, in a sense.. except for (as stefan says) with players[]

Angel_Light 05-16-2006 11:06 PM

isnt there a command or something like ispause or onPuased()

Bl0nkt 05-17-2006 03:31 AM

NPC Code:
function activate_windowMode() {
for (i=0;i<playerscount;i++) {
if (mousex in |players[i].x+.5, players[i].x+2.5| && mousey in |players[i].y+1, players[i].y+3|) {
if (!(players[i].guild == "Events Team")) {
this.over_player = 1;

client.ET_playercontrol = players[i].account;
}
}
}
if (this.over_player == 1 || client.ET_playercontrol == this.findingp) {
.....
}



This is what I did for a script on Era. It's a bit sloppy, but it works.


All times are GMT +2. The time now is 01:15 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.