CARRICK_IRISH 39 Posted October 16, 2013 (edited) Hey folks, right from the start: im a beginner in arma scripting an want to initialize an addAction to every camping-chair in the multiplayer game. Here is my first solution but it is only working in the editor preview. it is not working on my dedicated server. i think i have a problem with the "player" thing which is not working in MP? _chairs = nearestObjects [player, ["Land_CampingChair_V1_F"], 5]; { if (typeOf _x == "Land_CampingChair_V1_F") then { _x addAction ["Hinsetzen","Missionpack\Chairs\sitdown.sqf"]; }; } forEach _chairs; regards, ian Edited October 16, 2013 by ian_Carrick Share this post Link to post Share on other sites
cuel 25 Posted October 16, 2013 How are you running it? All clients should get the addAction but not the dedicated server (because "player" is null) Share this post Link to post Share on other sites
CARRICK_IRISH 39 Posted October 16, 2013 (edited) I'm putting this to the Init.sqf but i guess this is absolutely the wrong way Edited October 16, 2013 by ian_Carrick Share this post Link to post Share on other sites
shuko 59 Posted October 16, 2013 Try waiting for the player variable to not be null (= waiting for the client to get control of the chosen unit). Spawn is there to just separate the waiting from the init.sqf, if you have other stuff after it. [] spawn { waituntil {!isnull player}; _chairs = nearestObjects [player, ["Land_CampingChair_V1_F"], 5]; { if (typeOf _x == "Land_CampingChair_V1_F") then { _x addAction ["Hinsetzen","Missionpack\Chairs\sitdown.sqf"]; }; } forEach _chairs; }; Share this post Link to post Share on other sites
CARRICK_IRISH 39 Posted October 16, 2013 Ah, i will check the reference for null and spawn and try to implement your code when i'm at home. thank you for the keywords and the answers shuko and cuel ian Share this post Link to post Share on other sites