Jump to content
kylejess69

Trigger to activate once vehicle has full fuel

Recommended Posts

Hi everyone, 

I'm trying to make a mission that involves refuelling a helicopter as part of it.

So far I've set up the create new task etc. and got the fuel truck in position and it fills up the helicopter as intended.

 

I can't figure out how to make this activate a trigger however in order to complete the task.

 

I have tried using the fuel command but it does not return a boolean value so it doesn't work. I've trawled the forums and youtube but still can't seem to find a solution.

 

Does anyone know how to make this work? It seems as if it should be easy and I'm just missing something.

 

Thanks in advance, 

KJ

Share this post


Link to post
Share on other sites

The condition ”fuel myVehicle == 1” returns a boolean.

  • Like 1

Share this post


Link to post
Share on other sites

I've tried inserting that into the condition field of the trigger but it still doesn't work:

fuel myVehicle == 0.95;

 

I also tried this and it also didn't work: (Note; heli1 is the variable name)

fuel heli1 == 0.95;

 

Can someone help?

KJ

Share this post


Link to post
Share on other sites

Try ”fuel myVehicle > 0.95”.

 

EDIT: Reason is that the float value returned may never be *exactly* 0.95. A good practice when comparing decimal values is to never check for exact equality, but for a span.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks @enigma.. it worked for me too and only took 2hrs to find this answer... thank you so much 😀 you guys do so much for people struggling to get on top of this stuff

 

Tama

 

edit: the task is not showing as completed.. Something small missing.. will figure it out ..

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

×