sealed 0 Posted March 10, 2007 Let's say I have 3 playble units (in MP) that all has the same action (AddAction..), but the action should only happen to the player that activated it (via player's own actionmenu of course). So is there anyway to detect who of the 3 players activated it? Thanks. Share this post Link to post Share on other sites
buliwyf 4 Posted March 10, 2007 Create a trigger like this: Activation: None / repeatedly Condition: alive player On Activation: PID = player; PAID = PID addAction ["Example","yourScript.sqs",[],-1,false] On Deactivation: PID removeAction PAID In your script you put in the first line: if (not local player) then {exit} Share this post Link to post Share on other sites
iLL 0 Posted March 10, 2007 Its difficult to see whats going on without seeing the script thats executed but heres how you can check which unit is executing the script. In your script add 3 if statements, when one of the three players activates the script only one of those if statements will be true and so it will send out a groupchat message coming from him. Modify the script to suit your needs but this is how you can do what you asked. west1,west2,west3 are the unit names of your soldiers <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?(player == west1): west1 groupchat "i activated the script" ?(player == west2): west2 groupchat "i activated the script" ?(player == west3): west3 groupchat "i activated the script" Share this post Link to post Share on other sites
sealed 0 Posted March 10, 2007 Thanks iLL, that did the trick Share this post Link to post Share on other sites
crashdome 3 Posted March 10, 2007 WOW.... seriously... all of these answers are way out of the ballpark. You need to know who actvated an action? simple: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_this select 1 That will give you the unit that activated it. Likewise, <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_this select 0 will give you the unit the action is attached to. A simple lookup of the command on the wiki or OFPEC would have told you that http://community.bistudio.com/wiki/addAction [EDIT] I must apologize a bit. I really dont mean to scare off potential helpers in answering questions. We all know we have too few these days. However, before "workaround" solutions are given to a problem, one should really check one of the other websites or research a bit instead of assuming that there isn't a command/parameter/script which already exists and solves their problem. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 11, 2007 WOW.... seriously...all of these answers are way out of the ballpark. Haha, I was thinking the same thing before I saw your post. Share this post Link to post Share on other sites