Jump to content
Sign in to follow this  
{USI}_Zombie

Player has left area

Recommended Posts

I need a way to detect if a player has left a certain area. Using a trigger, for example, I put an east player in the area, then the trigger was set to opfor not present. Works great...but in that said area I will have more than 1 opfor there usually.

So how do I set it up so only a specific unit fires the trigger? Also, I need a way to notify THAT unit he has left the area, but not broadcast to the whole team/server. Should be an easy concept but can't seem to get it.

Share this post


Link to post
Share on other sites

Subtract the list of a opfor present trigger (with no on activation or condition) from an array of all opfor player units to get an array of opfor player units outside the trigger.

I imagine that JIP and locality will complicate things, i can't really help with that... confused_o.gif

Share this post


Link to post
Share on other sites

As for making sure only the right player gets the message:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (!(isServer) && (local yourUnit)) then {hint "You're being led astray! Seek guidance ye poor soul!"};

This is assuming the code runs on all clients (so if you're using an editor placed trigger you should be fine).

Share this post


Link to post
Share on other sites

Try  triggerAttachVehicle. Its sets the vehicle (or player IIRC) that will activate the trigger.

Share this post


Link to post
Share on other sites

Or you could group the trigger to the unit you want to activate the trigger, and select "vehicle" instead of "opfor". This probably works the same as triggerattatchvehicle.

Share this post


Link to post
Share on other sites

yeh b1sh0p's solution works the best. Press F2 and drag a line from the trigger to the unit desired.

Share this post


Link to post
Share on other sites

Always amazes me how there's many ways of doing the job. Quite obviously the group with trigger sounds the best, I would have tried some code that looks for a unit name in the Condition field smile_o.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  

×