Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Checking If A Vehicle is Manned  (Read 1107 times)

0 Members and 1 Guest are viewing this topic.

Javito

  • Guest
Checking If A Vehicle is Manned
« on: 12 Aug 2006, 21:47:25 »
Okay, I'm going back and testing my first mission before I post it on the Beta forum in the coming week. Making a few little tweaks here and there. One thing I'd like is this. I have an anti-tank gun which must be manned by two men of your squad. It doesn't matter who, and I want the player to be able to choose which soldiers to assign where. I want a trigger to check and see if this gun is manned but I don't know how to do it. I know how if a specific soldier like r1 is manning the gun, but I don't know how to check if -anybody- from the USSR side is. Can anyone help me out?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Checking If A Vehicle is Manned
« Reply #1 on: 12 Aug 2006, 21:59:20 »
Code: [Select]
gun_manned = false

#loop
~1
?not (side (gunner vehicle_name))=="east":goto "loop"

gun_manned = true

#loop2
?not  ((gunner vehicle_name) in vehicle_name):gun_manned = false; goto "loop1"

exit

untested but should work.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Checking If A Vehicle is Manned
« Reply #2 on: 12 Aug 2006, 22:18:20 »
Would this not work:
if (count crew vehiclename < 1) then {code for an unmanned vehicle} else {code for a manned vehicle}

?
« Last Edit: 12 Aug 2006, 22:37:07 by THobson »