Quote:
|
Originally Posted by Rick
How would that help?
|
It doesn't.
NPC Code:
//#CLIENTSIDE
if (mousedown) {
if (rightmousebutton) {
this.pid = testplayer(mousex,mousey);
setplayerprop #c,#a(this.pid);
}
}
See if that detects the players. If it doesn't, you can always loops through the players in the level and check if the mouse coordinates are within the coordinates used by the players. I.E.
NPC Code:
//#CLIENTSIDE
if (mousedown) { // checks to see if mouse is used
if (rightmousebutton) { // checks to see if right mouse button was used
for(i=0; i<playerscount; i++) { // loops through players in the level
this.pid = -1; // presets the id var to -1 just in case there are no players at the mouse coordinates
if (mousex in |players[i].x,players[i].x+1.5| && mousey in |players[i].y,players[i].y+2|) { // checks for players at the coordinate
this.pid = i; // if player exists sets id var to player's id
}
}
if (this.pid == -1) { // does the player exist?
setplayerprop #c,Player not detected;
}else setplayerprop #c,#a(this.pid);
}
}