nullsystems 0 Posted December 4, 2007 Hi all, I have a problem with multiplayer actions. I have a select few units who need to have actions in their menu ( next to weapons, binoculars etc ) so they can perform certain things. Now, the method I have works, until 1 unit with this system and another unit like this point at each other while close...they can use each others actions! How can I stop this happening? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Trigger: Repeat, BlueFor Cond: alive unit1 onAct: removeallWeapons unit1; someAction = unit1 addAction ["Something","script.sqs",0,0,False]; onDeact: unit1 removeAction someAction; Second, I have a hint which is activated by a script run locally to a person. script.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? local server : exit; some stuff... [] exec "hintScript.sqs" exit; hintScript.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? not local server : exit; hint "blah" exit; Now, this shows for the person executing it, but not for everyone else. How can I have this happen so everyone sees the hint? Any help would be really appreciated, thank you ! Share this post Link to post Share on other sites
loyalguard 15 Posted December 4, 2007 I know the addAction has been brought up before but I cannot find the solution right now. I will continue to look into it but mabe someone else will be able to shed light before then. Regarding the hint, the only way I know to make it work is with another trigger and the publicVariable command... 1) put some lines like this in your script.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">showHint = true publicVariable "showHint" 2) Add a trigger like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Cond: showHint On Act.: hint "blah"; This should make the hint visible to everyone since everyone's local trigger will activate when the public variable showHint returns true and is broadcast to all clients. Share this post Link to post Share on other sites
nullsystems 0 Posted December 5, 2007 Yep, I understand about the hints. Sounds fair. Im sure ill figure that out. As for addAction, is it if you: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> unitName addAction blah It adds like an option for yourself and other people to use on you ( like a medic ). And if you: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> player addAction blah It only adds for yourself? Share this post Link to post Share on other sites
killswitch 19 Posted December 5, 2007 Hi all,I have a problem with multiplayer actions. I have a select few units who need to have actions in their menu ( next to weapons, binoculars etc ) so they can perform certain things. Now, the method I have works, until 1 unit with this system and another unit like this point at each other while close...they can use each others actions! How can I stop this happening? Change the condition in your trigger from <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">alive unit1 to <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(alive unit1) && (local unit1)That will limit the addAction to the machine where unit1 is local. That unit will be local to the machine of the player of unit1. Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted December 5, 2007 The problem here really is that the addaction command is an inflexible POS when you get right down to it. There is one tip I can give you though. If you want the action to show only for a *player* controling the unit, you can take advantage of the action's locality. Addaction is only shown on the machine where it is executed. If that bit of wisdom sounds like it may help you, you might want to take a close look at the workings of my weapon switching script. You can find it in my little corner of armaholic. Just check my sig. Share this post Link to post Share on other sites
nullsystems 0 Posted December 5, 2007 I understand more now, thanks guys ill have a play around. Share this post Link to post Share on other sites