OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Messiah 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 :)
-
isNull gunner vehicle perhaps?
-
would that return if there was or wasnt a gunner?
-
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 ...
-
No redgun that won't work!
From the comref:
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:
Example:
player == objNull
Darn confusing comref.
-
id agree, id try;
?isNull (gunner vehicle):hint "We Need A Shooter Over Here"
-
Maybe "alive gunner veh" ?
-
Why keep guessing? Test your assumptions before posting and just solve the problem and answer the question. And here it is:
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).