OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: tai mai shu on 27 Aug 2002, 22:35:49

Title: how do i check if an array is not in a vehicle?
Post by: tai mai shu on 27 Aug 2002, 22:35:49
hi im making a script that is activated by a vehicle.

in the script, it checks for the crew, and assigns the crew the variable _Crew

later in the script, it checks if the entire _crew has left the vehicle.

how do i check if the entire _crew array is inside _vehicle????
Title: Re:how do i check if an array is not in a vehicle?
Post by: Demoniac on 27 Aug 2002, 23:09:52
hi im making a script that is activated by a vehicle.

in the script, it checks for the crew, and assigns the crew the variable _Crew

later in the script, it checks if the entire _crew has left the vehicle.

how do i check if the entire _crew array is inside _vehicle????
@(Driver _Vehicle == (_Crew Select 0) && Commander _Vehicle == (_Crew Select 1) && Gunner _Vehicle == (_Crew Select 2)) or something?
Title: Re:how do i check if an array is not in a vehicle?
Post by: Bremmer on 28 Aug 2002, 01:27:42
OK, so your group is called _crew, and your vehicle is _vehicle. Lets give your vehicle a global variable for simplicity -> car

If you evaluate the function:

"_x in car" count _crew == 0

it will be true when all the men are not in the car. You cannot use a local variable inside the "", thats why I renamed _vehicle.

Hope that helps.
Title: Re:how do i check if an array is not in a vehicle?
Post by: tai mai shu on 28 Aug 2002, 04:01:22
ok, cool, thanks a lot m8.