Jump to content

juandayz

Collaborator
  • Posts

    2098
  • Joined

  • Last visited

  • Days Won

    144

Posts posted by juandayz

  1. @ViktorReznov If ure using it in fn_selfactions.sqf  you dont need define _cursortarget.  its already defined by default.  the systemchat msgs you can put them in the male_dialog.sqf/female_dialog.sqf

    whats about

    if (VR_useWardrobe) then { //a global variable defined by you in somewhere dont know.. init,variables,configvariables.
    private ["_isWardrobe","_isFemale"];
    _isWardrobe = (typeOf (_cursorTarget) in VR_arrayWardrobes); 
    _isFemale = (typeOf (player) in VR_femaleSkins); 
    
    if ((_isWardrobe) && (player distance _cursorTarget < 5)) then { 
    if (s_changing_room < 0)) then { 
    if (!_isFemale)) then { 
    s_changing_room = player addAction ["Men's Room","dayz_code\actions\SkinMenu\Male_Dialog.sqf",_cursorTarget, 0, true, true]; 
    }else{
    s_changing_room = player addAction ["Gal's Room","dayz_code\actions\SkinMenu\Female_Dialog.sqf",_cursorTarget, 0, true, true]; 
    };
    };
    } else { 
    player removeAction s_changing_room; 
    s_changing_room = -1; 
    };
    };

     

  2. Just now, ViktorReznov said:

    Trying to figure out how to return a classname from an array with cursortarget. blowing my mind, losing my hair. any help much appreciated tyvm

    _obj = cursorTarget;
    _txt = format["%1", _obj];
    titleText [_txt,"PLAIN DOWN"]; titleFadeOut 4;

     

  3. Just now, harcosgoogle said:

    @Hooty How to disable PLAYERS Bodies cleanup?

     

    Thanks!

    check this part.. the script do not clean up the bodys .. just the bones, graves... etc..  thers a file sched_corpses.. or something like this.. who changes bodys by bones or graves after 40minutes (more or less)...  so really its not a problem i think that this script removes the bones... anyway... if u want to remove it.. just delete lines in red:

    Spoiler

    if (((diag_tickTime - _lastservercleancheck) > 180)) then
                {
                _lastservercleancheck = diag_tickTime;
                private ["_itemclasses","_itemlist","_itemCount"];
                _itemclasses =
                    [
                        "GraveCrossHelmet_EP1","GraveCrossHelmet_DZ","wreck","crater","craterlong","PartWoodPile",
                        "SeaGull","Rabbit","WildBoar","Cow","Goat","Sheep","Bird","wire_cat1",
                        "CAAnimalBase","Sound_Flies"
                    ];
                    {
                        _itemlist     = allMissionObjects _x;
                        _itemCount     = (count _itemlist);
                        {
                            if ((typeOf _x != "DZ_fin")||(typeOf _x != "DZ_pastor")||(typeOf _x != "SHEEP")) then {
                                _x spawn objectDelete;
                            };
                        } forEach (allMissionObjects _x);
                    } forEach _itemclasses;
                };

     

  4. Just now, harcosgoogle said:

    I do not know what it is. Searched...

    go to main menu, Pilotos, choose your nickname,  edit the face, and remove the custom face, just use other one for default...  anyway is strange .. my test server allow me to use custom faces.. giveme rpt errors  but not stuck me on loading screen,.

  5. Just now, Darkmeow said:

    What? Do u mean 

    at bottom of your description.ext   you should have this line:

    #include "\z\addons\dayz_code\Configs\CfgServerTrader\CfgServerTrader.hpp"

    (if ure missing the CfgServerTrader.hpp from dayz_code.pbo its very strange)............do you have dayz_code.pbo?    do you have this line?

    or u are using ZSC mod (coins)  this mod changes this line by: #include "dayz_code\Configs\CfgServerTrader.hpp"

  6. Small script for damage default cities.

    Do not use largest values on ratio... may causes lows fps.

    damage_cities.sqf

    Spoiler
    
    _target = [4185.0303,4157.5503,0];//change by your coords
    _damage_ratio=150;
    
    _server_houses= _target nearObjects ["HouseBase", _damage_ratio];
    {_x setdammage 1} forEach _server_houses;

     

    and at bottom of init add:

    execVM "scripts\damage_cities.sqf";

    Done!

    You also can add other things to damage.. for example

    _target = [4185.0303,4157.5503,0];
    _damage_ratio=150;
    
    _server_x= _target nearObjects [["vehicles","Man"], _damage_ratio];
    {_x setdammage 1} forEach _server_x;
    

    i dont know was usefull for me to simulate a nuclear dessease

  7. Just now, megaz said:

    Thanks  juanddayz,

    Working fine: but is there a way to add a certain place on the map where it will tp the choppers too (say anywhere in an area of 1000 meters of a certain set of coordinates ?)

    thanks again for your help

     

    MegaZ

    well see  heres where the script take the pos to locate the heli

    _vPosNew = [_vPosNew select 0,_vPosNew select 1,0.5];
    				_veh setPosATL _vPosNew;

    so i guess if u replace it by;

    _customPosition = [300,120,0];//put your own coords.
    _vPosNew = [_customPosition, 1, 1000, 10, 0, 20, 0] call BIS_fnc_findSafePos;
    _veh setPosATL _vPosNew;

    or if u wanna choose between unique pos or more than one then

    _use_more_than_one_positions = false;//true uses random pos
    if (!_use_more_than_one_positions) then {
    _customPosition = [300,120,0];//put your own coords.
    }else{
    _customPosition = [
    	[0,0,0],
    	[0,0,0],
    	[0,0,0],
    	[0,0,0],
    	[0,0,0],
    	[0,0,0]
    ]call BIS_fnc_selectRandom;
    };
    _vPosNew = [_customPosition, 1, 1000, 10, 0, 20, 0] call BIS_fnc_findSafePos;
    _veh setPosATL _vPosNew;

    should or could be work :laugh:

  8. @JakeQue  @Cherdenko   using noxisacrius flying.  using coke drink  cuz dont know the id for redbull. (you can add others drinks if u want)

     

    1-create player_consume.sqf  in somewhere into mpmissions\instance\

    Spoiler
    
    /*
    	Player action for consuming items
    	
    	Single parameter:
    		string		item classname
    	
    	Author:
    		Foxy
    */
    
    #define PILE_SEARCH_RADIUS 2
    #define PILE_PLAYER_OFFSET [0,1,0]
    
    private ["_cfg","_nutrition","_bloodRegen","_infectionChance","_sound","_output","_hungerCount","_thirstCount","_soundDistance"];
    
    _cfg = (ConfigFile >> "CfgMagazines" >> _this);
    
    //class doesn't exist
    if (!isClass(_cfg)) exitWith
    {
    	diag_log format ["DAYZ ERROR: Invalid magazine classname given to player_consume: %1", _this];
    };
    
    //class isn't a consumable
    if (!isArray(_cfg >> "Nutrition")) exitWith
    {
    	diag_log format ["DAYZ ERROR: Non-consumable item classname given to player_consume: %1", _this];
    };
    
    //player is on a ladder
    if ((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1) exitWith
    {
    	(localize "str_player_21") call dayz_rollingMessages;
    };
    
    //player doesn't have the consumable item
    if (!(_this in magazines player)) exitWith
    {
    	(localize "str_player_33") call dayz_rollingMessages;
    };
    
    //close gear
    (findDisplay 106) closeDisplay 0;
    
    //if player is not in a vehicle play animation
    if (vehicle player == player) then
    {
    	player playActionNow "PutDown";
    };
    _flyingdrinks = ["ItemSodaCoke"];
    if(_this in _flyingdrinks) then {
    flying2=true;
    systemchat "time to fly";
    };
    
    
    //Remove consumed item
    player removeMagazine _this;
    
    //Get values from config
    _nutrition = getArray (_cfg >> "Nutrition");
    _bloodRegen = getNumber (_cfg >> "bloodRegen");
    _infectionChance = getNumber (_cfg >> "infectionChance");
    _sound = getText (_cfg >> "consumeSound");
    _output = getText (_cfg >> "consumeOutput");
    
    //Apply nutrition and blood regen
    if (dayz_nutritionValuesSystem) then {
    	_hungerCount = _nutrition select 1;
    	_thirstCount = _nutrition select 2;
    	
    	if (_hungerCount > 0) then { dayz_lastMeal =	time; };
    	if (_thirstCount > 0) then { dayz_lastDrink = time; };
    	
    	["FoodDrink",_bloodRegen,_nutrition] call dayz_NutritionSystem;
    	r_player_foodstack = r_player_foodstack + 1;
    } else {
    	_hungerCount = _nutrition select 1;
    	_thirstCount = _nutrition select 2;
    	
    	if (_hungerCount > 0) then { dayz_hunger = 0; dayz_lastMeal =	time; };
    	if (_thirstCount > 0) then { dayz_thirst = 0; dayz_lastDrink = time; };
    	
    	r_player_blood = r_player_blood + _bloodRegen;
    	
    	if (r_player_blood > r_player_bloodTotal) then {
    		r_player_blood = r_player_bloodTotal;
    	};
    };
    
    //Apply or cure infection base on infectionChance
    if (_infectionChance != 0 && {abs(_infectionChance) > random 1}) then
    {
    	if (_infectionChance > 0) then
    	{
    		r_player_infected = true;
    		player setVariable["USEC_infected",true,true];
    	}
    	else
    	{
    		r_player_infected = false;
    		player setVariable["USEC_infected",false,true];
    	};
    };
    
    //Publish messing
    player setVariable ["messing",[dayz_hunger,dayz_thirst,dayz_nutrition],false]; //No need to be sent to everyplayer
    PVDZ_serverStoreVar = [player,"messing",[dayz_hunger,dayz_thirst,dayz_nutrition]]; //update server side only
    publicVariableServer "PVDZ_serverStoreVar";
    
    //Play sound and alert zombies
    if (_sound != "") then
    {
    	private ["_soundDistance"];
    	_soundDistance = getNumber (_cfg >> "consumeSoundDistance");
    	
    	[player,_sound,0,false,_soundDistance] call dayz_zombieSpeak;
    	[player,_soundDistance,true,(getPosATL player)] call player_alertZombies;
    };
    
    //If item has a consumeOutput item defined add that to player
    //inventory or ground/vehicle inventory based on consumedDrop
    if (_output != "") then
    {
    	//if consumeDrop is false add output item to player inventory
    	if (getNumber (_cfg >> "consumeDrop") == 0) then
    	{
    		player addMagazine _output;
    	}
    	//consumeDrop is true so drop the output item on the ground
    	else
    	{
    		//if player is not in a vehicle drop output item on the ground
    		if (vehicle player == player) then
    		{
    			//wait a while before dropping the output item
    			uiSleep 3;
    			//Drop Item to ground
    			[_output,1,1] call fn_dropItem;
    		};
    	};
    };

     

    2-call it from your custom compiles.sqf

    player_consume = compile preprocessFileLineNumbers "your\path\player_consume.sqf";

    3-at bottom of init.sqf

    call compile preprocessFileLineNumbers "your path\flying.sqf";

    4-create flying.sqf in your path.

    Spoiler
    
    flying2=false;
    waitUntil{flying2}; 
    
    forwardAndBackward = 4; 
    leftAndRight = 2;     
    upAndDown = 5;         
    distanceFromGround = 1; 
    hovering = nil;
    hoverPos = nil;
    
    move_forward =
    {
        if ((getPosATL (vehicle player) select 2) > distanceFromGround) then
        {
    		_vehicle = (vehicle player);
    		_vel = velocity _vehicle;
    		_dir = direction _vehicle;
    		_speed = 0.4; comment "Added speed";
    		_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+
    		(cos _dir*_speed),0.4];
        };
    };
    
    move_left =
    {
        if ((getPosATL (vehicle player) select 2) > distanceFromGround) then
        {
            _leftDirection = getdir (vehicle player);
            (vehicle player) setdir (_leftDirection) - leftAndRight;
        };
    };
    
    move_backward =
    {
        if ((getPosATL (vehicle player) select 2) > distanceFromGround) then
        {
    		_vehicle = (vehicle player);
    		_vel = velocity _vehicle;
    		_dir = direction _vehicle;
    		_speed = -0.4; comment "Added speed";
    		_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+
    		(cos _dir*_speed),0.4];
        };
    };
    
    move_right =
    {
        if ((getPosATL (vehicle player) select 2) > distanceFromGround) then
        {
            _rightDirection = getdir (vehicle player);
            (vehicle player) setdir (_rightDirection) + leftAndRight;
            player setVariable["lastPos",1];player setVariable["lastPos",[]];
        };
    };
    
    move_up =
    {    
    	_vehicle = (vehicle player);
    	_vel = velocity _vehicle;
    	_dir = direction _vehicle;
    	_speed = 6; comment "Added speed";
    	_vehicle setVelocity [(_vel select 0),(_vel select 1),8];
    };
    
    move_down =
    {
        if ((getPosATL (vehicle player) select 2) > distanceFromGround) then
        {
            _vehicle = (vehicle player);
            _forwardCurrentDirection = getdir (vehicle player);
            _forwardCurrentPosition = getPosATL (vehicle player);
            (vehicle player) setdir _forwardCurrentDirection;
            _vehicle setVelocity [0,0,-4];
        };
    };
    
    toggle_hover =
    {
        if (isnil "hovering") then
        {
            hovering = true;
            titleText ["Hovering ON","PLAIN DOWN"]; titleFadeOut 4;
            hoverPos = getPosATL (vehicle player);
        }
        else
        {
            hovering = nil;
            titleText ["Hovering OFF","PLAIN DOWN"]; titleFadeOut 4;
            hoverPos = nil;
        };
    };
    
    if (flying2) then 
    {
    	
    
        keyForward = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 17) then {call move_forward;}"];     //W - Forward
        keyLeft = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 30) then {call move_left;}"];         //A - Left
        keyBackward = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 31) then {call move_backward;}"];     //S - Backward
        keyRight = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 32) then {call move_right;}"];         //D - Right
        keyUp = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 16) then {call move_up;}"];         //Q - Up
        keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 44) then {call move_down;}"];         //Z - Down
        keyHover = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 57) then {call toggle_hover;}"];     //SpaceBar - Toggle Hover
    };
    	
    
        
    
    _countdown = true;
    _maxSeconds = 10;
    _seconds = 0;
    
    while {flying2} do
    {
        if (!isNil "hovering") then
        {
    		(vehicle player) setvelocity [0,0,0.2];
        };
    if (_seconds >= _maxSeconds) exitWith {
    systemchat "timeover";
    hovering = nil;
    hoverPos = nil;
    flying2 = false;
    (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyForward];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyLeft];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyBackward];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyRight];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyUp];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyDown];
        (findDisplay 46) displayRemoveEventHandler ["KeyDown", keyHover];
    };
    
    _seconds = _seconds + 1;
      sleep 1;
    };
    
    hovering = nil;
    hoverPos = nil;
    flying2 = false;

     

     

  9. @JakeQue

    for ESSV3 user yes. :laugh:

    i do the loadout with skins not with uids..  something like this

    Spoiler
    
    load_out = compile preprocessFileLineNumbers "load_out.sqf";
    waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
    if (PVCDZ_plr_Login2 select 2) then
    {
        player spawn load_out;
    };

     

    Spoiler
    
    if (typeOf player in DayZ_Female) then {
    _morph = ["SurvivorWdesert_DZ","SurvivorWcombat_DZ"] call BIS_fnc_selectRandom;
    };
    _morph = DZE_CUSTOMSKINS call BIS_fnc_selectRandom;
    
    
    removeBackpack player;
    removeAllItems player;
    removeAllWeapons player;
    {player removeMagazine _x} count (magazines player);
    
    sleep 1;
    if (typeOf player in DayZ_Female) then {
    player addMagazine "CinderBlocks";
    player addMagazine "5Rnd_762x54_Mosin";
    player addMagazine "5Rnd_762x54_Mosin";
    player addWeapon "Mosin_DZ";
    player addWeapon "ItemToolbox";
    player addWeapon "ItemMap";
    };
    
    player addMagazine "ItemBloodbag";
    player addMagazine "5Rnd_762x54_Mosin";
    player addMagazine "5Rnd_762x54_Mosin";
    player addWeapon "Mosin_DZ";
    player addWeapon "ItemToolbox";
    player addWeapon "ItemMap";
    
    [dayz_playerUID,dayz_characterID,_morph] call player_humanityMorph;

     

     

  10. Is there any way to keep the values of this variables  humanKills //zombieKills// banditKills  . after player die?

    I mean you kill 10 zeds 10 bandits and 10 survivors/heros .. then you die and respawn with the sames values.  like humanity variable (persistent).

    cannot found where is reseted to 0.

  11. Quote

    What about players who's UID's aren't defined in an Array,

    you define it collaterally...   for example..

    if (im juandayz) then {
    im juandayz; 
    the guy from argentine you know :D
    }else{
    im not juandayz;
    im not DamnReleentles;
    im not Fuel
    im not the rest of epoch community
    so im not the rest of the peoples in the world :D
    };

     

    if ((getPlayerUID player) in adminArray) then {
    im an adm and i be able to running the followings codes;
    //codes
    }; 
    
    //we close here.. do not need else but thers a "virtual" else here. this means:
    
    if ((getPlayerUID player) in adminArray) then {
    im an adm and i be able to running the followings codes;
    //codes
    }else{
    im the rest of players who are not adms so im not be able to running the codes inside the section from above.
    };

    Sin_t_tulo.jpg

  12. @FuelLF  your missing a {   here  } else if  

    donorA = ["",""];
    donorB = ["",""];
    if ((getPlayerUID player) in donorA) then {
    DefaultMagazines = [""];
    DefaultWeapons = [""];
    DefaultBackpack = "";
    DefaultBackpackWeapon = "";
    } else {
     if ((getPlayerUID player) in donorB) {
    DefaultMagazines = [""];
    DefaultWeapons = [""];
    DefaultBackpack = "";
    DefaultBackpackWeapon = "";
    } else { 
    DefaultMagazines = [""];
    DefaultWeapons = [""];
    DefaultBackpack = "";
    DefaultBackpackWeapon = "";
    };
    };

    Remember donations its not allowed by the staff.

  13. @khalcifer   Seeing that your markers only change in the position values.. you can make it a lil more clean.. see

    //==============USER CONFIG =============\\
    
    //====COORDS
    _pos0= [6723.59, 2583.92,0];//cherno
    _pos1= [2783.23, 5379.68,0];//zeleno
    _pos2= [4531.69, 10258.1,0];//norhWestAirfield
    _pos3= [8467.73, 6674.86,0];//guglovo
    _pos4= [12045.7, 9090.42,0];//berezino
    _pos5= [7605.05, 5102.02,0];//Mogilevka
    _pos6= [10586.4, 14212.4,0];//event
    
    //==RATIO MARKERS
    _Ratio_setMarkerType = "hd_warning";
    _Ratio_setMarkerColor = "ColorBlueFaded50";
    _Ratio_setMarkerBrush = "Grid";
    _Ratio_setMarkerSize = [450, 450];
    
    //==SOLID MARKERS
    _Solid_setMarkerType = "Dot";
    _Solid_setMarkerColor = "ColorBlack";
    _Solid_setMarkerBrush = "Solid";
    _Solid_setMarkerSize = [0.8, 0.8];
    //============== USER CONFIG =============\\
    
    fn_solid = {_this setMarkerText "PVP Area";_this setMarkerType _Solid_setMarkerType;_this setMarkerColor _Solid_setMarkerColor;_this setMarkerBrush _Solid_setMarkerBrush;_this setMarkerSize _Solid_setMarkerSize;};
    fn_ratio = {_this setMarkerShape "ELLIPSE";_this setMarkerType _Ratio_setMarkerType;_this setMarkerColor _Ratio_setMarkerColor;_this setMarkerBrush _Ratio_setMarkerBrush;_this setMarkerSize _Ratio_setMarkerSize;};
    
    _this = createMarker ["m0",_pos0];call fn_solid;
    _this = createMarker ["m1",_pos1];call fn_solid;
    _this = createMarker ["m2",_pos2];call fn_solid; 
    _this = createMarker ["m3",_pos3];call fn_solid; 
    _this = createMarker ["m4",_pos4];call fn_solid; 
    _this = createMarker ["m5",_pos5];call fn_solid; 
    _this = createMarker ["m6",_pos6];call fn_solid; 
    
    _this = createMarker ["m0a",_pos0];call fn_ratio;
    _this = createMarker ["m1a",_pos1];call fn_ratio;
    _this = createMarker ["m2a",_pos2];call fn_ratio; 
    _this = createMarker ["m3a",_pos3];call fn_ratio; 
    _this = createMarker ["m4a",_pos4];call fn_ratio; 
    _this = createMarker ["m5a",_pos5];call fn_ratio; 
    _this = createMarker ["m6a",_pos6];call fn_ratio; 

     

  14. @megaz

    hely_guard.sqf   (by donnovan)

    Spoiler
    
    
    private ["_message"];
    
    //CHECK PILOT STATE AND IGNITE PROTECTION
    if (hasInterface) then {
    	while {true} do {
    		while {vehicle player != player} do {
    			_veh = vehicle player;
    			if (_veh isKindOf "Air" && !(_veh isKindOf "ParachuteBase")) then {
    				if (driver _veh == player) then {
    					_vehProtected = _veh getVariable ["donn_protect",false];
    					if (!_vehProtected) then {
    						_veh setVariable ["donn_protect",true,true];
    						donn_heli_monitor = _veh;
    						publicVariableServer "donn_heli_monitor";
    						
    						//_message = format ["%1 (%2) lost connection %3 landed @%4", dayz_playerName, dayz_playerUID, _veh, mapGridPosition (getPosATL _veh)];
    						//["heliddos",_message,true] call fnc_Log;
    			
    					};
    					uiSleep 5;
    				} else {
    					uiSleep 5;
    				};
    			} else {
    				uiSleep 5;
    			};
    			uiSleep 3;
    		};
    		uiSleep 5;
    	};
    };
    
    //PROTECT THE HELI
    if (isServer) then {
    	"donn_heli_monitor" addPublicVariableEventHandler {
    		_veh = _this select 1;
    		_veh spawn {
    			_veh = _this;
    			_crew = crew _veh;_crewOk = [];
    			waitUntil {uiSleep 1.5;_crewOk = _crew;_crew = crew _veh;count _crew == 0};
    			_mans = nearestObjects [getPosATL _veh,["CAManBase"],100];
    			_air = (getPosATL _veh) nearEntities ["Air",100];
    			_DDOS = true;
    			{if (_x in _mans) exitwith {_DDOS = false;};} forEach _crewOk;
    			{_passenger = _x;{if (_passenger in crew _x) exitwith {_DDOS = false;};} forEach _air;} forEach _crewOk;
    			if (_DDOS && ((getPosATL _veh) select 2) > 1.5) then {
    				private ["_vPosNew"];
    				_vPos = getPosATL _veh;_mapCenter = getMarkerPos "center";_vehSafeRadius = (sizeOf typeOf _veh)/2 + 4;
    				for "_k" from 1 to 100 do {
    					_vPosNew = [[_vPos select 0,_vPos select 1,0],(18+(_k-1)*2)*(_k-1),(18+_k*2)*_k,_vehSafeRadius,0,15,0,[],[_mapCenter,[0,0,0]]] call BIS_fnc_findSafePos;
    					_x1 = round (_mapCenter select 0);_y1 = round (_mapCenter select 1);
    					_x2 = round (_vPosNew select 0);_y2 = round (_vPosNew select 1);
    					if !(_x1 == _x2 && _y1 == _y2) exitWith {};
    				};
    				_vPosNew = [_vPosNew select 0,_vPosNew select 1,0.5];
    				_veh setPosATL _vPosNew;
    				_veh setVectorUp surfaceNormal _vPosNew;
    				_veh setVelocity [0,0,0];
    				_fuel = fuel _veh;
    				_veh setFuel 0;
    				uiSleep 2.5;
    				_veh setFuel _fuel;
    				
    				//_message = format ["%1 (%2) lost connection %3 landed @%4", dayz_playerName, dayz_playerUID, _veh, mapGridPosition (getPosATL _veh)];
    			//["heliddos",_message,true] call fnc_Log;
    			
    			};
    			_veh setVariable ["donn_protect",false,true];			
    		};
    	};
    };

     

    at bottom of init.sqf

    //DDOS Heli Guard
    	execVM "scripts\others\heli_guard.sqf";

    original post:

    Spoiler

     

     

  15. @ViktorReznov awesome!! really like it.    do you think you can made fluctuating prize over the server up time?

    I dont know how is defined DZE_ecoMult  but basically something like this?

     

    DZE_ecoMult call BIS_fnc_selectRandom;
    
    waituntil {(round(time)) > 300};
    
     
        if (time > 300) then {
        [nil,nil,rTitleText,"Prices has changes", "PLAIN",10] call RE;
       DZE_ecoMult call BIS_fnc_selectRandom;
        };   
    
    waituntil {(round(time)) > 1700};
    
     
        if (time > 1700) then {
        [nil,nil,rTitleText,"Prices has changes", "PLAIN",10] call RE;
       DZE_ecoMult call BIS_fnc_selectRandom;
        }; 

     

  16. @Anhor if that way dsnt works.. then lets do everything in the old way.

    1-create  searchlight.sqf

    Spoiler
    
    // If an array was passed redirect to vanilla player_build (Epoch items pass a string)
    
    
    private ["_playerPos","_nearRestr","_hastool","_hasitem","_removed","_abort","_reason","_distance","_isNear","_lockable","_isAllowedUnderGround","_offset","_classname","_zheightdirection","_zheightchanged","_rotate","_objectHelperPos","_objectHelperDir","_objHDiff","_position","_isOk","_dir","_vector","_cancel","_location2","_buildOffset","_location","_limit","_started","_finished","_animState","_isMedic","_proceed","_counter","_dis","_sfx","_combination_1_Display","_combination_1","_combination_2","_combination_3","_combination","_combinationDisplay","_combination_4","_num_removed","_tmpbuilt","_vUp","_classnametmp","_text","_ghost","_objectHelper","_location1","_object","_helperColor","_canDo","_pos","_onLadder","_vehicle","_inVehicle","_needNear","_canBuild"];
    
    //Check if building already in progress, exit if so.
    if (dayz_actionInProgress) exitWith {localize "str_epoch_player_40" call dayz_rollingMessages;};
    dayz_actionInProgress = true;
    
    _pos = [player] call FNC_GetPos;
    _onLadder =	(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
    _vehicle = vehicle player;
    _inVehicle = (_vehicle != player);
    _hasitem = [["ItemPole",4], "ItemLightBulb","ItemGenerator","PartGlass"] call player_checkItems;
    _nearRestr = count nearestObjects [_pos, ["Plastic_Pole_EP1_DZ"], 27] > 0;
    
    
    
    if !(_nearRestr) exitWith {
    dayz_actionInProgress = false;
    cutText [format["Needs be in plot pole area"], "PLAIN DOWN"];
    };
    
    if (!_hasitem) exitWith {cutText 
    [format["Needs 4x ItemPole + x1ItemLightBulb +1xGenerator +1xPartGlass"], "PLAIN DOWN"];
    dayz_actionInProgress = false;
    };
    
    
    
    
    DZE_Q = false;
    DZE_Z = false;
    
    DZE_Q_alt = false;
    DZE_Z_alt = false;
    
    DZE_Q_ctrl = false;
    DZE_Z_ctrl = false;
    
    DZE_5 = false;
    DZE_4 = false;
    DZE_6 = false;
    
    DZE_F = false;
    
    DZE_cancelBuilding = false;
    
    DZE_updateVec = false;
    DZE_memDir = 0;
    DZE_memForBack = 0;
    DZE_memLeftRight = 0;
    
    call gear_ui_init;
    closeDialog 1;
    
    if (dayz_isSwimming) exitWith {dayz_actionInProgress = false; localize "str_player_26" call dayz_rollingMessages;};
    if (_inVehicle) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_42" call dayz_rollingMessages;};
    if (_onLadder) exitWith {dayz_actionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
    if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_43" call dayz_rollingMessages;};
    
    
    _classname =  "SearchLight_RUS";    
    _classnametmp = _classname;
    _text =         getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
    _ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
    	
    
    	_lockable = 0; //default define if lockable not found in config file below
    	if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then { //find out if item is lockable object
    		_lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable"); // 2=lockbox, 3=combolock, 4=safe
    	};
    
    	_isAllowedUnderGround = 1; //check if allowed to build under terrain
    	if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then {
    		_isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground");
    	};
    
    _offset =     getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
    if((count _offset) <= 0) then {
        _offset = [0,3,0];
    };	
    
    	_objectHelper = objNull;
    	_isOk = true;
    	_location1 = [player] call FNC_GetPos; // get inital players position
    	_dir = getDir player; //required to pass direction when building
    
    	// if ghost preview available use that instead
    	if (_ghost != "") then {
    		_classname = _ghost;
    	};
    
    	_object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"]; //object preview, not an actual object that will be built
    
    	
    
    	_objectHelper = "Sign_sphere10cm_EP1" createVehicle [0,0,0];
    	_helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)";
    	_objectHelper setobjecttexture [0,_helperColor];
    	_objectHelper attachTo [player,_offset];
    	_object attachTo [_objectHelper,[0,0,0]];
    
    	if (isClass (configFile >> "SnapBuilding" >> _classname)) then {	
    		["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build;
    	};
    
    	
    		["","","",["Init","Init",0]] spawn build_vectors;
    	
    
    	_objHDiff = 0;	
    	_cancel = false;
    	_reason = "";
    	
    	helperDetach = false;
    	_canDo = (!r_drag_sqf and !r_player_unconscious);
    	_position = [_objectHelper] call FNC_GetPos;
    
    	while {_isOk} do {
    
    		_zheightchanged = false;
    		_zheightdirection = "";
    		_rotate = false;
    
    		if (DZE_Q) then {
    			DZE_Q = false;
    			_zheightdirection = "up";
    			_zheightchanged = true;
    		};
    		if (DZE_Z) then {
    			DZE_Z = false;
    			_zheightdirection = "down";
    			_zheightchanged = true;
    		};
    		if (DZE_Q_alt) then {
    			DZE_Q_alt = false;
    			_zheightdirection = "up_alt";
    			_zheightchanged = true;
    		};
    		if (DZE_Z_alt) then {
    			DZE_Z_alt = false;
    			_zheightdirection = "down_alt";
    			_zheightchanged = true;
    		};
    		if (DZE_Q_ctrl) then {
    			DZE_Q_ctrl = false;
    			_zheightdirection = "up_ctrl";
    			_zheightchanged = true;
    		};
    		if (DZE_Z_ctrl) then {
    			DZE_Z_ctrl = false;
    			_zheightdirection = "down_ctrl";
    			_zheightchanged = true;
    		};
    		if (DZE_4) then {
    			_rotate = true;
    			DZE_4 = false;
    			if(DZE_dirWithDegrees) then{
    				DZE_memDir = DZE_memDir - DZE_curDegree;
    			}else{
    				DZE_memDir = DZE_memDir - 45;
    			};
    		};
    		if (DZE_6) then {
    			_rotate = true;
    			DZE_6 = false;
    			if(DZE_dirWithDegrees) then{
    				DZE_memDir = DZE_memDir + DZE_curDegree;
    			}else{
    				DZE_memDir = DZE_memDir + 45;
    			};
    		};
    		
    		if(DZE_updateVec) then{
    			[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
    			DZE_updateVec = false;
    		};
    		
    		if (DZE_F and _canDo) then {
    			if (helperDetach) then {
    				_objectHelper attachTo [player];
    				DZE_memDir = DZE_memDir-(getDir player);
    				helperDetach = false;
    				[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
    			} else {		
    				_objectHelperPos = getPosATL _objectHelper;
    				detach _objectHelper;			
    				DZE_memDir = getDir _objectHelper;
    				[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
    				_objectHelper setPosATL _objectHelperPos;
    				_objectHelper setVelocity [0,0,0]; //fix sliding glitch
    				helperDetach = true;
    			};
    			DZE_F = false;
    		};
    
    		if(_rotate) then {
    			[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
    		};
    
    		if(_zheightchanged) then {
    			if (!helperDetach) then {
    			detach _objectHelper;
    			_objectHelperDir = getDir _objectHelper;
    			};
    
    			_position = [_objectHelper] call FNC_GetPos;
    
    			if(_zheightdirection == "up") then {
    				_position set [2,((_position select 2)+0.1)];
    				_objHDiff = _objHDiff + 0.1;
    			};
    			if(_zheightdirection == "down") then {
    				_position set [2,((_position select 2)-0.1)];
    				_objHDiff = _objHDiff - 0.1;
    			};
    
    			if(_zheightdirection == "up_alt") then {
    				_position set [2,((_position select 2)+1)];
    				_objHDiff = _objHDiff + 1;
    			};
    			if(_zheightdirection == "down_alt") then {
    				_position set [2,((_position select 2)-1)];
    				_objHDiff = _objHDiff - 1;
    			};
    
    			if(_zheightdirection == "up_ctrl") then {
    				_position set [2,((_position select 2)+0.01)];
    				_objHDiff = _objHDiff + 0.01;
    			};
    			if(_zheightdirection == "down_ctrl") then {
    				_position set [2,((_position select 2)-0.01)];
    				_objHDiff = _objHDiff - 0.01;
    			};
    
    			if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then {
    				_position set [2,0];
    			};
    
    			if (surfaceIsWater _position) then {
    				_objectHelper setPosASL _position;
    			} else {
    				_objectHelper setPosATL _position;
    			};
    
    			if (!helperDetach) then {
    			_objectHelper attachTo [player];
    			};
    			[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
    		};
    
    		uiSleep 0.5;
    
    		_location2 = [player] call FNC_GetPos;
    		_objectHelperPos = [_objectHelper] call FNC_GetPos;
    		
    		if(DZE_5) exitWith {
    			_isOk = false;
    			_position = [_object] call FNC_GetPos;
    			detach _object;
    			_dir = getDir _object;
    			_vector = [(vectorDir _object),(vectorUp _object)];	
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    
    		if(_location1 distance _location2 > DZE_buildMaxMoveDistance) exitWith {
    			_isOk = false;
    			_cancel = true;
    			_reason = format[localize "STR_EPOCH_BUILD_FAIL_MOVED",DZE_buildMaxMoveDistance];
    			detach _object;
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    		
    		if(_location1 distance _objectHelperPos > DZE_buildMaxMoveDistance) exitWith {
    			_isOk = false;
    			_cancel = true;
    			_reason = format[localize "STR_EPOCH_BUILD_FAIL_TOO_FAR",DZE_buildMaxMoveDistance];
    			detach _object;
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    
    		if(abs(_objHDiff) > DZE_buildMaxHeightDistance) exitWith {
    			_isOk = false;
    			_cancel = true;
    			_reason = format[localize "STR_EPOCH_BUILD_FAIL_HEIGHT",DZE_buildMaxHeightDistance];
    			detach _object;
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    
    		if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
    			_isOk = false;
    			_cancel = true;
    			_reason = localize "str_epoch_player_43";
    			detach _object;
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    
    		if (DZE_cancelBuilding) exitWith {
    			_isOk = false;
    			_cancel = true;
    			_reason = localize "STR_EPOCH_PLAYER_46";
    			detach _object;
    			deleteVehicle _object;
    			detach _objectHelper;
    			deleteVehicle _objectHelper;
    		};
    	};
    	
    	_isOk = true;
    	_proceed = false;
    	_counter = 0;
    	_location = [0,0,0];
    
    	//No building on roads unless toggled
    	if (!DZE_BuildOnRoads) then {
    		if (isOnRoad _position) then { _cancel = true; _reason = localize "STR_EPOCH_BUILD_FAIL_ROAD"; };
    	};
    
    	// No building in trader zones
    	if(!canbuild) then { _cancel = true; _reason = format[localize "STR_EPOCH_PLAYER_136",localize "STR_EPOCH_TRADER"]; };
    
    _playerPos = getPosATL player;
    _nearRestr = count nearestObjects [_playerPos, ["Plastic_Pole_EP1_DZ"], 27] > 0;
        if(_nearRestr && !_cancel) then {
    
    		_classname = _classnametmp;
    
    		// Start Build
    		_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; //create actual object that will be published to database
    
    		_tmpbuilt setdir _dir; //set direction inherited from passed args from control
    		_tmpbuilt setVariable["memDir",_dir,true];
    
    		// Get position based on object
    		_location = _position;
    
    		if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then { //check Z axis if not allowed to build underground
    			_location set [2,0]; //reset Z axis to zero (above terrain)
    		};
    		
    		_tmpbuilt setVectorDirAndUp _vector;
    		
    		_buildOffset = [0,0,0];
    		_vUp = _vector select 1;
    		switch (_classname) do {
    			case "MetalFloor_DZ": { _buildOffset = [(_vUp select 0) * .148, (_vUp select 1) * .148,0]; };
    		};
    		
    		_location = [
    			(_location select 0) - (_buildOffset select 0),
    			(_location select 1) - (_buildOffset select 1),
    			(_location select 2) - (_buildOffset select 2)
    		];
    	
    		if (surfaceIsWater _location) then {
    			_tmpbuilt setPosASL _location;
    			_location = ASLtoATL _location; //Database uses ATL
    		} else {
    			_tmpbuilt setPosATL _location;
    		};
    
    		format[localize "str_epoch_player_138",_text] call dayz_rollingMessages;
    
     //////////////////////////////////////////////////##########START TO BUILD AND REMOVE OBJETS
    player playActionNow "Medic";
    [player,"repair",0,false,10] call dayz_zombieSpeak;
    [player,10,true,(getPosATL player)] spawn player_alertZombies;
    sleep 1;
    _removed = [["ItemPole",4], "ItemLightBulb","ItemGenerator","PartGlass"] call player_removeItems; 
        cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
    		
    		_limit = 3; //times it takes to build by default
    
    		if (DZE_StaticConstructionCount > 0) then { //if count is manually overridden inside init.sqf, use that instead, else use limits configured in config files
    			_limit = DZE_StaticConstructionCount;
    		}
    		else {
    			if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
    				_limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
    			};
    		};
    
    
    		
    				
    
    				_tmpbuilt setVariable ["OEMPos",_location,true]; //store original location as a variable
    
    				 //if not lockable item
    					
    					_tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
    					
    						if (DZE_permanentPlot) then {
    							_tmpbuilt setVariable ["ownerPUID",dayz_playerUID,true];
    							
    								_friendsArr = [[dayz_playerUID,toArray (name player)]];
    								_tmpbuilt setVariable ["plotfriends", _friendsArr, true];
    								PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr];
    								publicVariableServer "PVDZ_obj_Publish";
    				cutText [format["Lights on!"], "PLAIN DOWN",3];
    					};
    				
    			} else { //if magazine was not removed, cancel publish
    				deleteVehicle _tmpbuilt;
    				localize "str_epoch_player_46" call dayz_rollingMessages;
    			};
    
    		
    
    dayz_actionInProgress = false;

     

    *NOTE: edit items required from the file of above in this lines:

    Spoiler
    
    
    _hasitem = [["ItemPole",4], "ItemLightBulb","ItemGenerator","PartGlass"] call player_checkItems;
    
    //bunch of code
    
    _removed = [["ItemPole",4], "ItemLightBulb","ItemGenerator","PartGlass"] call player_removeItems;

     

     

     

    2-open your custom variables.sqf

    Spoiler

    find this line:

    
    DZE_safeVehicle = ["ParachuteWest","ParachuteC"];

    change by:

    
    MY_VEH = ["SearchLight_RUS"];
    DZE_safeVehicle = MY_VEH +["ParachuteWest","ParachuteC"];

     

    3-server_monitor.sqf

    Spoiler
    
    _isPlot = _type == "Plastic_Pole_EP1_DZ";

    below paste:

    
    _isSlight = _type in MY_VEH;

    find:

    
    if( (count _inventory > 0) && !_isPlot && !_doorLocked) then {

    change by:

    
    if( (count _inventory > 0) && !_isPlot && !_doorLocked && !_isSLight) then {

    4-at least call searchlight.sqf  with deployanything

    ["ItemToolbox","DeployLights","execVM 'scripts\searchlight.sqf';","true"],

     

  17. @theduke @Thug

    1-at bottom of server_functions.sqf

    call compile preProcessFileLineNumbers "z\addons\dayz_server\init\flag.sqf";

    2-into dayz_server.pbo\init\  create flag.sqf

    Spoiler
    
    _pos = [3414.6799, 3942.7075, 3.0517578e-005];//put your own coord
    _flag = "FlagCarrierCDF" createVehicle _pos;
    _flag setFlagTexture "scripts\flag.jpg";

     

    3-create the flag.jpg  into mpmissions\your instance\scripts\

    4-repack dayz_server.pbo  and VERY IMPORTANT  also pack your instance.pbo

    Arm_A2_OA_2017-06-24_21-41-08-35.jpg

     

     

     

     

     

     

     

  18. Just now, Anhor said:

    Sry, nope. Unfortunatlly this will not fix my problem.

    Everytime we deploy a searvhlight, we see the server message "This vehicle is persistant and will be ...."

    But there is NOTHING in the database.

    I copied just the code from deploy a mozzie and change the classname of object and the parts needed ............ Mozzie is still persistent and shown up in database ........ but not the searchlight :wacko:

    try make it to the old way.

    you create in deployanything all about rightclick.

    Open your server_monitor.sqf  and find:

    _isPlot = _type == "Plastic_Pole_EP1_DZ";

    below paste:

    _isSlight = _type == "SearchLIGHT ID HERE";

    find:

    if( (count _inventory > 0) && !_isPlot && !_doorLocked) then {

    change by:

    if( (count _inventory > 0) && !_isPlot && !_doorLocked && !_isSLight) then {

     

  19. 15 hours ago, ViktorReznov said:

    Simple error on client side. Works fine, just throwing this error

    Error in expression <yer_cleanguts;
    s_player_cleanguts = -1;
    _control ctrlShow false;

    };

    sand_z>
      Error position: <_control ctrlShow false;

    };

    sand_z>
      Error Undefined variable in expression: _control
    File mpmissions\__CUR_MP.Chernarus\scripts\walkamongstthedead\walkamongstthedead.sqf, line 19

    check the step 4 if u are adding the s_player_cleanguts -1;

    4-custom Variables.sqf

    Find:

    //Player self-action handles
    dayz_resetSelfActions = {

    below paste

    
    s_player_zhide2 = -1;
    s_player_zhide3 = -1;
    s_player_cleanguts = -1;
  20. its counts humans murders,  _kills = [player getVariable['humanKills', 0]]call BIS_fnc_numberText;  not AI.  But  thers a problem with skins i guess.. skins from civil side killing others do not count the kills.. taked as friendly fire. gonna made a proobe only with west side skins.

     

    Edit: @WagnerMello send you by private a new version with all your changes.

×
×
  • Create New...