Jump to content
Sign in to follow this  
Stubbinz

How can i get hints to show up to who it applies?

Recommended Posts

For example, i have multiple guys with the same variables attached to each, however the variables independently change due to player actions and what not. But i keep getting everyone elses Hints popping up.

How do i apply hints to one person specifically?

Such as, if one units hunger >= 90 hint "You are starving!"

works, but its telling everyone 'You are starving!"

I need it to apply to the single person that variable is attached to.

What do?

Share this post


Link to post
Share on other sites

Now you are getting into the evil side of MP scripting.

Hint is localy executed.

Now if there is a script that is checking if _unit is hungrey the script will run on all clients (and most likely the server 2).

Now, the script checks if _unit == hungrey. If it is it will hint "Hungry" on all clients becuase the _unit == hungrey in each client no matter if the _unit is local to client or remote.

What you need to do is add this:

if ((_unit == player) || (_unit == name player)) then
{hint "i'm hungrey"};

Now that is assuming your script is running on every client, if it is runing on the server side only you shouldn't see any hint, as hint is local.

Anyway if the above text makes your head spinn. Welcom to dark side of arma scripting, please leave your soul at the entracne. :y:

Edited by shay_gman

Share this post


Link to post
Share on other sites

Haha Thank you, i'll test it out if my computer doesnt' explode. Its make a racket right now for some reason, damn youtube videos ha

Share this post


Link to post
Share on other sites

Thanks for that explanation Shay_gman, I'm learning MP mission building, this helps.

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  

×