OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kuro on 30 Jan 2004, 07:56:55
-
Hallo,
i have the following problem: I want to know who is next to me. I know it is probably something like
nearestobject(player,"man") , but i got it not working :(
Especially the correct setting for "man" is unclear to me because i want to detect the nearest human being.
Help is appreciated.
Kuro
-
Someone posted here a neat little function called 'closesttarget.sqs'. I took it in use right away. It's an excellent way to find out the nearest object from an array and in a script you can ask if the result distance to you is less or greater than something or if the returned object is someone who you want it to be.. and have the script to continue or loop.. or whatever you want.
I'm not at home right now, but when I get there I can find out who it was that made the function and kindly distributed it.
The nearestobject might work for you too. I haven't ever used though.
-
I posted a similar Q...
And .pablo. posted me this function (sqf)
It is perfectly working...
Here is the link to the post:
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=14909
-
Right. That's exactly what I was talking about. Thanks gundernak :-*
With that sqf called from a neat sqs there's nothing you can't do :D