View Single Post
  #8  
Old 01-27-2002, 08:41 AM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by BocoC
Try something like this:
NPC Code:

if (created) timeout=0.05;
if (timeout) {
if ((abs(this.px-playerx)>0.6)||(abs(this.py-playery)>0.6)) {
playerx=this.px;
playery=this.py;
}
this.px=playerx;
this.py=playery;
timeout=0.05;
}


That should work. Since a player moves a max of 0.6 tiles every 0.5 seconds (level 3 shield), it checks if a player goes faster. You can modify upon it if you want.
[Kaimetsu]

Nope, won't work. Wanna know why? Because on a speed-hacked computer, timeouts run faster than normal too. You might get 40 timeouts per second, so even if you were running at the normal distance-per-timeout, you'd still be going fast.

[/Kaimetsu]
Reply With Quote