mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
auto login
I hate sitting in the lobby for the full 90 seconds before loading. - Default login delay is 10 seconds, can be set in the mission - Players cannot deselect or change character slots - Players can click OK or disconnect before timeout
This commit is contained in:
43
SQF/dayz_code/init/lobbyAutoJoin.sqf
Normal file
43
SQF/dayz_code/init/lobbyAutoJoin.sqf
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Auto join script by icomrade for ArmA 2 DayZ Epoch
|
||||
* Disable auto join in your mission's description.ext using defValueParam1 = 31;
|
||||
* Must be executed from RscDisplayMultiplayerSetup onLoad
|
||||
*/
|
||||
private ["_timer","_dialog","_time","_infoText","_roleSelect","_timerStart","_paramDisplay","_paramCtrl","_valueText","_test","_paramButton"];
|
||||
disableSerialization;
|
||||
|
||||
_dialog = ((_this select 0) select 0);
|
||||
waitUntil {ctrlShown (_dialog displayCtrl 109)};
|
||||
disableUserInput True;
|
||||
|
||||
ctrlActivate (_dialog displayCtrl 128);
|
||||
_paramDisplay = findDisplay 146;
|
||||
_paramCtrl = _paramDisplay displayCtrl 102;
|
||||
_valueText = _paramCtrl lbText 1;
|
||||
(findDisplay 146) CloseDisplay 2;
|
||||
_test = count (toArray _valueText);
|
||||
disableUserInput false;
|
||||
|
||||
if (_test > 3 || _test < 1) exitWith {};
|
||||
|
||||
_time = diag_tickTime;
|
||||
_infoText = _dialog displayCtrl 300;
|
||||
_roleSelect = _dialog displayCtrl 109;
|
||||
_paramButton = _dialog displayCtrl 128;
|
||||
_roleSelect ctrlEnable False;
|
||||
_infoText ctrlShow true;
|
||||
_paramButton ctrlShow false;
|
||||
_timerStart = parseNumber _valueText;
|
||||
|
||||
while {(diag_tickTime - _time) <= _timerStart} do {
|
||||
_roleSelect ctrlEnable False;
|
||||
_timer = _timerStart - (diag_tickTime - _time);
|
||||
_infoText ctrlSetText format[localize "str_autojoin_warning", (round _timer)];
|
||||
_infoText ctrlSetBackgroundColor [0,0,0,0.5];
|
||||
_infoText ctrlSetTextColor [0.75,0.1,0.1,1];
|
||||
uiSleep 1;
|
||||
};
|
||||
|
||||
_infoText ctrlSetBackgroundColor [0,0,0,0];
|
||||
_infoText ctrlSetTextColor [0.75,0.1,0.1,0];
|
||||
ctrlActivate (_dialog displayCtrl 1);
|
||||
Reference in New Issue
Block a user