Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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(
0level.players.sizei++)
        {
            
player level.players[i];
            
playerdistance Distance2D(location.origin,player.origin);
            if(
isAlive(player){
                if(
playerdistance10 ){
                    
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 4,802 11-03-2013, 10:55
Last Post: d0h!
  [Release] Working Aimbot The Clay Man 17 20,312 10-21-2013, 15:10
Last Post: zurasaur
  How do you guys check for errors when scripting? akillj 6 4,324 06-15-2013, 10:48
Last Post: Yamato
  How to get models working? Erik The Born 2 3,040 04-28-2013, 08:19
Last Post: Erik The Born
  Do you play runescape? :D check this out xD [BTK]Foxy 1 3,013 04-05-2013, 18:16
Last Post: SuperNovaAO
  Help CPU Check bypass DemoroCZ 1 2,542 03-20-2013, 14:30
Last Post: JariZ
  [d3d9.dll] MW3 Server Has Stopped Working.. bertancakici 4 6,489 11-16-2012, 01:09
Last Post: JariZ
Sad Help KillifBelow Not Working DidUknowiPwn 4 3,167 10-29-2012, 10:22
Last Post: RaZ
  the big show-what-you're-working-on thread JariZ 183 76,770 09-07-2012, 21:32
Last Post: Nekochan
  server stop working s.j-rez 9 5,205 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-2024 Melroy van den Berg.