OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kuro on 30 Jan 2004, 07:56:55

Title: Detect the man next to you
Post 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  
Title: Re:Detect the man next to you
Post by: Artak on 30 Jan 2004, 08:15:22
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.
Title: Re:Detect the man next to you
Post by: gundernak on 30 Jan 2004, 16:28:44
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
Title: Re:Detect the man next to you
Post by: Artak on 30 Jan 2004, 16:33:10
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