Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: how to get the nearest unit to the player?  (Read 667 times)

0 Members and 1 Guest are viewing this topic.

SpawnFodder

  • Guest
how to get the nearest unit to the player?
« on: 31 May 2005, 10:01:38 »
i have been trying to find a way to get a script to detect the nearest enemy unit to the player, and ideally the nearest unit of a certain type.  does anyone know of a command to do this.  the nearest i have found was the nearestobject command, but that doesnt seem to work on units.

voodzia

  • Guest
Re:how to get the nearest unit to the player?
« Reply #1 on: 31 May 2005, 11:14:32 »
You need command distance for that. Check official command reference for more info.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:how to get the nearest unit to the player?
« Reply #2 on: 31 May 2005, 12:32:12 »
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

SpawnFodder

  • Guest
Re:how to get the nearest unit to the player?
« Reply #3 on: 31 May 2005, 18:01:26 »
that function was the kind of thing i was looking for

thanks