Home   Help Search Login Register  

Author Topic: Trigger on use of truck?  (Read 2400 times)

0 Members and 1 Guest are viewing this topic.

Offline Imofexios

  • Members
  • *
Trigger on use of truck?
« on: 06 Nov 2011, 13:35:05 »
Hello all!

I've tryed to look but could not find any solution so i try asking here.

How i can get trigger go off when player (civilian) enters truck/starts it?
Or can i do something in init to trigger it only once?

The problem is here...The truck placement radius is set to 200 so it wont be sitting same place on any game :)

Thanks in advance.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Trigger on use of truck?
« Reply #1 on: 06 Nov 2011, 14:37:13 »
As long as the truck has a name, this is very simple:

In the trigger's Condition field, simply write:
Code: [Select]
playerName in truckName
Simple as that! The trigger activates when playerName is in truckName. Alternatively you can use just "player", but you should avoid that unless absolutely necessary, because you might for instance want to test the mission from another perspective and let the AI handle the player's tasks - in which case the trigger would never trigger and such.

Here are some alternative conditions:

Code: [Select]
vehicle playerName == truckName
or, if you want to wait until the player starts the truck:

Code: [Select]
isEngineOn truckname && vehicle playerName == truckName
The placement radius doesn't make any difference :)

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"