Thread: testplayer x.x
View Single Post
  #12  
Old 01-23-2006, 07:25 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
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);
}
}

__________________
Reply With Quote