Mattmad1234 3 Posted December 21, 2018 Good Evening! I am working on a way to respawn a player after 5 minutes have passed on a mission if they joined in progress. Currently I am using this script below in the initPlayerLocal.sqf However, What happens is that the sleep is not local to the server but the player. Meaning that if they Join in Progress, after 5 minutes they will be respawned. Is there a way to make this script based on server time and not local, so if they join the mission after 5 minutes have already passed server time, they will be respawned? Spoiler [] spawn { sleep 300; if ([] call BIS_fnc_didJIP) then { forceRespawn player }; }; Share this post Link to post Share on other sites
HazJ 1289 Posted December 21, 2018 No need to use that BIS function since initPlayerLocal.sqf has that already. You can use time, serverTime or diag_tickTime to accomplish this. https://community.bistudio.com/wiki/time 2 Share this post Link to post Share on other sites
Mattmad1234 3 Posted December 21, 2018 I see what you are getting at here, but am a little confused on how I would actually implement that. (I'm a little new to scripting sorry...) Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted December 21, 2018 4 hours ago, Mattmad1234 said: I see what you are getting at here, but am a little confused on how I would actually implement that. (I'm a little new to scripting sorry...) Could be something like this (untested): //description.ext class CfgDebriefing { class tooLate { title = "Too Late"; subtitle = ""; description = "Mission in progress, wait for restart to join again."; pictureBackground = ""; picture = "b_inf"; pictureColor[] = {0.0,0.3,0.6,1}; }; }; //initServer.sqf missionNamespace setVariable ["TAG_fnc_kickJIP",false,true]; _lockOut = [] spawn { waitUntil {serverTime > 300}; missionNamespace setVariable ["TAG_fnc_kickJIP",true,true]; }; //initPlayerLocal.sqf params ["_player","_didJIP"]; if (_didJIP AND missionNamespace getVariable ["TAG_fnc_kickJIP",false]) exitWith { "tooLate" call BIS_fnc_endMission;//will end mission locally for player }; Cheers 3 1 Share this post Link to post Share on other sites
HazJ 1289 Posted December 21, 2018 Yeah that! ^^ Sorry I couldn't be more help, it was just way too early for me to code haha. I made a rule. No coding after 2 am. Sh*t tends to get crazy otherwise. Nap time. 2 Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted December 21, 2018 25 minutes ago, HazJ said: Yeah that! ^^ Sorry I couldn't be more help, it was just way too early for me to code haha. I made a rule. No coding after 2 am. Sh*t tends to get crazy otherwise. Nap time. Not a question of daytime, it's a question of how much coffee you had and if you're physically capable of making another mug o' black gold. Cheers 1 Share this post Link to post Share on other sites
HazJ 1289 Posted December 21, 2018 No coffee and couldn't be bothered to get up. I'm glued to my chair. Share this post Link to post Share on other sites