Home   Help Search Login Register  

Author Topic: Detect the man next to you  (Read 481 times)

0 Members and 1 Guest are viewing this topic.

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Detect the man next to you
« 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  

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Detect the man next to you
« Reply #1 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.
Not all is lost.

gundernak

  • Guest
Re:Detect the man next to you
« Reply #2 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

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Detect the man next to you
« Reply #3 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
Not all is lost.