pawelisus 1 Posted July 17, 2022 addMissionEventHandler ["PlayerConnected", { _playeruid = _this select 1; _playerUnit = 0; waitUntil { sleep 1; _playerUnit = _playeruid call BIS_fnc_getUnitByUID; not isNull _playerUnit; }; _playerside = side _playerUnit; ]}; Main problem is that the _playerside is equal to UNKNOWN. I've noticed that _playerUnit is <Null-Object>. I think BIS_fnc_getUnitByUID is called before player joined and I cant find a way to call it after him spawning. Share this post Link to post Share on other sites
Ibragim A 163 Posted July 17, 2022 I'm not good at multiplayer scripts at all, but I see that you're using a loop in unscheduled environment . Also, the brackets in the code are mixed up in places. May be try: addMissionEventHandler ["PlayerConnected", { _playerUnit = (_this select 1) call BIS_fnc_getUnitByUID; _playerside = side _playerUnit; }]; 1 Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 17, 2022 1 hour ago, Ibragim A said: you're using a loop in unscheduled environment That is why I used spawn in my original code... Share this post Link to post Share on other sites
pawelisus 1 Posted July 17, 2022 1 hour ago, sarogahtyp said: That is why I used spawn in my original code... Ohhh, I didnt saw that one.. you've not replied so I asked about the problem Share this post Link to post Share on other sites
pawelisus 1 Posted July 17, 2022 2 hours ago, Ibragim A said: I'm not good at multiplayer scripts at all, but I see that you're using a loop in unscheduled environment . Also, the brackets in the code are mixed up in places. May be try: addMissionEventHandler ["PlayerConnected", { _playerUnit = (_this select 1) call BIS_fnc_getUnitByUID; _playerside = side _playerUnit; }]; In my original code brackets are fine, I made a mistake writing it to a topic but thanks. Unfortunately it wont work because if it will be called emediately it will just return side "UKNOWN" because player isn't spawned yet Share this post Link to post Share on other sites
RCA3 593 Posted July 18, 2022 @pawelisus, Where are you executing this command/script? Switching topic. Share this post Link to post Share on other sites
Harzach 2518 Posted July 18, 2022 This is all taken care of in your other topic. This one is redundant. 2 Share this post Link to post Share on other sites