Jump to content
Sign in to follow this  
eisa01

Checking if a player is in a vehicle

Recommended Posts

I need a trigger to activate if theyre in a chopper named blackhawk.

ive tried

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: player in blackhawk<span id='postcolor'>

But then it doesnt trigger for everyone.

ive found one solution but aint satisfied with it. i make a trigger that covers the chopper and names it t6. then i have a trigger check if theres any player in the chopper with:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: p8 in list t6 OR p9 in list t6<span id='postcolor'>

thats not really accurate since it triggers outside the chopper too. Ive tried changing t6 with blackhawk but it dont function, i get some error message in mission. so what shold i do???

Share this post


Link to post
Share on other sites
Guest jacobaby

The 'player' variable is unique to each Client. If you execute a global script to display the name of the player, each machine will see his own name.

So your second technique is right, individually named playable units.

If you wanted just one of a few named units to be able to trigger the event, you could use;

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ap1 in blackhawk or ap2 in blackhawk

<span id='postcolor'>

Or if you wanted to specifically check if the named unit was the pilot or gunner of the blackhawk you could use;

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ap1 == driver blackhawk or ap1 == gunner blackhawk

<span id='postcolor'>

This will work in MP as the names assigned via INIT fields are global in recognition.

TJ

Share this post


Link to post
Share on other sites

THANK YOU BOTH biggrin.gif this has been one of my main problems and now its solved biggrin.gif

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
Sign in to follow this  

×