View Single Post
  #8  
Old 06-05-2012, 04:57 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by fowlplay4 View Post
If you're moving the npc on the server-side you need to use findnearestplayers or some other kind of loop and a bounds check like callimuc has posted. I.e.

PHP Code:
for (temp.pplayers) {
  
with (temp.p) {
    if (
this.x in |player.xplayer.x+3| && this.y in |player.yplayer.y+3|) { 
      
player.chat "The NPC touched me!"
    } 
  }

Wouldnt it be
PHP Code:
for (temp.pplayers) {
  
with (temp.p) {
    if (
thiso.x in |xx+3| && thiso.y in |yy+3|) { 
      
temp.p.chat "The NPC touched me!"
    } 
  }

?
__________________
MEEP!
Reply With Quote