CapBlackShot 11 Posted June 21, 2014 Hello, I'm trying to add a trigger that only opens the bargate when there is a pearson on the selected area. I already have the open/close bargate code, I just need to know that. Could anyone help me? I tried to search a lot on the internet, but I don't find exactly what I want. Thank you! Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 21, 2014 try this in the activation field: vehicle player in thislist Will work if the player is in the trigger area, with or without vehicle, works in both cases. Share this post Link to post Share on other sites
John Kozak 14 Posted June 21, 2014 With vehicle detection: vehicle player != player && this, trigger condition = blufor present Share this post Link to post Share on other sites
CapBlackShot 11 Posted June 21, 2014 (edited) Thank you, people! Anyway, I managed to find a solution: {_x iskindof "LandVehicle"} count thislist > 0 :) Edited September 1, 2014 by CapBlackShot 1 Share this post Link to post Share on other sites
cuel 25 Posted June 21, 2014 That would also trigger for AI units you could add isPlayer _x 1 Share this post Link to post Share on other sites
wiggum2 31 Posted June 21, 2014 Anyone knows a working check that works on dedicated servers and checks if a group or all players are in a vehicle ? Share this post Link to post Share on other sites
SilentSpike 84 Posted June 21, 2014 Anyone knows a working check that works on dedicated servers and checks if a group or all players are in a vehicle ? Just use the vehicle command and check that the returned value is not equal to the unit the command is being used on. Here's an example that will check if every playable unit is in a vehicle _inVehicleCount = {(vehicle _x) != _x} count playableUnits; if (_inVehicleCount = (count playableUnits) then {true} Share this post Link to post Share on other sites
wiggum2 31 Posted June 21, 2014 Thanks, will try it soon ! :) Share this post Link to post Share on other sites
cc_kronus 9 Posted June 18, 2017 On 2014-6-21 at 1:21 PM, silentspike said: Just use the vehicle command and check that the returned value is not equal to the unit the command is being used on. Here's an example that will check if every playable unit is in a vehicle _inVehicleCount = {(vehicle _x) != _x} count playableUnits; if (_inVehicleCount = (count playableUnits) then {true} it does not work, it gives an error. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 18, 2017 21 minutes ago, cc_kronus said: it does not work, it gives an error. Why only go half the distance? Post the error you get and the attempt you made. Digging up 3 year old threads twice a day and just posting "does not work" does not help. Cheers Share this post Link to post Share on other sites
SilentSpike 84 Posted June 18, 2017 Oh my, that is an old post of mine. It's missing a bracket and an equals sign, that's probably why it errors. I assume it was just hastily written as an example anyway as it also has a totally redundant if statement. Share this post Link to post Share on other sites
pierremgi 4852 Posted June 19, 2017 5 hours ago, silentspike said: Oh my, that is an old post of mine. It's missing a bracket and an equals sign, that's probably why it errors. I assume it was just hastily written as an example anyway as it also has a totally redundant if statement. Your code doesn't work in SP (0 = 0 because count playableUnits = 0, always), and wait for all players in a vehicle in MP... If the aim is to raise a bar gate when a player (anyone) is in the trigger area and inside a vehicle, a working code for a repeatable trigger none none: ({!isNull objectParent _x && _x inArea thistrigger} count allPlayers) >0 Share this post Link to post Share on other sites
SilentSpike 84 Posted June 19, 2017 16 hours ago, pierremgi said: Your code doesn't work in SP (0 = 0 because count playableUnits = 0, always), and wait for all players in a vehicle in MP... If the aim is to raise a bar gate when a player (anyone) is in the trigger area and inside a vehicle, a working code for a repeatable trigger none none: ({!isNull objectParent _x && _x inArea thistrigger} count allPlayers) >0 Well, did you read the post above it? I apologise that I didn't predict the existence of the allPlayers command back in 2014. Share this post Link to post Share on other sites
pierremgi 4852 Posted June 19, 2017 3 hours ago, silentspike said: Well, did you read the post above it? I apologise that I didn't predict the existence of the allPlayers command back in 2014. No problem, no personal offense on my mind. But it's always better to let some working scripts and explain what can be wrong on former codes in a public forum. (allPlayers or playablesUnits, your code didn't answer to the question, anyway). But perhaps, i anticipated your intention. Share this post Link to post Share on other sites