Jump to content
Rawshark

[Solved] Using area trigger to remove fuel from vehicle driven by a player

Recommended Posts

For a MP server I'm trying to setup an area trigger where if entered by a vehicle, the trigger will empty the fuel tank.  Now I know an easy way to do this is to name the vehicles and then add in to the trigger" vehiclename setfuel 0;" etc but I was wondering if there was an alternative way to remove fuel without having to name all the vehicles on the server?

I've been trying various iterations of 'setfuel' like so, but none of them seem to work or do what I want.

[_vehicle] remoteexec [setfuel 0, _vehicle];


If anyone can point me in the correct direction, that would be marvellous, thanks! 

Share this post


Link to post
Share on other sites

trigger repeatable, anyBody present

condition: this && isNil "dump"

On activation : if ( (thisList select 0) isKindOf "landVehicle") then { [(_this select 0),0] remoteExec ["setfuel", (this select0)] }; dump = true

On deAct: 0 = [] spawn { sleep 2; dump = nil}

 

 

 

Share this post


Link to post
Share on other sites
38 minutes ago, pierremgi said:

trigger repeatable, anyBody present

condition: this && isNil "dump"

On activation : if ( (thisList select 0) isKindOf "landVehicle") then { [(_this select 0),0] remoteExec ["setfuel", (this select0)] }; dump = true

On deAct: 0 = [] spawn { sleep 2; dump = nil}

 

 

 

 

Heya, apparently there is a generic error in the On Activation expression. I can't seem to execute it, sorry

Share this post


Link to post
Share on other sites

Yeah, too kick written. Test that:

 

Trigger set to none,none, non repeatable

condition: true

on Act :

0 = thisTrigger spawn { while {true} do {{ if (_x isKindOf "landVehicle" && _x inArea _this) then { [_x,0] remoteExec ["setfuel",_x]; _x setVariable ["fuel",false] } } forEach (vehicles select {isNil {_x getVariable "fuel"}}); sleep 2 }}

 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks, I'll give it a shot. At a glance though I am not sure if it will work if the trigger activation is set to none, maybe none, BLUFOR, non repeatable? I'll test it out and let you know

 

Edit: Cheers, it works like a charm! Thank you so much!!

Share this post


Link to post
Share on other sites

A simple     yourvehiclename  setFuel 0      in the trigger init, will work  along with  yourvehiclename in thislist  in the trigger condition. activation whatever force vehicle is, or anybody not present trigger size 0.

Also useful if you don't want a vehicle or aircraft to move until something else happens (eg, as in escorting attack helicopters with an extract helicopter, they hover in formation all the time)

Thevehiclename  setFuel 0 in the vehicle init & then Thevehiclename  setFuel 1 in a trigger, waypoint or script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×