Callisto_SS 0 Posted April 18, 2022 Hey! I wrote a code for a random manhunt scenario, and for 2 players it works fine because i wrote all of the code in the init.sqf. But with more players everytime someone loads in the scenario gets randomised again and again. I tried to make a game object which will have an action to load in the scenario but it failed. I have to type the code in the debug console for it to work. anyone has a solution? Thanks! link for the code if you have time to figure out what is happening Share this post Link to post Share on other sites
7erra 629 Posted April 18, 2022 why didnt you post the code? its just two lines: _actionID = player addAction ["Exec the file", "randomspawn.sqf"] hint str _this; init.sqf is executed for the server and all clients before mission start. try initPlayerLocal.sqf instead 2 Share this post Link to post Share on other sites
dreadedentity 278 Posted April 18, 2022 It would be much preferred to not have to download anything to look at people's code, there are many ways to do this. First of all just including it with your post with the code tag, don't forget to use a spoiler tag if the code is long. There are various code-sharing sites as well. Then of course there is Github, probably the best option 2 Share this post Link to post Share on other sites
Harzach 2517 Posted April 18, 2022 5 hours ago, 7erra said: try initPlayerLocal.sqf instead This. Avoid using init.sqf whenever possible. Keep in mind that in MP it is the last item to initialize. 2 Share this post Link to post Share on other sites
pierremgi 4900 Posted April 19, 2022 What do you need exactly? - A randomized scenario and every player has the same? You need to randomize a variable in initServer, then public it forExample : rSpawn = selectRandom [....]; publicVariable "rSpawn"; then code with rSpawn choice in initPlayerLocal.sqf (all players have the same) - A randomized scenario (fixed of course) for each player? , so the initPlayerLocal.sqf is just fine. No need to randomize a variable on server. Do that in initPlayerLocal.sqf 1 Share this post Link to post Share on other sites