bigshot 64 Posted February 11, 2014 I'm working on a mission that has a parameter to set the time of day at mission start. Im using this in my init.sqf to set the time of day for clients (im using this on non-dedicated self hosted server): if (isServer) then { setDate [2035, 7, 6, (paramsArray select 3), 1]; }; Now, the trouble is...the time gets synced fine for anyone who joins after mission start (JIP), but the players who join with the host at mission start get the wrong time. I'm a bit confused how to get both types of players synced with the correct time. Share this post Link to post Share on other sites
Zenophon 110 Posted February 11, 2014 The 'setDate' command has local effect. It must be executed on all clients to affect them. Weather is sync'd to JIP players though. https://community.bistudio.com/wiki/setDate Share this post Link to post Share on other sites
bigshot 64 Posted February 11, 2014 Im not sure what to do...it is being executed on all clients but only AFTER the mission has started....so the time works fine for JIP'ers...but how do i get the time correct for players who join with me AT mission start? I was originally using skiptime...but that only works for players who join AT mission start and not after. So i switched to setdate and now things are the opposite, heh. Share this post Link to post Share on other sites
Kerc Kasha 102 Posted February 11, 2014 I'm working on a mission that has a parameter to set the time of day at mission start.Im using this in my init.sqf to set the time of day for clients (im using this on non-dedicated self hosted server): if (isServer) then { setDate [2035, 7, 6, (paramsArray select 3), 1]; }; Now, the trouble is...the time gets synced fine for anyone who joins after mission start (JIP), but the players who join with the host at mission start get the wrong time. I'm a bit confused how to get both types of players synced with the correct time. Change if (isServer) to (time > 10) so it will only run on people there at mission start Share this post Link to post Share on other sites
bigshot 64 Posted February 11, 2014 Change if (isServer) to (time > 10) so it will only run on people there at mission start didnt work...that made the mission start with the editor saved time. Share this post Link to post Share on other sites
Zenophon 110 Posted February 11, 2014 Changing the time can be done before the mission start (during the briefing). All clients (JIP or at start) run the init.sqf. So as the mission starts, you want all machines (including the server) to execute the setDate command. Interestingly, because JIP players already sync time, this would set the time incorrectly for them. You want time < 10, not time > 10. In the init: if (time < 10) then { setDate [2035, 7, 6, (paramsArray select 3), 1]; }; Share this post Link to post Share on other sites
Kerc Kasha 102 Posted February 11, 2014 Changing the time can be done before the mission start (during the briefing). All clients (JIP or at start) run the init.sqf. So as the mission starts, you want all machines (including the server) to execute the setDate command. Interestingly, because JIP players already sync time, this would set the time incorrectly for them. You want time < 10, not time > 10. In the init: if (time < 10) then { setDate [2035, 7, 6, (paramsArray select 3), 1]; }; Whoops yeah got my > and < mixed up Share this post Link to post Share on other sites
bigshot 64 Posted February 11, 2014 (edited) thanks guys...ill give it a go. **EDIT: no joy guys...same result...works for host just fine...and works for client ONLY during a JIP...but client joining AT mission start is getting the editor saved time...so the code is only running for the client when he joins AFTER the mission has started. My init file is failry large...could it be i need to place it in a better position? farther up or down? ***EDIT - yup that was my issue...code was fine...my placement was stupid. Thank you VERY much for the help tonight...can't tell you how much I appreciate it! Edited February 11, 2014 by BigShot Share this post Link to post Share on other sites