Confirming that a player is in-game after log-in (Help Request)

PezDax

Member
I have a script that I need to execute from my Mission File, init.sqf, once the player is in-game properly (not before).

I currently have a timer set up to create a delay after log-in, before the script runs.

The problem I have is that the time varies from log-on until the player is in-game from player to player.

Is there a variable, flag, or combination of variables that I can check to be sure that the player is actually in-game before the script runs?

Thanks.
 
AGN Safezone Commander uses this. Seems to work pretty well. Just set a sleep after it to compensate a little.
Code:
waitUntil {!isNil "dayz_animalCheck"};
 
This is how I handle HALO spawn on overwatch. So you might find it useful:

Code:
if (!isDedicated) then {
    [] spawn {
        waitUntil { !isNil ("dayz_animalCheck") and
!(player getVariable ["humanity",0] > 5000 and
typeOf player == "Survivor2_DZ") and
!(player getVariable ["humanity",0] < -2000 and
(typeOf player == "Survivor2_DZ" or
typeOf player == "SurvivorW2_DZ") ) and
!(player getVariable ["humanity",0] > 0 and
(typeOf player == "Bandit1_DZ" or
typeOf player == "BanditW1_DZ") )
};
 
        if (PVCDZ_plr_Login2 select 2) then
        {
            _pos = position player;
            _mkr setMarkerPos [_pos select 0, _pos select 1];
            player spawn MC_BIS_halo_spawn;
        };
    };
 
Back
Top