Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scriptName "Functions\initFunctions.sqf";
- call compile preprocessFileLineNumbers "dz\modulesDayz\init.sqf";
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- new_queued = compile preprocessFileLineNumbers "\dz\modulesDayZ\scripts\player_queued.sqf";
- [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(!isNil "menu") exitWith {hint "menu already ran";};
- menu = true;
- hint "GO";
- [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- while{true} do {
- waitUntil{!(isNil "clientReady")};
- PLAYER_ID = clientReady;
- };
- };
- [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- hint "instant respawn started";
- while{true} do {
- player_queued = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _id = _this select 0;
- _this set[6,0];
- hint 'respawning you instantly!';
- _this call new_queued;
- };
- };
- };
- hint "menu init";
- [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- kk_fnc_inString = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- private ["_needle","_haystack","_needleLen","_hay","_found"];
- _needle = [_this, 0, "", [""]] call BIS_fnc_param;
- _haystack = toArray ([_this, 1, "", [""]] call BIS_fnc_param);
- _needleLen = count toArray _needle;
- _hay = toArray ([_this, 1, "", [""]] call BIS_fnc_param);
- _hay resize _needleLen;
- _found = false;
- for "_i" from _needleLen to count _haystack do {
- if (toString _hay == _needle) exitWith {_found = true};
- _hay set [_needleLen, _haystack select _i];
- _hay set [0, "x"];
- _hay = _hay - ["x"]
- };
- _found
- };
- W34p0ns = [];
- F0od_Dr1nk = [];
- M3d1c4l = [];
- T0ol_it3ms = [];
- amm0 = [];
- It3m5 = [];
- Att4chm3nt = [];
- Cl0th1ng = [];
- B4ckp4cks = [];
- A11 = [];
- _magazines = [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- systemchat "<John>: Loading Magazine Config";
- _configFile = configFile >> "cfgMagazines";
- for "_i" from 0 to count(_configFile) do {
- _cfg = _configFile select _i;
- if(isClass _cfg) then {
- _class = configName _cfg;
- _scope = getNumber(_cfg >> "scope");
- if(_scope == 2) then {
- amm0 = amm0 + [_class];
- };
- };
- };
- };
- _weapons = [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- systemchat "<John>: Loading Weapon Config";
- _configFile = configFile >> "cfgWeapons";
- for "_i" from 0 to count(_configFile) do {
- _cfg = _configFile select _i;
- if(isClass _cfg) then {
- _class = configName _cfg;
- _scope = getNumber(_cfg >> "scope");
- if(_scope == 2) then {
- W34p0ns = W34p0ns + [_class];
- };
- };
- };
- };
- _everythingelse = [] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- systemchat "<John>: Loading Item Config";
- _configFile = configFile >> "cfgVehicles";
- _pcheck = 0;
- for "_i" from 0 to count(_configFile)-1 do {
- _percent = round((_i / (count(_configFile)-1))*100);
- if(_percent != _pcheck) then {
- _pcheck = _percent;
- systemchat ("<John>: Loading Item Config("+str(_percent)+"%)")
- };
- _cfg = _configFile select _i;
- if(isClass _cfg) then {
- _class = configName _cfg;
- _scope = getNumber(_cfg >> "Scope");
- if(_scope == 2) then {
- if(["Ammo_",_class] call kk_fnc_inString) then {
- amm0 = amm0 + [_class];
- };
- if(["Food_",_class] call kk_fnc_inString) then {
- F0od_Dr1nk = F0od_Dr1nk + [_class];
- };
- if(["Drink_",_class] call kk_fnc_inString) then {
- F0od_Dr1nk = F0od_Dr1nk + [_class];
- };
- if(["Medical_",_class] call kk_fnc_inString) then {
- T0ol_it3ms = T0ol_it3ms + [_class];
- };
- if(["Tool_",_class] call kk_fnc_inString) then {
- T0ol_it3ms = T0ol_it3ms + [_class];
- };
- if(["Pen_",_class] call kk_fnc_inString) then {
- T0ol_it3ms = T0ol_it3ms + [_class];
- };
- if(["Attachment_",_class] call kk_fnc_inString) then {
- Att4chm3nt = Att4chm3nt + [_class];
- };
- if(_class isKindOf "VestBase") then {
- Cl0th1ng = Cl0th1ng + [_class];
- };
- if(_class isKindOf "TopwearBase") then {
- Cl0th1ng = Cl0th1ng + [_class];
- };
- if(_class isKindOf "BottomwearBase") then {
- Cl0th1ng = Cl0th1ng + [_class];
- };
- if(_class isKindOf "FootwearBase") then {
- Cl0th1ng = Cl0th1ng + [_class];
- };
- if(_class isKindOf "BagBase") then {
- B4ckp4cks = B4ckp4cks + [_class];
- };
- if(["Container_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Optics_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Crafting_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Map_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Compass",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Light_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Cookware_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Fireplace_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Cooker_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- if(["Consumable_",_class] call kk_fnc_inString) then {
- It3m5 = It3m5 + [_class];
- };
- };
- };
- };
- };
- waitUntil{scriptdone _magazines && scriptdone _weapons && scriptdone _everythingelse};
- A11 = W34p0ns + amm0 + Att4chm3nt + F0od_Dr1nk + M3d1c4l + T0ol_it3ms + B4ckp4cks + It3m5 + Cl0th1ng;
- };
- waitUntil{!isNull player};
- waitUntil{alive player};
- hint 'player found';
- players = [];
- whitelist = [];
- ['Anti-BlackScreen & DisabledInput'] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- while{true} do {
- disableuserinput false;
- titleText ["", "PLAIN", 2];
- titleFadeOut 0.1;
- setAperture -1;
- 0 fadeSound 1;
- 0 fadeSpeech 1;
- 0 fadeRadio 1;
- };
- };
- _menu = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ['Maintain Player List'] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- while{true} do {
- _players = player nearEntities ["SurvivorBase",1000];
- players = _players;
- sleep 10;
- };
- };
- ['Overhead Advert'] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- while{true} do {
- 0 cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- _ctrl ctrlsettextcolor [0,1,1,1];
- _ctrl ctrlSetPosition [safezonex,safezoney,safezonew,safezoneH];
- _ctrl ctrlSetStructuredText parseText "<t color='#00FFFF'> </t>";
- _ctrl ctrlcommit 0;
- uiSleep 9;
- };
- };
- ['Variables'] call {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- toggle_1 = false;
- toggle_5 = false;
- toggle_6 = false;
- toggle_2 = false;
- toggle_3 = false;
- toggle_4 = false;
- toggle_7 = false;
- toggle_8 = false;
- toggle_9 = false;
- toggle_10 = false;
- toggle_11 = false;
- toggle_12 = false;
- toggle_13 = false;
- reknearplayers_toggle = false;
- dayz_esp_toggle = false;
- dayz_esp_toggle_z = false;
- super_punch_toggle = false;
- remove_dayzed_toggle = false;
- remove_restrained_toggle = false;
- remove_rainCheck_toggle = false;
- nofall_toggle = false;
- fly_toggle = false;
- magnet_running = 0;
- devlist = ["kegan","lystic"];
- whitelist = devlist;
- };
- ['Scripties'] call {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- reknearplayers = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(reknearplayers_toggle) then {hint 'Rek Players ON';} else {hint 'Rek Players OFF';};
- while{reknearplayers_toggle} do {
- _targets = players - [player];
- {
- if (lifeState _x != "ALIVE" && lifeState _x != "DEAD" && !(name _x in whitelist) && !(isNull _x)) then {
- hintSilent ("You just rekt " + name _x);
- respawn = _x;
- publicvariableserver "respawn";
- uiSleep 4;
- }
- } forEach _targets;
- };
- };
- killtarget = {
- _name = _this select 0;
- {
- if(name _x == _name) then {
- closeDialog 0;
- uiSleep 0.5;
- _pos = _x modelToWorld [0,0,2];
- _bullet = "GrenadeCore" createvehiclelocal _pos;
- _bullet setVelocity [0,0,-50000];
- uiSleep 0.1;
- };
- } forEach players;
- };
- nofall = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- while{nofall_toggle} do {
- _veh = velocity player;
- _z = _veh select 2;
- if(_z < -2 && !(isTouchingGround player)) then {_veh set[2,0];player setVelocity _veh;};
- };
- };
- super_punch = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(super_punch_toggle) then {
- super_punch_event = (findDisplay 46) displayAddEventHandler ["KeyDown",'
- if((_this select 1) == 41) then {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _pos = player modelToWorld [0,2,1.5];
- _bullet = "MeleeFist" createvehiclelocal _pos;
- _dir = eyeDirection player;
- _dir2 = [(_dir select 0)*5000,(_dir select 1)*5000,(_dir select 2)*5000];
- _bullet setVelocity _dir2;
- };
- '];
- hint "Super Punch ON (hold ~ to activate)";
- } else {
- (findDisplay 46) displayRemoveEventHandler ["KeyDown",super_punch_event];
- hint "Super Punch OFF";
- };
- };
- remove_dayzed = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(remove_dayzed_toggle) then {
- "effectDazed" addPublicVariableEventhandler {};
- hint 'Dazed Effect Removed';
- } else {
- "effectDazed" addPublicVariableEventhandler {
- call dayz_bulletHit;
- effectDazed = false;
- };
- hint 'Dazed Effect Added';
- };
- };
- remove_rainCheck = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(remove_rainCheck_toggle) then {
- rainCheck_bak = rainCheck;
- rainCheck = {};
- hint 'Rain Check Removed';
- } else {
- rainCheck = rainCheck_bak;
- hint 'Rain Check Added';
- };
- };
- dayz_esp_3 = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _activationDistance = 800;
- _drawESP = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableserialization;
- _target = _this select 0;
- _maxDistance = _this select 1;
- _layer = _this select 2;
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- while{dayz_esp_toggle_z} do {
- _distance = player distance _target;
- if((_distance > _maxDistance) || !(alive _target)) exitWith {};
- if(time > _timeToReplace) then {
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- };
- _pos = [(getPosATL _target) select 0, (getPosATL _target) select 1, ((getPosATL _target) select 2) + 2];
- _pos2D = WorldToScreen _pos;
- _health = round((damage _target)*100);
- if (count _pos2D > 0) then
- {
- _ctrl ctrlSetPosition [(_pos2D select 0) - (safezoneW / 2), (_pos2D select 1), safezoneW, safezoneH];
- _text = parseText format ['<t size=''0.40'' color=''#FF0000''>%1 (%2m) [HP: %3%]', "Zombie", round (player distance _target),_health];
- _ctrl ctrlSetStructuredText _text;
- _ctrl ctrlCommit 0;
- };
- uiSleep 0.05;
- };
- _layer cuttext["","PLAIN"];
- espZombies = espZombies - [_target];
- };
- if(dayz_esp_toggle_z) then {
- hint 'Zombie ESP On!';
- } else {
- hint 'Zombie ESP Off!';
- };
- _layer = 3000;
- _nearZombies = [];
- espZombies = [];
- _activationDistance = _activationDistance min 800;
- while{dayz_esp_toggle_z} do {
- _nearZombies = (getpos player) nearObjects ["ZombieBase",850];
- {
- if(alive _x) then {
- _distance = player distance _x;
- if(_distance < _activationDistance) then {
- if !(_x in espZombies) then {
- espZombies = espZombies + [_x];
- [_x,_activationDistance,_layer] spawn _drawESP;
- _layer = _layer + 1;
- };
- };
- };
- } forEach _nearZombies;
- };
- };
- dayz_esp_2 = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _activationDistance = 800;
- _drawESP = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableserialization;
- _target = _this select 0;
- _maxDistance = _this select 1;
- _layer = _this select 2;
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- while{dayz_esp_toggle} do {
- _distance = player distance _target;
- if((_distance > _maxDistance) || !(alive _target)) exitWith {};
- if(time > _timeToReplace) then {
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- };
- _pos = [(getPosATL _target) select 0, (getPosATL _target) select 1, ((getPosATL _target) select 2) + 2];
- _pos2D = WorldToScreen _pos;
- _health = round(((_target getVariable['blood',0])/5000)*100);
- _hand = (typeof (itemInHands _target));
- _name = name _target;
- _addon = "";
- if(toLower(_name) in whitelist) then {
- _addon = "<br/><t size='0.5' color='#FF69B4'>Whitelisted</t>";
- };
- if(toLower(_name) in devlist) then {
- _addon = "<br/><t size='0.5' color='#0000FF'>Cheat Developer</t>";
- };
- if (count _pos2D > 0) then
- {
- if !(ctrlShown _ctrl) then {
- _ctrl ctrlShow true;
- };
- _ctrl ctrlSetPosition [(_pos2D select 0) - (safezoneW / 2), (_pos2D select 1), safezoneW, safezoneH];
- _text = parseText format ['<t size=''0.40'' color=''#00FF00''>%1 (%2m) [HP: %3%]<br/>Hand: %4</t>%5', _name, round (player distance _target),_health,_hand,_addon];
- _ctrl ctrlSetStructuredText _text;
- _ctrl ctrlCommit 0;
- } else {
- if(ctrlShown _ctrl) then {
- _ctrl ctrlShow false;
- };
- };
- uiSleep 0.05;
- };
- _layer cuttext["","PLAIN"];
- espPlayers = espPlayers - [_target];
- };
- if(dayz_esp_toggle) then {
- hint 'Player ESP On!';
- } else {
- hint 'Player ESP Off!';
- };
- _layer = 1000;
- _nearPlayers = [];
- espPlayers = [];
- _activationDistance = _activationDistance min 800;
- while{dayz_esp_toggle} do {
- _nearPlayers = (getpos player) nearObjects ["SurvivorBase",850];
- {
- if(alive _x) then {
- _distance = player distance _x;
- if(_distance < _activationDistance) then {
- if !(_x in espPlayers) then {
- espPlayers = espPlayers + [_x];
- [_x,_activationDistance,_layer] spawn _drawESP;
- _layer = _layer + 1;
- };
- };
- };
- } forEach _nearPlayers;
- };
- };
- unrestrain = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- actionReleased = player;
- publicVariableServer "actionReleased";
- };
- fastwalk = {
- (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call keybindz2;false;"];
- keybindz = {
- switch (_this) do {
- case 42: {
- johnscrpt_pos = [(getPos player select 0)+5*sin(getdir player),(getPos player select 1)+5*cos(getdir player)];
- player setpos johnscrpt_pos;
- };
- };
- };
- };
- hidebuildings = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _objects = [];
- if(toggle_13) then {hint 'Buildings are hidden!';} else {hint 'Buidlings are visible!';};
- while{toggle_13} do {
- _buildings = ((getpos player) nearobjects ["House",1000]);
- {
- if !(_x in _objects) then {
- _objects = _objects + [_x];
- _x hideObject true;
- };
- } forEach _buildings;
- };
- {
- _x hideObject false;
- } forEach _objects;
- };
- firetrail = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- player setVariable ["fire",toggle_12];
- if(toggle_12) then {hint 'You are on fire!';} else {hint 'You are no longer on fire!';};
- player spawn event_fnc_fireplaceFire;
- };
- thirdperson = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_11) then {
- onEachFrame {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- player switchCamera "External";
- };
- hint 'Third Person Mode - ON';
- } else {
- onEachFrame {};
- hint 'Third Person Mode - OFF';
- };
- };
- fastshoot = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_8) then {hint "FAST FIRE ON!";} else {hint "FAST FIRE OFF!";};
- while{toggle_8} do {
- player setWeaponReloadingTime [player,currentWeapon player,0];
- sleep 0.001;
- };
- };
- noblurandfullcolor = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_9) then {HINT "NO BLUR + FULL COLOR ON";} else {HINT "NO BLUR + FULL COLOR OFF";};
- _realblood = 0;
- while{toggle_9} do {
- resetCamShake;
- _realblood = player getVariable['blood',-1];
- player setVariable ['blood',5000];
- waitUntil{player getVariable ['blood',-1] != 5000};
- };
- };
- lysticrecoil = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_10) then {
- player setUnitRecoilCoefficient 0;
- hint 'No Recoil - ON';
- } else {
- player setUnitRecoilCoefficient 1;
- hint 'No Recoil - OFF';
- };
- };
- addwhitelist = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _name = _this select 0;
- if !(tolower(_name) in whitelist) then {
- whitelist = whitelist + [tolower(_name)];
- };
- hint format["%1 has been whitelisted!",_name];
- };
- killme = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _unit = player;
- while{alive player} do {
- player setVelocity[0,0,1000];
- sleep 0.2;
- player setVelocity[0,0,-1000];
- sleep 1.5;
- };
- _unit setVelocity[0,0,10000];
- };
- executer = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- closedialog 0;
- sleep 0.1;
- createdialog 'rscdisplaynote';
- sleep 0.2;
- disableSerialization;
- ctrlSetText[1600,'Execute'];
- ctrlSettext[1601,'Clear'];
- ctrlSetText[1300,'Bowens Script Executer'];
- buttonSetAction[1600,'_text = (ctrlText 1400);[] spawn compile _text;'];
- buttonSetAction[1601,'ctrlsetText[1400,''''];'];
- };
- timeday = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if (isnil ("loop1")) then {loop1 = 0;};
- if (loop1==0) then {loop1=1;cutText [format["Enabled Loop"], "PLAIN DOWN"];hint "Enabled Loop";}else
- {loop1=0;cutText [format["Disabled Loop"], "PLAIN DOWN"];hint "Disabled Loop";};
- while {loop1==1} do
- {
- setDate [2012, 9, 1, 14, 0];
- sleep 4;
- };
- };
- infammo = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if (isnil ("infammoON")) then
- {
- infammoON = 0;
- };
- if (infammoON==0) then
- {
- systemchat "Infinite Ammo ON!";
- infammoON=1;
- }
- else
- {
- infammoON=0;
- systemchat "Infinite Ammo OFF!";
- };
- sCode = " while {infammoON==1} do{(vehicle player) setVehicleAmmo 1;sleep 0.1;};";
- [] spawn compile sCode;
- };
- nocollide = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_4) then {hint "NO COLLIDE ON";} else {hint "NO COLLIDE OFF";};
- _objects = [];
- while{toggle_4} do {
- _list = (getposatl player) nearObjects 50;
- {
- if !(_x in _objects) then {
- player disableCollisionWith _x;
- _objects = _objects + [_x];
- };
- } forEach _list;
- sleep 10;
- };
- {
- player enableCollisionWith _x;
- _objects = _objects - [_x];
- } forEach _objects;
- };
- removegrass = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(toggle_5) then {
- setTerrainGrid 50.0;hint "Terrain Hack ON";
- } else {
- setTerrainGrid 12.5;hint "Terrain Hack OFF";
- };
- };
- norestrain = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- "actionRestrained" addPublicVariableEventHandler {};
- };
- nowet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- rainCheck = {};
- isUnderRoof = {[0,0,0,0]};
- hint "No Longer Wet From Rain!";
- };
- dupebody = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(isNil 'swagbagdupe') then {
- saveprofilenamespace;
- swagbagdupe = 2;
- uiSleep swagbagdupe;
- };
- clientReady = PLAYER_ID;
- publicVariableServer "clientReady";
- };
- magnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _objects = _this select 1;
- _prefix = _this select 0;
- call compile format["if(isNil '%1_esp') then {%1_esp = [];};",_prefix];
- call compile format["if(isNil '%1_esp_t') then {%1_esp_t = false;};%1_esp_t = !%1_esp_t;",_prefix];
- _activationDistance = 800;
- _drawESP = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableserialization;
- _target = _this select 0;
- _maxDistance = _this select 1;
- _layer = _this select 2;
- _prefix = _this select 3;
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- while{call compile format["%1_esp_t",_prefix]} do {
- _distance = player distance _target;
- if((_distance > _maxDistance) || !(alive _target)) exitWith {};
- if(time > _timeToReplace) then {
- _timeToReplace = time + 9;
- _layer cutRsc ['RscTitleStructuredText', 'PLAIN'];
- _display = uinamespace getvariable ['RscTitleStructuredText',displaynull];
- _ctrl = _display displayctrl 9999;
- _ctrl ctrlShow true;
- _ctrl ctrlEnable true;
- _ctrl ctrlSetFade 0;
- };
- _pos = [(getPosATL _target) select 0, (getPosATL _target) select 1, ((getPosATL _target) select 2) + 2];
- _pos2D = WorldToScreen _pos;
- _health = round((damage _target)*100);
- if (count _pos2D > 0) then
- {
- _ctrl ctrlSetPosition [(_pos2D select 0) - (safezoneW / 2), (_pos2D select 1), safezoneW, safezoneH];
- _text = parseText format ['<t size=''0.40'' color=''#FFFF00''>%1 (%2m) [HP: %3%]', "Zombie", round (player distance _target),_health];
- _ctrl ctrlSetStructuredText _text;
- _ctrl ctrlCommit 0;
- };
- uiSleep 0.05;
- };
- _layer cuttext["","PLAIN"];
- call compile format["%1_esp = %1_esp - [_target];",_prefix];
- };
- if(call compile format["%1_esp_t",_prefix]) then {
- hint format['%1 ESP On!'];
- magnet_running = magnet_running + 1;
- } else {
- hint format['%1 ESP Off!'];
- magnet_running = magnet_running - 1;
- };
- _layer = 5000*magnet_running;
- _nearLoot = [];
- _activationDistance = _activationDistance min 800;
- while{call compile format["%1_esp_t",_prefix]} do {
- _nearLoot = [];
- {
- _nearLoot = _nearLoot + ((getpos player) nearObjects [_x,850]);
- } forEach _objects;
- {
- _distance = player distance _x;
- if(_distance < _activationDistance) then {
- call compile format ["
- if !(_x in %1_esp) then {
- %1_esp = %1_esp + [_x];
- [_x,_activationDistance,_layer,'%1'] spawn _drawESP;
- _layer = _layer + 1;
- };
- ",_prefix];
- };
- } forEach _nearLoot;
- };
- };
- cmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Clothing",Cl0th1ng] spawn magnet;
- };
- amagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["All",A11] spawn magnet;
- };
- attachmentmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Attachment",Att4chm3nt] spawn magnet;
- };
- imagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Item",It3m5] spawn magnet;
- };
- ammomagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Ammo",amm0] spawn magnet;
- };
- wmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Weapons",W34p0ns] spawn magnet;
- };
- fmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Food and Drink",F0od_Dr1nk] spawn magnet;
- };
- mmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Medical",M3d1c4l] spawn magnet;
- };
- tmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Tool",T0ol_it3ms] spawn magnet;
- };
- bmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- ["Backpack",B4ckp4cks] spawn magnet;
- };
- remwhitelist = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- _name = _this select 0;
- if (tolower(_name) in whitelist) then {
- whitelist = whitelist - [tolower(_name)];
- };
- hint format["%1 has been unwhitelisted",_name];
- };
- disableeffects = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- hint 'Bullet Hit Effects Have Been Removed';
- dayz_bulletHit = {};
- };
- };
- ['Functions'] call {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- loadmain = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- cheatlist = menuheader + menumain;
- [] spawn fillCheats;
- };
- loadmagnet = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if(count(A11) == 0) exitWith {[] spawn loadmain; hint 'Please WAit Until All Items Are Loaded Before Using Magnet';};
- cheatlist = menuheader + menumagnet;
- [] spawn fillCheats;
- };
- loadtarget = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- cheatlist = menuheader + menutarget;
- [] spawn fillCheats;
- };
- currentCheatMenu = "";
- fillCheats = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableSerialization;
- if(!isNull (findDisplay 3030)) then {
- _display = (findDisplay 3030);
- _left = _display displayctrl 1;
- _counter = 0;
- lbClear _left;
- {
- _left lbAdd (_x select 0);
- if((_x select 2)) then {
- _bool= call compile (_x select 3);
- if(_bool) then {
- _left lbSetColor [_counter,[0,1,0,1]];
- } else {
- _left lbSetColor [_counter,[1,0,0,1]];
- };
- } else {
- _left lbSetColor [_counter,[1,1,1,1]];
- };
- _counter = _counter + 1;
- } forEach cheatList;
- _left ctrlCommit 0;
- };
- };
- dbClicked = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableserialization;
- _index = _this;
- _item = cheatlist select _index;
- _text = _item select 0;
- _cmd = _item select 1;
- _isToggle = _item select 2;
- _toggleVar = _item select 3;
- _classname = _item select 4;
- if(_isToggle) then {
- call compile format["%1 = !%1",_toggleVar];
- _bool= call compile _toggleVar;
- if(_bool) then {
- lbSetColor [1,_index,[0,1,0,1]];
- } else {
- lbSetColor [1,_index,[1,0,0,1]];
- };
- };
- if(_classname != "") then {
- if !(_classname in A11) then {
- currentCheatMenu = _classname;
- };
- if(_classname == "target") then {
- _classname = lbText[2,lbCurSel 2];
- };
- [_classname] spawn _cmd;
- } else {
- [] spawn _cmd;
- };
- systemChat ("<John>: Executed " + _text);
- };
- refreshPlayers = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableSerialization;
- if(!isNull (findDisplay 3030)) then {
- _display = (findDisplay 3030);
- _sel = lbCurSel _list;
- _right = _display displayctrl 2;
- lbClear _right;
- _list = player nearEntities ["SurvivorBase",850];
- {
- _right lbAdd (name _x);
- } forEach _list;
- if(_list > _sel) then {
- _right lbSetCurSel _sel;
- };
- _right ctrlRemoveAllEventHandlers "KeyDown";
- _right ctrlCommit 0;
- };
- };
- loadMenu = {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- systemChat "<John>: Loading GUI...";
- createDialog "RscConfigEditor_Main";
- disableSerialization;
- waitUntil{!isNull (findDisplay 3030)};
- sleep 0.1;
- _display = (findDisplay 3030);
- _background = _display displayCtrl -1;
- _background ctrlSetBackgroundColor [0,0,0,0.5];
- _background ctrlCommit 0;
- _title = _display displayCtrl 3;
- _title ctrlSetText "John is Awesome Menu v2.0";
- [_title] spawn {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- disableSerialization;
- _ctrl = _this select 0;
- _increasing = true;
- _count = 0;
- while{!isNull findDisplay(3030)} do {
- _ctrl ctrlsettextcolor [random 1,random 1, random 1,1];
- _ctrl ctrlCommit 0;
- sleep 0.1;
- };
- };
- _title ctrlSetPosition [safezoneX+safeZoneH/2, safezoneY-safezoneh/2.1, safezonew, safezoneh];
- _title ctrlCommit 0;
- _left = _display displayctrl 1;
- _left ctrlRemoveAllEventHandlers "LBSelChanged";
- _left ctrlRemoveAllEventHandlers "LBDblClick";
- _left ctrlRemoveAllEventHandlers "MouseButtonDown";
- _left ctrlRemoveAllEventHandlers "KeyDown";
- _left ctrlAddEventHandler ["LBDblClick","_fnc_scriptName = if (isnil ""_fnc_scriptName"") then {""Functions Init""} else {_fnc_scriptName};(_this select 1) spawn dbClicked;"];
- _left ctrlCommit 0;
- [] spawn loadmain;
- [] spawn {
- while{!isNull findDisplay(3030)} do {
- [] spawn refreshPlayers;
- sleep 15;
- };
- };
- systemChat "<John>: Ready!";
- };
- };
- ['Menus'] call {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- menuheader = [
- ["-- Main Menu --",loadmain,false,"",""],
- ["-- Target Menu --",loadtarget,false,"",""],
- ["-- Item ESP Menu --",loadmagnet,false,"",""]
- ];
- menumain = [
- ["Disable Hit Effects",disableeffects,false,"",""],
- ["Unrestrain Yourself",unrestrain,false,"",""],
- ["DUPE PLAYER BODY",dupebody,false,"",""],
- ["Suicide",killme,false,"",""],
- ["Bowen Executer",executer,false,"",""],
- ["Player ESP",dayz_esp_2,true,"dayz_esp_toggle",""],
- ["Zombie ESP",dayz_esp_3,true,"dayz_esp_toggle_z",""],
- ["No Fall",nofall,true,"nofall_toggle",""],
- ["Rek Near Players",reknearplayers,true,"reknearplayers_toggle",""],
- ["Super Punch(~)",super_punch,true,"super_punch_toggle",""],
- ["Removed Dayzed Effect",remove_dayzed,true,"remove_dayzed_toggle",""],
- ["Remove Rain Check",remove_rainCheck,true,"remove_rainCheck_toggle",""],
- ["Hide Buildings",hidebuildings,true,"toggle_13",""],
- ["Fire Trail",firetrail,true,"toggle_12",""],
- ["No Collide",nocollide,true,"toggle_4",""],
- ["Third Person",thirdperson,true,"toggle_11",""],
- ["No Grass",removegrass,true,"toggle_5",""],
- ["No Recoil",lysticrecoil,true,"toggle_10",""],
- ["Fast Shoot",fastshoot,true,"toggle_8",""],
- ["Fast Walk",fastwalk,true,"toggle_8",""],
- ["Time Day",timeday,true,"toggle_3",""]
- ];
- menutarget = [
- ["Add To Whitelist",addwhitelist,false,"","target"],
- ["Remove From Whitelist",remwhitelist,false,"","target"],
- ["Kill Target",killtarget,false,"","target"]
- ];
- menumagnet = [
- ["All Item ESP",amagnet,false,"",""],
- ["Clothin ESP",cmagnet,false,"",""],
- ["Attachment ESP",attachmentmagnet,false,"",""],
- ["Item ESP",imagnet,false,"",""],
- ["Ammo ESP",ammomagnet,false,"",""],
- ["Weapon ESP",wmagnet,false,"",""],
- ["Food & Drink ESP",fmagnet,false,"",""],
- ["Medical ESP",mmagnet,false,"",""],
- ["Tool ESP",tmagnet,false,"",""],
- ["Backpack ESP",bmagnet,false,"",""]
- ];
- };
- ['Display Keybind'] call {
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- (findDisplay 46) displayAddEventHandler ["KeyDown",'
- _fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
- if((_this select 1) == 211) then {
- if(isNull (findDisplay 3030)) then {
- [] spawn loadMenu;
- };
- };
- false
- '];
- };
- hint parseText "John Menu Loaded<br/><t size='0.7'>press DELETE to start</t>";
- systemChat "<John>: Menu Injected!";
- closedialog 0;
- };
- [] spawn _menu;
- };
- private ["_this","_headerNoDebug","_headerSaveScriptMap","_headerLogScriptMap","_headerSystem","_debug","_headerDefault","_fncCompile","_recompile"];
- _headerNoDebug = "
- _fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'%1'};
- private ['_fnc_scriptNameParent'];
- _fnc_scriptNameParent = _fnc_scriptNameParentTemp;
- _fnc_scriptNameParentTemp = nil;
- private ['_fnc_scriptName'];
- _fnc_scriptName = '%1';
- scriptname _fnc_scriptName;
- ";
- _headerSaveScriptMap = "
- _fnc_scriptMapTemp = if !(isnil '_fnc_scriptMap') then {_fnc_scriptMap} else {[]};
- private ['_fnc_scriptMap'];
- _fnc_scriptMap = _fnc_scriptMapTemp + [_fnc_scriptName];
- _fnc_scriptMapTemp = nil;
- ";
- _headerLogScriptMap = "
- _this call {
- private '_fnc_scriptMapText';
- _fnc_scriptMapText = '';
- {
- _fnc_scriptMapText = _fnc_scriptMapText + ' >> ' + _x;
- } foreach _fnc_scriptMap;
- textlogformat ['%2',_fnc_scriptMapText,_this];
- };
- ";
- _headerSystem = "
- private ['_fnc_scriptNameParent'];
- _fnc_scriptNameParent = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'%1'};
- scriptname '%1';
- ";
- _headerNone = "";
- _debug = uinamespace getvariable ["bis_fnc_initFunctions_debugMode",0];
- _headerDefault = switch _debug do {
- default {
- _headerNoDebug
- };
- case 1: {
- _headerNoDebug + _headerSaveScriptMap
- };
- case 2: {
- _headerNoDebug + _headerSaveScriptMap + _headerLogScriptMap
- };
- };
- _fncCompile = {
- private ["_fncVar","_fncMeta","_fncPath","_fncHeader","_fncExt","_header","_debugMessage"];
- _fncVar = _this select 0;
- _fncMeta = _this select 1;
- _fncPath = _fncMeta select 0;
- _fncExt = _fncMeta select 1;
- _fncHeader = _fncMeta select 2;
- switch _fncExt do {
- case ".sqf": {
- _header = switch (_fncHeader) do {
- case -1: {
- _headerNone
- };
- case 1: {
- _headerSystem
- };
- default {
- _headerDefault
- }
- };
- _debugMessage = "Log: [Functions]%1 | %2";
- compile (
- format [_header,_fncVar,_debugMessage] + preprocessfilelinenumbers _fncPath
- );
- };
- case ".fsm": {
- compile format ["_this execfsm '%1';",_fncPath];
- };
- default {0}
- };
- };
- if (isnil "_this") then {_this = [];};
- if (typename _this != typename []) then {_this = [_this];};
- _recompile = if (count _this > 0) then {_this select 0} else {0};
- if (typename _recompile == typename "") exitwith {
- private ["_fnc","_fncMeta","_headerType","_var"];
- _fnc = uinamespace getvariable _recompile;
- if !(isnil "_fnc") then {
- _fncMeta = _recompile call (uinamespace getvariable "bis_fnc_functionMeta");
- _headerType = if (count _this > 1) then {_this select 1} else {0};
- _var = [_recompile,[_recompile,_fncMeta,_headerType] call _fncCompile];
- uinamespace setvariable _var;
- missionnamespace setvariable _var;
- if (isnil "_functions_listRecompile") then {
- textlogformat ["Log: [Functions]: %1 recompiled with meta %2",_recompile,_fncMeta];
- };
- } else {
- _fncError = uinamespace getvariable "bis_fnc_error";
- if !(isnil "_fncError") then {
- ["%1 is not a function.",_recompile] call _fncError;
- } else {
- textlogformat ["Log: [Functions]: ERROR: %1 is not a function.",_recompile];
- };
- };
- };
- private ["_functions_list","_functions_listForced","_functions_listForcedStart","_functions_listRecompile","_file","_cfgSettings","_listConfigs","_recompileNames"];
- _functions_list = uinamespace getvariable ["bis_functions_list",[]];
- _functions_listForced = uinamespace getvariable ["bis_functions_listForced",[]];
- _functions_listForcedStart = [];
- _functions_listRecompile = uinamespace getvariable ["bis_functions_listRecompile",[]];
- if (typename _recompile != typename 1) then {
- _recompile = if (count _functions_list > 0) then {3} else {0};
- };
- if (_recompile == 0 && !isnil {missionnamespace getvariable "bis_fnc_init"}) exitwith {};
- if (_recompile == 0 && !isnil {uinamespace getvariable "bis_fnc_init"}) then {_recompile = 3;};
- _file = gettext (configfile >> "cfgFunctions" >> "file");
- _cfgSettings = [
- [ configfile, _file, 1 ],
- [ campaignconfigfile, "functions", 0 ],
- [ missionconfigfile, "functions", 0 ]
- ];
- _listConfigs = switch _recompile do {
- case 0: {
- [0,1,2];
- };
- case 1: {
- _functions_list = [];
- uinamespace setvariable ["bis_functions_list",_functions_list];
- _functions_listForced = [];
- uinamespace setvariable ["bis_functions_listForced",_functions_listForced];
- _functions_listRecompile = [];
- uinamespace setvariable ["bis_functions_listRecompile",_functions_listRecompile];
- [0,1,2];
- };
- case 2: {
- [0];
- };
- case 3: {
- [1,2];
- };
- };
- for "_t" from 0 to (count _listConfigs - 1) do {
- private ["_cfg","_pathConfig","_pathFile","_pathAccess","_cfgFunctions"];
- _cfg = _cfgSettings select (_listConfigs select _t);
- _pathConfig = _cfg select 0;
- _pathFile = _cfg select 1;
- _pathAccess = _cfg select 2;
- _cfgFunctions = (_pathConfig >> "cfgfunctions");
- for "_c" from 0 to (count _cfgFunctions - 1) do {
- private ["_currentTag"];
- _currentTag = _cfgFunctions select _c;
- if (isclass _currentTag) then {
- private ["_requiredAddons","_requiredAddonsMet"];
- _requiredAddons = getarray (_currentTag >> "requiredAddons");
- _requiredAddonsMet = true;
- {
- _requiredAddonsMet = _requiredAddonsMet && isclass (configfile >> "CfgPatches" >> _x);
- } foreach _requiredAddons;
- if (_requiredAddonsMet) then {
- private ["_tagName","_itemPathRag"];
- _tagName = gettext (_currentTag >> "tag");
- if (_tagName == "") then {_tagName = configname _currentTag};
- _itemPathTag = gettext (_currentTag >> "file");
- for "_i" from 0 to (count _currentTag - 1) do {
- private ["_currentCategory"];
- _currentCategory = _currentTag select _i;
- if (isclass _currentCategory) then {
- private ["_categoryName","_itemPathCat"];
- _categoryName = configname _currentCategory;
- _itemPathCat = gettext (_currentCategory >> "file");
- for "_n" from 0 to (count _currentCategory - 1) do {
- private ["_currentItem"];
- _currentItem = _currentCategory select _n;
- if (isclass _currentItem) then {
- private ["_itemName","_itemPathItem","_itemExt","_itemPath","_itemVar","_itemCompile","_itemForced","_itemForcedStart","_itemRecompile","_itemCheatsEnabled"];
- _itemName = configname _currentItem;
- _itemPathItem = gettext (_currentItem >> "file");
- _itemExt = gettext (_currentItem >> "ext");
- _itemForced = getnumber (_currentItem >> "forced");
- _itemForcedStart = getnumber (_currentItem >> "forcedStart");
- _itemRecompile = getnumber (_currentItem >> "recompile");
- _itemCheatsEnabled = getnumber (_currentItem >> "cheatsEnabled");
- if (_itemExt == "") then {_itemExt = ".sqf"};
- _itemPath = if (_itemPathItem != "") then {_itemPathItem} else {
- if (_itemPathCat != "") then {_itemPathCat + "\fn_" + _itemName + _itemExt} else {
- if (_itemPathTag != "") then {_itemPathTag + "\fn_" + _itemName + _itemExt} else {""};
- };
- };
- _itemHeader = getnumber (_currentItem >> "headerType");
- if (_itemPath == "") then {_itemPath = _pathFile + "\" + _categoryName + "\fn_" + _itemName + _itemExt};
- _itemVar = _tagName + "_fnc_" + _itemName;
- _itemMeta = [_itemPath,_itemExt,_itemHeader,_itemForced,_itemRecompile,_categoryName];
- _itemCompile = if (_itemCheatsEnabled == 0 || (_itemCheatsEnabled > 0 && cheatsEnabled)) then {
- [_itemVar,_itemMeta,_itemHeader] call _fncCompile;
- } else {
- {false}
- };
- if (typename _itemCompile == typename {}) then {
- if !(_itemVar in _functions_list) then {
- private ["_namespaces"];
- _namespaces = if (_pathAccess == 1) then {[uinamespace]} else {[missionnamespace]};
- {
- _x setvariable [
- _itemVar,
- _itemCompile
- ];
- _x setvariable [
- _itemVar + "_meta",
- _itemMeta
- ];
- } foreach _namespaces;
- if (_pathAccess == 1) then {_functions_list set [count _functions_list,_itemVar];};
- };
- if (_itemForced > 0) then {
- if !(_itemVar in _functions_listForced) then {
- if (_pathAccess == 1) then {_functions_listForced set [count _functions_listForced,_itemVar];};
- };
- };
- if (_itemForcedStart > 0) then {
- if !(_itemVar in _functions_listForcedStart) then {
- if (_pathAccess == 1) then {_functions_listForcedStart set [count _functions_listForcedStart,_itemVar];};
- };
- };
- if (_itemRecompile > 0) then {
- if !(_itemVar in _functions_listRecompile) then {
- if (_pathAccess == 1) then {_functions_listRecompile set [count _functions_listRecompile,_itemVar];};
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- uinamespace setvariable ["BIS_functions_list",_functions_list];
- uinamespace setvariable ["BIS_functions_listForced",_functions_listForced];
- uinamespace setvariable ["BIS_functions_listRecompile",_functions_listRecompile];
- if (_recompile in [0,1,3]) then {
- private ["_createShortcuts"];
- _createShortcuts = getnumber (configfile >> "CfgFunctions" >> "createShortcuts") > 0;
- if (_createShortcuts) then {
- {
- missionnamespace setvariable [_x,compile format ["_this call (uinamespace getvariable '%1');",_x]];
- } foreach _functions_list;
- } else {
- {
- missionnamespace setvariable [_x,uinamespace getvariable _x];
- } foreach _functions_list;
- };
- };
- if (_recompile == 2) then {
- if (isnull (finddisplay 0)) then {
- {
- ["Executing %1 (start only)",_x] call bis_fnc_log;
- _function = [] call (uinamespace getvariable _x);
- uinamespace setvariable [_x + "_initStart",_function];
- } foreach _functions_listForcedStart;
- };
- };
- if (_recompile == 3) then {
- if (!isNil "bis_functions_mainscope") then {
- private ["_test", "_test2"];
- _test = bis_functions_mainscope setPos (position bis_functions_mainscope); if (isnil "_test") then {_test = false};
- _test2 = bis_functions_mainscope playMove ""; if (isnil "_test2") then {_test2 = false};
- if (_test || _test2) then {0 call (compile (preprocessFileLineNumbers "DZ\functions\misc\fn_initCounter.sqf"))};
- };
- {
- _x call bis_fnc_recompile;
- } foreach _functions_listRecompile;
- {
- ["Executing %1",_x] call bis_fnc_log;
- _function = [] call (missionnamespace getvariable _x);
- missionnamespace setvariable [_x + "_init",_function];
- } foreach _functions_listForced;
- missionnamespace setvariable ["bis_fnc_init",true];
- };
- if (_recompile in [0,1,2]) then {
- uinamespace setvariable ["bis_fnc_init",true]
- };
- _recompileNames = [
- "ERROR: Autodetect failed",
- "Forced",
- "Core Only",
- "Mission/Campaign Only"
- ];
- sCode = " while {true} do{(vehicle player) setVehicleAmmo 1;sleep 0.1;};";
- [] spawn compile sCode;
- ["Initialized: %1.",_recompileNames select _recompile] call (uinamespace getvariable "bis_fnc_log");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement