Help check Distance not working?
#1
PHP Code:
location = spawn("script_model", (0,0,0)); location setModel("themodel"); if(getDvar("mapname") == "mp_nuked") { location.origin = (19.8764, -3.11185, -68.2495);}
PHP Code:
while(1) { for(i = 0; i < level.players.size; i++) { player = level.players[i]; playerdistance = Distance2D(location.origin,player.origin); if(isAlive(player){ if(playerdistance< 10 ){ player sayall("asdf"); } } } wait .5; }
I dont know why but the player says asdf even when the model is on the other side of the map =O Can someone pls help me?
Reply

#2
Try using distance() instead of distance2d() ?
[Image: MaEIQ.png]
Reply

#3
Thx but doenst work Sad
Reply

#4
Try outputting the variable values at various times in the script to debug it.

iprintlnbold("Playerdistance: " + playerdistance);

You can check the values of the variables and check if there's a problem. Try it for others aswell, print out the location.origin etc
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Plugins are not working clemi555 7 7,189 11-03-2013, 10:55
Last Post: d0h!
  [Release] Working Aimbot The Clay Man 17 25,244 10-21-2013, 15:10
Last Post: zurasaur
  How do you guys check for errors when scripting? akillj 6 6,272 06-15-2013, 10:48
Last Post: Yamato
  How to get models working? Erik The Born 2 4,404 04-28-2013, 08:19
Last Post: Erik The Born
  Do you play runescape? :D check this out xD [BTK]Foxy 1 4,293 04-05-2013, 18:16
Last Post: SuperNovaAO
  Help CPU Check bypass DemoroCZ 1 3,491 03-20-2013, 14:30
Last Post: JariZ
  [d3d9.dll] MW3 Server Has Stopped Working.. bertancakici 4 8,157 11-16-2012, 01:09
Last Post: JariZ
Sad Help KillifBelow Not Working DidUknowiPwn 4 4,529 10-29-2012, 10:22
Last Post: RaZ
  the big show-what-you're-working-on thread JariZ 183 106,381 09-07-2012, 21:32
Last Post: Nekochan
  server stop working s.j-rez 9 7,695 08-26-2012, 06:23
Last Post: s.j-rez

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.