Okay,
The funny thing is that this seemingly innocent problem does not have a simple answer. Since the vehicles are player controlled they may enter the trigger any which way in any combination. One vehicle could enter the trigger and then back out, or two vehicles could enter the trigger together and before the trigger resets the third vehicle could enter.
Easiest possible way
edit: Add game logic named server to the map.
Place a large trigger that not only covers the mine area, but covers any place any of the vehicles could be after entering the trigger. The trigger list object will then represent all vehicles in the trigger. The place the trigger to whatever side present and add the lines I gave you above. This is the best way if you are certain that the first two vehicles will still be within the trigger when the third enters. Not sure what you are using as an explosive but if you are dealing with a large trigger, chances are it will fire on all machines and you can simply camcreate your explosives. (I personally like using the CoC mines because all you have to do it set the mines damage to 1 and it explodes for all clients.)
Harder Way
If what you want is a trigger to count vehicles going over it without fail, the trick is to count them on the server only.
1) In your "init.sqs" put the truck_array line I posted previously. Below it add:
ied_array = []
ied_flag = FALSE
2) Now you must make trigger to count the trucks. Name it ied_trigger. Set it to whatever side detected and activate repeatedly. For conditions put:
(local server) and (({_x in thislist} count truck_array) > 0)
In OnActivation:
[] exec "ied_count.sqs"
3) "ied_count.sqs"
if ((count ied_array) > 0) then {exit}
#loop
{if not (_x in ied_array) then {ied_array = ied_array + [_x]}} foreach list ied_trigger
if ((count ied_array) >= 3) then {ied_flag = TRUE ; exit}
~0.1
goto "loop"
4) One more trigger. Condition:
ied_flag
OnActivation:
your ied explode code here
4) Now, since the trigger listed in 4) will only fire on the server, you should use createVehicle to create your explosive, if that is how you want to do it. If you want to use camCreate then you must change the following line in "ied_count.sqs"
if ((count ied_array) >= 3) then {ied_flag = TRUE ; exit}
to
if ((count ied_array) >= 3) then {ied_flag = TRUE ; publicVariable "ied_flag" ; exit}
Then the trigger in 4) will fire on all machines.
Of course, I have not tested this code.� :blink:� Try it and let me know. I will be away for Easter so I will not be able to respond immediately. If someone has a more elegant way of achieving the same goal I would like to see it.