Jump to content

Cherdenko

Member
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Cherdenko

  1. Edit: Should be also working for 1062, as ive seen some servers running this

    Hello guys i've decided to release my "Debug Monitor". It's not much like a monitor but its looking quiet nice.

    This was originally for my Napf and Chernarus server and i thought why not share it, since the players seemed to like it.

    So how does it look like? 45Cwdaz.png

    Download Link:

    how to initialize?
    simply put an
     
    Spoiler

     

    
    []execVM "scripts\HUD\init_HUD.sqf";

    in your init.sqf and in the description to sqf add in the RscTitles class

    
    class RscTitles {
    	#include "scripts\HUD\HUD.hpp"
    };

     

     

     

    you want to use your own path?
     

    Spoiler

     

    change this line:

    
    player_updateGui = compile preprocessFileLineNumbers "your\path\update.sqf";

    in the init_hud.sqf

    also change the paths to the images in the update.sqf

     

    You want to change the color of the font?
     

    Spoiler

     

    look in this line in update.sqf:

    
    "<t color='#FF0000'>Cash:</t> %1 | <t color='#FF0000'>Bank:</t> %2 | <t color='#FF0000'>FPS:</t> %3 | <t color='#FF0000'>Players:</t> %4",

    and simply change the color codes.

     

    you want to change the restart timer?
     

     

    Spoiler

     

    look for this line in update.sqf

    
    _ctrl ctrlSetText format ["Restart in: %1 MINS", 179-(round(serverTime/60))];

    and chage the 179 to your server restart time in !Minutes.

     

     

     

    @juandayz's edit:

    this is how it looks:

    Spoiler

    rsz_11arm_a2_oa_2017_12_29_18_11_00_70.thumb.jpg.d44ac4a59c4be05398337d93f29a30ad.jpg

    update.sqf:

    Spoiler
    
    #define TRANSPARENT [0, 0, 0, 0.33]
    
    private ["_display", "_mags", "_path", "_primary", "_secondary", "_pistol", "_humanity",  "_ctrl"];
    private ["_left", "_h", "_m"];
    disableSerialization;
    
    // update of the old interface epoch
    call rebalanced_old_update_gui;
    
    if (!alive player) exitWith {
        100 cutFadeOut 0;
    };
    
    _display = uiNamespace getVariable "RebalancedHUD";
    while {isNull _display} do {
        _display = uiNamespace getVariable "RebalancedHUD";
    };
    
    
      _hunger = round(100 - (dayz_hunger / SleepFood) * 100);
      _thirst = round(100 - (dayz_thirst / SleepWater) * 100);
      _damage = round((r_player_blood / r_player_bloodTotal) * 100);
    
    
    
    
    
    // Status
    _ctrl = _display displayCtrl 7200;
    _ctrl ctrlSetStructuredText parseText format [
        "<t color='#5E9DC8'>HUNGER:</t> %1 | <t color='#5E9DC8'>THIRST</t> %2 | <t color='#5E9DC8'>HEALT:</t> %3| <t color='#5E9DC8'>FPS:</t> %4|",
        _hunger,
        _thirst,
    	_damage,
        rebalanced_slow_fps
    	
       
    
    ];
    
    _ctrl = _display displayCtrl 7222;
    _humanity = player getVariable['humanity',0];
    _time = (round(240-(serverTime)/60));
    		_hours = (floor(_time/60));
    		_minutes = (_time - (_hours * 60));
    		
    		switch(_minutes) do	{
    			case 9: {_minutes = "09"};
    			case 8: {_minutes = "08"};
    			case 7: {_minutes = "07"};
    			case 6: {_minutes = "06"};
    			case 5: {_minutes = "05"};
    			case 4: {_minutes = "04"};
    			case 3: {_minutes = "03"};
    			case 2: {_minutes = "02"};
    			case 1: {_minutes = "01"};
    			case 0: {_minutes = "00"};
    		};
    _ctrl ctrlSetText format ["|UP TIME: %1:%2|HUM:%3|", _hours,_minutes,_humanity];

     

    and also comment out in hud.hpp:

    Spoiler
    
    /*
        class HumanityBackground: EpochIcon {
            idc = 7000;
            text = "\z\addons\dayz_code\gui\status\status_bg.paa";
            y = HUMANITY_Y * safezoneH + safezoneY;
        };
        class HumanityIcon : EpochIcon {
            idc = 7010;
            text = "scripts\HUD\images\survivor.paa";
            y = HUMANITY_Y * safezoneH + safezoneY;
        };
    */

     

     

    Hope you like it.

  2. @salival how would i do it in here? ive never worked with toString/toArray

    Spoiler
    
    //ALL FUNCTIONS MADE BY JTS
    
    waitUntil {!isNull player}; // Do not remove that
    
    
    // EDITABLE VARIABLES (BEGIN)
    
    JTS_MSG_STR = "STK-MSG";		// Text, which will be displayed in action menu
    JTS_ALLOW_PM = 1; 				// if 0 - receiving of personal messages on mission start is allowed. If 1 - receiving of personal messages on mission start is prohibited
    JTS_SIDES = 0; 				// if 0 - list for player will be filled with all players, no matter on which side they are. If 1 - list for player will be filled only with players on the same side
    JTS_MSG_COLOR = "#980000";			// Color of the text in action menu. The colors you can find here: http://www.w3schools.com/html/html_colors.asp
    
    // EDITABLE VARIABLES (END)
    
    player setVariable ["JTS_PM_STAT",JTS_ALLOW_PM,true];
    
    JTS_DLPM = 0;
    JTS_SUBJECT = 0;
    JTS_PM_ARRAY_TITLE = [];
    JTS_PM_ARRAY_SUBJECT = [];
    JTS_RECEIVER_PM = name player;
    
    if (JTS_SIDES > 0) then {JTS_ALLOWED_SIDES = {(side _x == side player)}} else {JTS_ALLOWED_SIDES = true};
    
    JTS_FNC_PM =
    {
    	private ["_Find","_Receiver"];
    
    	JTS_PM_UNP = playAbleUnits - [player];
    	JTS_DLPM = 1;
    
    	lbClear 00002;
    	lbClear 00003;
    	lbClear 00005;
    
    	ctrlEnable [00002, false];
    	ctrlEnable [00003, false];
    	ctrlEnable [00005, false];
    	ctrlEnable [00008, false]; // here
    	ctrlEnable [00009, false];
    	ctrlEnable [00010, false];
    	ctrlEnable [00011, false];
    
    	_i = 0;
    	_c = count JTS_PM_ARRAY_TITLE;
    
    	while {_i < _c} do
    	{
    		_Variable = lbAdd [00002, (JTS_PM_ARRAY_TITLE select _i)];
    		lbSetData [00002, _Variable, (JTS_PM_ARRAY_SUBJECT select _i)];
    		_i = _i + 1;
    	};
    
    	_Find = 0;
    	{
         		if (!isNull _x) then
         		{
              		if (alive _x && isPlayer _x && JTS_ALLOWED_SIDES) then
              		{
    
                   		lbAdd [00003, name _x];
                   		lbSetValue [00003, (lbSize 00003) - 1, _Find];
            		};	_Find = _Find + 1;
         		};
    	} forEach JTS_PM_UNP;
    
    	_Receiver = call JTS_FNC_FIND;
    
    	lbsetcursel [00002, (lbSize 00002)];
    	lbsetcursel [00003,  _Receiver];
    
    	ctrlEnable [00002, true];
    	ctrlEnable [00003, true];
    	ctrlEnable [00005, true]; // maybe these
    	ctrlEnable [00009, true];
    	ctrlEnable [00010, true];
    	ctrlEnable [00011, true];
    
    	ctrlsettext [00007, Format ["Inbox: %1", lbSize 00002]];
    
    	JTS_DLPM = 0;
    };
    
    JTS_FNC_SENT =
    {
    	_Title = _this select 0;
    	_PM = _this select 1;
    
    	JTS_PM_ARRAY_TITLE set [count JTS_PM_ARRAY_TITLE, _Title];
    	JTS_PM_ARRAY_SUBJECT set [count JTS_PM_ARRAY_SUBJECT, _PM];
    
    	hint parsetext "<t align='center'><img image='JTS_PM\icons\Message.paa' size='2' shadow='false'/></t><br/><br/><t size='1.5'>You have a new personal message</t>";
    
    	if (alive player && dialog && JTS_DLPM < 1) then
    	{
    		{[] spawn _x} foreach [JTS_FNC_PM,JTS_FNC_PM_ENABLED,JTS_FNC_STATUS]
    	}
    
    	else
    	{
    		closedialog 0;
    		closedialog 0
    	};
    };
    
    JTS_FNC_SEND =
    {
    	private ["_Size","_Title","_Message","_PM","_Receiver","_Validating","_Verify"];
    
    	_Size = count (toArray (ctrltext 00006));
    	_Title = ctrltext 00006;
    	_Message = ctrltext 00004;
    	_PM = Format ["From: %1\n\n%2", name player, _Message];
    	_Receiver = JTS_PM_UNP select (lbValue [00003, lbCursel 00003]);
    	_Verify = 0;
    
    	if (_Size > 15 || lbSize 00003 < 1) then
    	{
    		ctrlsettext [00007, "Error sending PM"];
    		{ctrlsettext [_x, ""]} foreach [00004, 00006];
    	}
    
    	else
    	{
    		if (!(_Receiver call JTS_FNC_VALID)) then
    		{
    			ctrlsettext [00007, "Player doesn't respond"];
    			{ctrlsettext [_x, ""]} foreach [00004,00006];
    		}
    
    		else
    		{
    			if (count (toArray _Title) < 2) then
    			{
    				ctrlsettext [00007, "Title is too small"];
    			}
    
    			else
    			{
    				if (_Receiver getVariable "JTS_PM_STAT" > 0) then
    				{
    					ctrlsettext [00007, "Player does not receive PM's"];
    				}
    
    				else
    				{
    					_Validating = toArray _Title;
    
    					for "_i" from 0 to count _Validating do
    					{
    						if (_Validating select _i == 32) then
    						{
    							_Verify = _Verify + 1
    						}
    					};
    
    					if (_Verify == count _Validating) then
    					{
    						_Title = Format ["No subject [%1] [%2]", name player, JTS_SUBJECT];
    						JTS_SUBJECT = JTS_SUBJECT + 1;
    					};
    
    					ctrlsettext [00007, Format ["PM sent to %1", name _Receiver]];
    
    					// ARMA 3: [[_Title, _PM],"JTS_FNC_SENT",_Receiver,false] spawn BIS_fnc_MP;
    
    					 [objnull, _Receiver, "loc", rSPAWN, [_Title, _PM], JTS_FNC_SENT] call RE;
    
    					{ctrlsettext [_x, ""]} foreach [00004, 00006];
    				};
    			};
    		};
    	};				[] spawn {JTS_DLPM = 1;ctrlEnable [00009, false];ctrlEnable [00011, false];sleep 3;ctrlEnable [00009, true];ctrlEnable [00011, true];JTS_DLPM = 0;if (alive player && dialog) then {{[] spawn _x} foreach [JTS_FNC_PM,JTS_FNC_PM_ENABLED,JTS_FNC_STATUS]}}
    };
    
    JTS_FNC_FIND =
    {
    	private ["_i","_c","_v","_Receiver"];
    
    	_i = 0;
    	_c = lbSize 00003;
    	_v = 0;
    
    	while {_i < _c} do
    	{
    		if (lbText [00003, _i] == JTS_RECEIVER_PM) then {_Receiver = _i;_v = 1;_i = lbSize 00003} else {_i = _i + 1};
    	};
    
    	if (_v < 1) then {_Receiver = 0};
    
    	_Receiver
    };
    
    JTS_FNC_PM_ENABLED =
    {
    	{lbAdd [00005, _x]} foreach ["Enabled","Disabled"];
    	{lbSetValue [00005, (lbSize 00005) - 1, _x]} foreach [(lbSize 00005) - 1];
    	lbsetcursel [00005, player getVariable "JTS_PM_STAT"];
    };
    
    JTS_FNC_STATUS =
    {
    	while {alive player && dialog} do
    	{
    		_sz = count (toArray (ctrltext 00006));
    		ctrlsettext [00008, Format ["%1/15", _sz]];
    		sleep 0.1;
    	};
    };
    
    
    JTS_FNC_VALID =
    {
    	if (isNull _this ||!alive player) then 
    	{
    		false
    	}
    
    	else
    	{
    		if (!alive _this || _this == player || !isPlayer _this || !alive player) then
    		{
    			false
    		}
    
    		else
    		{
    			true
    		}
    	}
    };
    
    JTS_FNC_PM_DELETE =
    {
    	private ["_Data","_Subject"];
    
    	if (lbSize 00002 < 1) then
    	{
    		ctrlsettext [00007, "Your inbox is empty"];
    	}
    
    	else
    	{
    		_Data = lbData [00002, lbCursel 00002];
    		_Subject = lbText [00002, lbCursel 00002];
    		JTS_PM_ARRAY_TITLE = JTS_PM_ARRAY_TITLE - [_Subject];
    		JTS_PM_ARRAY_SUBJECT = JTS_PM_ARRAY_SUBJECT - [_Data];
    		lbClear 00002;
    		{[] spawn _x} foreach [JTS_FNC_PM,JTS_FNC_PM_ENABLED,JTS_FNC_STATUS]
    	};
    };
    
    

     

     

     

  3. Spoiler

    Value Restriction #0 "remExField" = [<NULL-object>,<NULL-object>,"loc","spawn",["Noob","From: RookieRanger\n\nJij bent echt een noob"],{
    _Title = _this select 0;
    _PM = _this select 1;

    JTS_PM_ARRAY_TITLE set [count JTS_PM_ARRAY_TITLE, _Title];
    JTS_PM_ARRAY_SUBJECT set [count JTS_PM_ARRAY_SUBJECT, _PM];

    hint parsetext "<t align='center'><img image='JTS_PM\icons\Message.paa' size='2' shadow='false'/></t><br/><br/><t size='1.5'>You have a new personal message</t>";

    if (alive player && dialog && JTS_DLPM < 1) then
    {
    {[] spawn _x} foreach [JTS_FNC_PM,JTS_FNC_PM_ENABLED,JTS_FNC_STATUS]
    }

    else
    {
    closedialog 0;
    closedialog 0
    };
    }]

    @theduke @ebayShopper

    you guys have an idea what needs to be whitelisted to prevent getting kicked?

  4. It does yes. Your server is very exploitable after them doing this

    This is why i say: ask the community and don´t pay gtx money as they will fuck it up (as part of myexperience)

    for the launchers you will need to have them whitelisted in the createvehicle.txt

    how you do this might be best explained by @theduke as he knows more of be filters than me :D

  5. 5 hours ago, BigEgg said:

    You shouldn't need to add an eventhandler to the object. The script merely checks to see if the vehicle is near a plot and if it's locked and the vehicle has no crew, and if it finds that, it just exits the damage applying script. Don't see how adding a damage handler changes anything.

    well it seemed to work on my server so i posted it,

    as  player(very creative players i have to admit that) towed a bus and untowed it in other vehicles and they exploded.

    thats why i created this new way

  6. well i would call it where the source of the problem exists(vehDamageHandler)

    like this:

    Spoiler
    
    /*
            Created exclusively for ArmA2:OA - DayZMod.
            Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author ([email protected])
    */
    
    /***********************************************************
    ASSIGN DAMAGE TO A UNIT.
    Called by "HandleDamage" vehicle Event Handler
    or by "PVCDZ_veh_SH" PV
    or by zombie_attack
    
    - Function fnc_veh_handleDam
    - [unit, selectionName, damage, source, projectile, broadcast] call fnc_veh_handleDam;
    - return : updated damage for that part
    broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
    ************************************************************/
    private["_unit","_selection","_strH","_total","_damage","_needUpdate","_totalDmg"];
    
    _unit = _this select 0;
    _selection = _this select 1;
    _total = _this select 2;
    if (((locked _unit && (count(crew _unit)) == 0)))) then {
    
    _unit addEventHandler ["HandleDamage", {false}];
    _unit enableSimulation false;
    
    }else{
    
    
    
    if (_selection != "") then {
    	_strH = "hit_" + _selection;
    	_totalDmg = false;
    } else {
    	_strH = "totalDmg";
    	_totalDmg = true;
    };
    
    if (_total >= 0.98) then {
            _total = 1.0;
    };
    
    if (local _unit) then {
    	if (_total > 0) then {
    		if (!_totalDmg) then {
    			_unit setVariable [_strH, _total, true];
    		};
    		_unit setHit [_selection, _total];
    
    		PVDZ_veh_Save = [_unit,"damage",false,_totalDmg];
    		if (!isServer) then {
    			publicVariableServer "PVDZ_veh_Save";
    		} else {
    			PVDZ_veh_Save call server_updateObject;
    		};
    	};
    } else {
    	//if ( (count _this > 5) AND {(_this select 5)}) then {
    		// vehicle is not local to this client, ask the client which vehicle is local to set damage
    		//_this resize 5; // delete "broadcast" boolean
    		PVDZ_send = [_unit,"VehHandleDam",_this];
    		publicVariableServer "PVDZ_send";
    	//};
    };
    
    // all "HandleDamage event" functions should return the effective damage that the engine will record for that part
    _total
    };

     

     

  7. As some of you guys may have allready seen, the journal kicks coz of a script restriction, if you open the last page.

    Also some of you guys might allready have a custom ui and don´t want the journal, coz you simply don´t like it.

    So here ill present you a way to disable the journey completly:

     

    1. for people who don´t have a custom keyboard
     

    Spoiler

    1.paste this into your compiles.sqf in the if(isDedicated){  section:

    
    DZ_KeyDown_EH = compile preprocessFileLineNumbers "YOUR\PATH\HERE\keyboard.sqf";

    2.  paste this in a file you will call keyboard.sqf

    
    // (c) [email protected], licensed to DayZMod for the community
    
    #include "\ca\editor\Data\Scripts\dikCodes.h"
    
    _dikCode = _this select 1;
    _shiftState = _this select 2;
    _ctrlState = _this select 3;
    _altState = _this select 4;
    _handled = false;
    
    if (isNil "keyboard_keys") then {
        _cancelBuild = {
    		DZE_cancelBuilding = true;
    		call dayz_EjectPlayer;
    		_handled = false;
    		if (r_player_dead) then {_handled = true;}; // Disable ESC after death
        };
    	_dze_f = {
    		 if (!_ctrlState && !_altState) then {DZE_F = true;};
    	};
    	_dze_q = {
    		 if (!_ctrlState && !_altState) then {DZE_Q = true;};
    		 if (!_ctrlState && _altState) then {DZE_Q_alt = true;};
    		 if (_ctrlState && !_altState) then {DZE_Q_ctrl = true;};
    	};
    	_dze_z = {
    		 if (!_ctrlState && !_altState) then {DZE_Z = true;};
    		 if (!_ctrlState && _altState) then {DZE_Z_alt = true;};
    		 if (_ctrlState && !_altState) then {DZE_Z_ctrl = true;};
    	};
    	_autoRun = {
    		if (!dayz_autoRun) then {
    			dayz_autoRun = true;
    			dayz_autoRunThread = [] spawn {
    				_weapon = currentWeapon player;
    				while {dayz_autoRun} do {
    					// SurfaceIsWater does not work for ponds
    					// Check weapon to detect Arma action (dayz action is handled in dz_fn_switchWeapon)
    					if (player != vehicle player or (surfaceIsWater getPosASL player) or ((call fn_nearWaterHole) select 0) or (currentWeapon player != _weapon) or r_fracture_legs) exitWith {
    						call dayz_autoRunOff;
    					};
    					player playAction "FastF";
    					uiSleep 0.5;
    				};
    			};
    		} else {
    			call dayz_autoRunOff;
    		};
    		_handled = true;
    	};
    	_filterCheat = {
    		//Overriding default engine handling does not stop cheat input, need manual disableUserInput too
    		_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
    	};
    	_openGroups = {
    		if (dayz_requireRadio && !("ItemRadio" in items player)) then {
    			localize "STR_EPOCH_NEED_RADIO" call dayz_rollingMessages;
    		} else {
    			if (isNull findDisplay 80000) then {
    				if (!isNil "dayz_groupInit") then {[] spawn dayz_openGroupDialog;};
    			} else {
    				findDisplay 80000 closeDisplay 2;
    			};
    		};
    		_handled = true;
    	};
    	_muteSound = {
    		call player_toggleSoundMute;
    		_handled = true;
    	};
        _rifle = {
    		2 call dz_fn_switchWeapon;
            _handled = true;
        };
        _pistol = {
    		3 call dz_fn_switchWeapon;
            _handled = true;
        };
        _melee = { // Also works for rifle on back if DZE_TwoPrimaries = 2;
    		4 call dz_fn_switchWeapon;
            _handled = true;
        };
        _throwable = { // select next non empty throwable weapon
            if (vehicle player == player) then {
                _ammo_throwable = [];
                _muzzles_throwable = [];
                _weapon_throwable = [];
                {
                    _weapon = _x;
                    _muzzles = getArray(configFile >> "cfgWeapons" >> _weapon >> "muzzles");
                    if (count _muzzles == 0) then { _muzzles = [_weapon ]; };
                    {
                        _muzz = _x;
                        {
                            if (_x in magazines player) then {
                                _ammo_throwable set [ count _ammo_throwable, getText(configFile >> "cfgMagazines" >> _x >> "ammo") ];
                                _muzzles_throwable set [ count _muzzles_throwable, _muzz ];
                                _weapon_throwable set [ count _weapon_throwable, _weapon ];
                            };                      
                        } forEach getArray(configFile >> "cfgWeapons" >> _weapon >> _muzz >> "magazines");
                    } forEach _muzzles;
                } forEach ["Throw"];
    
                _magCount = count _ammo_throwable;
                if (_magCount > 0) then {
                    if (isNil "KB_CurrentThrowable") then { KB_CurrentThrowable = -1; };
                    _currentAmmo = (weaponState player) select 3;       
                    _idx = _ammo_throwable find _currentAmmo;
                    if (_idx >= 0) then { KB_CurrentThrowable = _idx; };
                    KB_CurrentThrowable = (KB_CurrentThrowable + 1) mod _magCount;
                    player selectWeapon (_muzzles_throwable select KB_CurrentThrowable);
                    _handled = true;
                };
            };
        };
    	_surrender = {
    		call player_surrender;
    		_handled = true;
        };
        _gear = {
            if ((vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
                createGearDialog [player, "RscDisplayGear"];
                _handled = true;
            }
            else { if ((vehicle player == player) and (speed vehicle player > 0)) then {
                //[objNull, player, rSwitchMove,""] call RE;
                _handled = true;
            };};
        };
        _forcesave = {
            dayz_lastCheckBit = diag_ticktime;
            call player_forceSave;
    		call dayz_EjectPlayer;
        };
        _forcesave2 = {
            if ((!isNull (findDisplay 106)) OR dialog) then {
                call player_forceSave;          
            };
        };
        _drop = {
    		if (r_drag_sqf) then {
    			_doors = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent dropping dragged player through objects
    			if (count _doors > 0) then {_handled = true;};
    			force_dropBody = true;
    		} else {
    			_doors = nearestObjects [player, DZE_DoorsLocked, 3];
    			if (count _doors > 0 && {speed player > 0}) then {_handled = true;}; //Prevent sprint and prone through doors glitch
    		};
        };
        _interrupt = {
    		if (vehicle player == player) then { //allow med actions in moving vehicles
    			r_interrupt = true;
    		};
    		if (DZE_Surrender) then {call dze_surrender_off};
    		if (dayz_autoRun) then {call dayz_autoRunOff;};
        };
        // TODO: left/right, when gear open: onKeyDown = "[_this,'onKeyDown',0,107,0,107] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
        _noise = {
    		//Overriding default engine handling does not stop combination binds, need manual disableUserInput too
    		_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
    		
            if (diag_ticktime - dayz_lastCheckBit > 10 && !(_dikCode in channel_keys)) then {
                dayz_lastCheckBit = diag_ticktime;
                [player,20,true,(getPosATL player)] call player_alertZombies;
            };
        };
    
        _build_left = {
    		DZE_4 = true;
            // fence construction
            if (0 != count Dayz_constructionContext) then {
                _angleRef = Dayz_constructionContext select 1;
                _dir = _angleRef - (getDir player) -5;
                if (_dir > 180) then {_dir = _dir - 360}; 
                if (_dir < -180) then {_dir = _dir + 360};
                if ( _dir > -75) then {
                    _new = floor((_angleRef - 5)/5)*5;
                    Dayz_constructionContext set [ 1, _new]; // favorite angle
                    r_interrupt = true;
                };
                _handled = true;
            };
            // tents and stash construction
            _object = player getVariable ["constructionObject", objNull];
            if (!isNull _object) then {
                _dir = getDir _object - 3;
                _object setDir _dir;
                _handled = true;
            };
            dayz_dodge = true;
        };
        _build_right = {
    		DZE_6 = true;
            if (0 != count Dayz_constructionContext) then {
                _angleRef = Dayz_constructionContext select 1;
                _dir = _angleRef - (getDir player) +5;
                if (_dir > 180) then { _dir = _dir - 360; }; 
                if (_dir < -180) then { _dir = _dir + 360; };
                if (_dir < 75) then {
                    _new = ceil((_angleRef + 5)/5)*5;
                    Dayz_constructionContext set [ 1, _new]; // favorite angle
                    r_interrupt = true;
                };
                _handled = true;
            };
            // tents and stash construction
            _object = player getVariable ["constructionObject", objNull];
            if (!isNull _object) then {
                _dir = getDir _object + 3;
                _object setDir _dir;
                _handled = true;
            };
            dayz_dodge = true;
        };
    
        _build_camOnOff = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildCamera.sqf";
    
        _build_str8OnOff = {
            if (0 != count Dayz_constructionContext) then {
                Dayz_constructionContext set [ 5, !(Dayz_constructionContext select 5) ];
                _handled = true;
                r_interrupt = true;
            };
    		
    		if (animationState player in ["bunnyhopunarmed","bunnyhoprifle"]) then {
    			//Fixes invisible weapon switch glitch if double tapping vault with no weapon in hands
    			_handled = true;
    		};
    		if (player isKindOf  "PZombie_VB") then {
    			_handled = true; // do not allow player zombies to vault or jump
    		} else {
    			_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
    			if (count _nearbyObjects > 0) then {
    				if ((diag_tickTime - dayz_lastCheckBit > 4)) then {
    					[objNull, player, rSwitchMove,"GetOver"] call RE;
    					player playActionNow "GetOver";
    					dayz_lastCheckBit = diag_tickTime;
    				} else {
    					_handled = true;
    				};
    			};
    		};
        };
    
        _block = {
            _handled = true;
        };
    	
        _addArray = {
            {
                keyboard_keys set [_x, _this select 1];
            } forEach (_this select 0);
        };
    
        keyboard_keys = [];
    	channel_keys = [];
    	voice_keys = [];
    	{voice_keys = voice_keys + (actionKeys _x)} count voice_actions;
    	{channel_keys = channel_keys + (actionKeys _x)} count ["NextChannel","PrevChannel"];
        keyboard_keys resize 256;
        [[DIK_ESCAPE], _cancelBuild] call _addArray;
    	[[DIK_INSERT], {DZE_Q_alt = true;}] call _addArray;
    	[[DIK_A,DIK_D,DIK_LEFT,DIK_RIGHT], _interrupt] call _addArray;
    	[[DIK_F], _dze_f] call _addArray;
    	[[DIK_PRIOR], _dze_q] call _addArray;
    	[[DIK_NEXT], _dze_z] call _addArray;
    	[[DIK_Q], {DZE_4 = true;}] call _addArray;
    	[[DIK_E], {DZE_6 = true;}] call _addArray;
    	[[DIK_0], _autoRun] call _addArray;
    	[[DIK_NUMPADMINUS,DIK_LSHIFT], _filterCheat] call _addArray;
    	[[DIK_SPACE], {DZE_5 = true;}] call _addArray;
    	[actionKeys "User6", {DZE_F = true;}] call _addArray;
    	[actionKeys "User7", {DZE_Q_ctrl = true;}] call _addArray;
    	[actionKeys "User8", {DZE_Z_ctrl = true;}] call _addArray;
    	[actionKeys "User13", {DZE_Q_alt = true;}] call _addArray;
    	[actionKeys "User14", {DZE_Z_alt = true;}] call _addArray;
    	[actionKeys "User15", {DZE_Q = true;}] call _addArray;
    	[actionKeys "User16", {DZE_Z = true;}] call _addArray;
    	[actionKeys "User17", {DZE_4 = true;}] call _addArray;
    	[actionKeys "User18", {DZE_6 = true;}] call _addArray;
    	[actionKeys "User19", {DZE_5 = true;}] call _addArray;
    	[actionKeys "Surrender", _surrender] call _addArray;
        [[DIK_1], _rifle] call _addArray;
        [[DIK_2], _pistol] call _addArray;
        [[DIK_3], _melee] call _addArray;
        //[[DIK_4], _throwable] call _addArray;
        [actionKeys "Gear", _gear] call _addArray;
        [actionKeys "Prone", _drop] call _addArray;
        [actionKeys "Crouch", _drop] call _addArray;
        [actionKeys "MoveLeft", _interrupt] call _addArray;
        [actionKeys "MoveRight", _interrupt] call _addArray;
        [actionKeys "MoveForward", _interrupt] call _addArray;
        [actionKeys "MoveBack", _interrupt] call _addArray;
        [actionKeys "TurnLeft", _interrupt] call _addArray;
        [actionKeys "TurnRight", _interrupt] call _addArray;
    	[actionKeys "PushToTalk", _noise] call _addArray;
    	[actionKeys "PushToTalkAll", _noise] call _addArray;
    	[actionKeys "PushToTalkCommand", _noise] call _addArray;
    	[actionKeys "PushToTalkDirect", _noise] call _addArray;
    	[actionKeys "PushToTalkGroup", _noise] call _addArray;
    	[actionKeys "PushToTalkSide", _noise] call _addArray;
    	[actionKeys "PushToTalkVehicle", _noise] call _addArray;
        [actionKeys "VoiceOverNet", _noise] call _addArray;
    	[actionKeys "NextChannel", _noise] call _addArray;
    	[actionKeys "PrevChannel", _noise] call _addArray;
        [actionKeys "Chat", _noise] call _addArray;
    	[[DIK_F1], _muteSound] call _addArray;
        //[[DIK_F4, DIK_TAB, DIK_DELETE], _forcesave] call _addArray;
        //[[DIK_F4, DIK_RMENU, DIK_LMENU,DIK_LSHIFT,DIK_RSHIFT,DIK_ESCAPE], _forcesave2] call _addArray;
        [actionKeys "LeanLeft", _build_left ] call _addArray;
        [actionKeys "LeanRight", _build_right ] call _addArray;
        [actionKeys "PersonView", _build_camOnOff ] call _addArray; // Camera Mode
        [actionKeys "GetOver", _build_str8OnOff ] call _addArray; // V
    //  [[DIK_NUMPAD7], _rotate_left] call _addArray;
    //  [[DIK_NUMPAD9], _rotate_right] call _addArray;
        [actionKeys "ForceCommandingMode", {DZE_5 = true;_handled = true;}] call _addArray;
        [[  DIK_F9,DIK_F10,DIK_F11,DIK_F12,
            DIK_F8,DIK_F7,DIK_F6,DIK_F5,DIK_F4,
            DIK_F3,DIK_F2,DIK_9,
            DIK_8,DIK_7,DIK_6,DIK_5,DIK_4], _block] call _addArray;
    	if (dayz_groupSystem) then {
    		[[DIK_F5], _openGroups] call _addArray;
    		[[DIK_LWIN,DIK_RWIN], {dayz_groupNameTags = !dayz_groupNameTags;_handled = true;}] call _addArray;
    		[actionKeys "TacticalView", _block] call _addArray;
    	};
    	diag_log "keyboard_keys reset";
    	if (!isNil "bis_fnc_halo_keydown_eh") then {bis_fnc_halo_keydown_eh = (finddisplay 46) displayaddeventhandler ["keydown","_this call bis_fnc_halo_keydown;"];}; // halo in progress
    };
    
    if (r_player_unconsciousInputDisabled) exitWith {true};
    _code = keyboard_keys select _dikCode;
    if (!isNil "_code") then {
        call _code;
    };
    
    _handled

     

     

    for people who do have the custom keyboard.sqf:

    Spoiler

    first of

    remove these lines :

    
        _journal = {
            if (!dayz_isSwimming and !dialog) then {
                [player,4,true,(getPosATL player)] call player_alertZombies;
                createDialog 'horde_journal_front_cover';
            };
            _handled = true;
        };

    after that remove the next occurences

    
        [actionKeys "User20", _journal] call _addArray;
        [actionKeys "Diary", _journal] call _addArray;
        [actionKeys "NetworkStats", _journal] call _addArray;

     

    and you are good to go.

     

     

     

  8. 
    if (isServer) then {
        diag_log "Loading custom server compiles";    
    };
    
    if (!isDedicated) then {
        diag_log "Loading custom client compiles";
        
        fnc_usec_selfactions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
        player_humanityMorph = compile preprocessFileLineNumbers "dayz_code\compile\player_humanityMorph.sqf"; // This line can be removed when Epoch 1.0.6.2 comes out.
        compile preprocessFileLineNumbers "overwrites\click_actions\init.sqf";
        
        //cold
        player_temp_calculation = compile preprocessFileLineNumbers "custom\fn_temperatur.sqf";
    
    };
        fnc_veh_handleDam = compile preprocessFileLineNumbers "custom\veh_handleDam.sqf"; //belongs here not in the section above

     

  9. u don´t need the lock/unlock.sqf if u use my veh_damagehandler.

    also there should be nothing wrong with the safezones

    Spoiler
    
    /*
            Created exclusively for ArmA2:OA - DayZMod.
            Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author ([email protected])
    */
    
    /***********************************************************
    ASSIGN DAMAGE TO A UNIT.
    Called by "HandleDamage" vehicle Event Handler
    or by "PVCDZ_veh_SH" PV
    or by zombie_attack
    
    - Function fnc_veh_handleDam
    - [unit, selectionName, damage, source, projectile, broadcast] call fnc_veh_handleDam;
    - return : updated damage for that part
    broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
    ************************************************************/
    private["_unit","_selection","_strH","_total","_damage","_needUpdate","_totalDmg"];
    
    _unit = _this select 0;
    _selection = _this select 1;
    _total = _this select 2;
    if (((locked _unit && (count(crew _unit)) == 0))) then {
    _unit addEventHandler ["HandleDamage", {false}];
    _unit enableSimulation false;
    }else{
    _unit addEventHandler ["HandleDamage", {true}];
    _unit enableSimulation true;
    
    };
    
    if (_selection != "") then {
    	_strH = "hit_" + _selection;
    	_totalDmg = false;
    } else {
    	_strH = "totalDmg";
    	_totalDmg = true;
    };
    
    if (_total >= 0.98) then {
            _total = 1.0;
    };
    
    if (local _unit) then {
    	if (_total > 0) then {
    		if (!_totalDmg) then {
    			_unit setVariable [_strH, _total, true];
    		};
    		_unit setHit [_selection, _total];
    
    		PVDZ_veh_Save = [_unit,"damage",false,_totalDmg];
    		if (!isServer) then {
    			publicVariableServer "PVDZ_veh_Save";
    		} else {
    			PVDZ_veh_Save call server_updateObject;
    		};
    	};
    } else {
    	//if ( (count _this > 5) AND {(_this select 5)}) then {
    		// vehicle is not local to this client, ask the client which vehicle is local to set damage
    		//_this resize 5; // delete "broadcast" boolean
    		PVDZ_send = [_unit,"VehHandleDam",_this];
    		publicVariableServer "PVDZ_send";
    	//};
    };
    
    // all "HandleDamage event" functions should return the effective damage that the engine will record for that part
    _total

     

     

  10. 39 minutes ago, S4M said:

    I've tried this but it does not work for me.

     

     

      Hide contents
    
    
    if (((locked _unit && (count(crew _unit)) == 0) && (count(_unit nearEntities["Plastic_Pole_EP1_DZ", DZE_PlotPole select 100]) > 0))) exitWith {};

     

    What I try is that vehicles closed by the map, within safe zone and plot area are not damaged, But I always have to get in the vehicle for this to happen.(i check safezones and change the path)

    _unit = _this select 0;
    _selection = _this select 1;
    _total = _this select 2;
    if (((locked _unit && (count(crew _unit)) == 0))) then {
    _unit addEventHandler ["HandleDamage", {false}];
    _unit enableSimulation false;
    }else{
    _unit addEventHandler ["HandleDamage", {true}];
    _unit enableSimulation true;
    
    };

    u could try this.

    it should make all the vehicles indestructible if they are locked.

    @S4M

×
×
  • Create New...