Jump to content
jibun

Conditions in EventHandlers?

Recommended Posts

How can i add conditions in EventHandlers?

 

For example: there is an GetIn EventHandler, and i want to do some action only when mine character enters the vehicle, not any other like bot or other player.

 

When i try to add if in code, like this:

vehicle addEventHandler ["GetIn", {? (_this select 2 == player): hint "You entered the vehicle"}]

As i get in the vehicle, game throws me an "Wrong value in expression" error (maybe there's no exactly such error, since i translated it from other language)

Share this post


Link to post
Share on other sites
6 minutes ago, prototype1479 said:

vehicle addEventHandler ["GetIn", {if (_this select 2 == player)then{hint "You entered the vehicle"}}]

Thank you, everything runs smoothly now!

  • Like 1

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

×