View Single Post
  #8  
Old 01-31-2004, 04:42 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 Stefan
Serverside scripting functions:

NPC Code:

pindex = getnearestplayer(x,y)
with (players[pindex]) {
distance = ((x-playerx)^2+(y-playery)^2)^0.5;
if (distance<2)
// do stuff
}



or

NPC Code:

pindexes = getnearestplayers(x,y,playerhearts>=3)
for (i=0; i<arraylen(pindexes); i++) {
with (players[pindexes[i]]) {
distance = ((x-playerx)^2+(y-playery)^2)^0.5;
if (distance<2)
// do stuff
}
}

Why isnt there a ; at the end of the getnearestplayers?
__________________
Reply With Quote