Home   Help Search Login Register  

Author Topic: check for gunner?  (Read 666 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
check for gunner?
« on: 06 Feb 2005, 15:57:58 »
i was wondering if it was possible to check if a vehicle has a gunner... i went through the command reference and didnt really find anything.... i tried to search these forums, but no luck...

i need it for an init.sqs to check of a vehicle is either empty (only has gunner place) or maned from the start.

cheers  :)
Proud Member of the Volunteer Commando Battalion

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:check for gunner?
« Reply #1 on: 06 Feb 2005, 16:04:13 »
Code: [Select]
isNull gunner vehicle perhaps?
Get those missions out there you morons!

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:check for gunner?
« Reply #2 on: 06 Feb 2005, 18:24:30 »
would that return if there was or wasnt a gunner?
Proud Member of the Volunteer Commando Battalion

redgun

  • Guest
Re:check for gunner?
« Reply #3 on: 06 Feb 2005, 20:57:04 »
gunner vehicle

returns who's gunner in a vehicle.
you've just to find out which value is returned when nobody is in there.

maybe objNull

so it would look like that


?(gunner veh1 == objNull): bla bla ...
« Last Edit: 06 Feb 2005, 20:58:46 by redgun »

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:check for gunner?
« Reply #4 on: 07 Feb 2005, 14:13:13 »
No redgun that won't work!

From the comref:
Quote
objNull

Type of returned value:
Object
Description:
non-existing object. This values is not equal to anything, even to itself.

Me still thinks Mesiah should test my idea. ;)

Edit:

Hmm perhaps it will cause the example is:
Quote
Example:
player == objNull
Darn confusing comref.
« Last Edit: 07 Feb 2005, 14:16:52 by MachoMan »
Get those missions out there you morons!

StonedSoldier

  • Guest
Re:check for gunner?
« Reply #5 on: 07 Feb 2005, 15:23:05 »
id agree, id try;

?isNull (gunner vehicle):hint "We Need A Shooter Over Here"

Offline Grizzlie

  • Members
  • *
Re:check for gunner?
« Reply #6 on: 07 Feb 2005, 15:38:14 »
Maybe "alive gunner veh" ?


Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:check for gunner?
« Reply #7 on: 07 Feb 2005, 17:01:03 »
Why keep guessing? Test your assumptions before posting and just solve the problem and answer the question. And here it is:
Code: [Select]
isNull gunner somevehiclewill return the value true if the vehicle has a gunner. It will return false if the vehicle has no gunner.

If the vehicle itself isn't even equipped with a gunner position (like a civilian car) that test still works (result is false, obviously).

« Last Edit: 07 Feb 2005, 17:01:35 by Killswitch »