Jump to content

Sukkaed

Member
  • Posts

    527
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Sukkaed

  1. Now you're removing parts that might not exist and still adding those to inventory if it's cancelled. It will work fine if you use what I posted. Although I can see couple other flaws in that. You should lock the vehicle while it's in "preview" or someone can get in it and glitch into bases. Also you can use it for swiping people to death or use it as a shield in combat, so remove the "preview" if player moves.

  2. Nice :) I like it. I added this to Infistar for admins to spawn as a event. Here:

    private ["_admin", "_position", "_baserunover", "_baserunover1", "_baserunover2", "_baserunover3", "_baserunover4", "_baserunover5", "_baserunover6", "_baserunover7", "_baserunover8", "_baserunover9", "_baserunover10", "_baserunover11", "_baserunover12", "_baserunover13", "_baserunover14", "_baserunover15", "_baserunover16", "_baserunover17", "_baserunover18", "_baserunover19", "_baserunover20", "_fillBOX", "_crate", "_pistols", "_item", "_ammo", "_loot_pos", "_clean_box", "_loot_box", "_cleanup"];


    labyrinthClean = false;
    _admin = _this select 0;
    _position = getPosATL _admin;

    _baserunover = createVehicle ["Land_MBG_Shoothouse_1",[(_position select 0) - 35, (_position select 1) - 6.5,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover setDir 0;
    _baserunover setVectorUp surfaceNormal position _baserunover;
    _baserunover1 = createVehicle ["Land_MBG_Shoothouse_1", [(_position select 0) - 12, (_position select 1) + 9,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover1 setDir 0;
    _baserunover1 setVectorUp surfaceNormal position _baserunover1;
    _baserunover2 = createVehicle ["Land_MBG_Shoothouse_1", [(_position select 0) - 16, (_position select 1) - 19.3,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover2 setDir 0;
    _baserunover2 setVectorUp surfaceNormal position _baserunover2;
    _baserunover3 = createVehicle ["Land_MBG_Shoothouse_1", [(_position select 0) + 7, (_position select 1) - 15,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover3 setDir 0;
    _baserunover3 setVectorUp surfaceNormal position _baserunover3;
    _baserunover4 = createVehicle ["Land_MBG_Shoothouse_1",[(_position select 0) + 3, (_position select 1) - 39.5,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover4 setDir 0;
    _baserunover4 setVectorUp surfaceNormal position _baserunover4;
    _baserunover5 = createVehicle ["Land_A_Castle_Bergfrit", [(_position select 0) + 9.5, (_position select 1) + 3,-10.52],[], 0, "CAN_COLLIDE"];
    _baserunover5 setDir 0;
    _baserunover5 setVectorUp surfaceNormal position _baserunover5;
    _baserunover6 = createVehicle ["Land_A_Castle_Donjon_dam", [(_position select 0) + 4, (_position select 1) + 17,-1.93],[], 0, "CAN_COLLIDE"];
    _baserunover6 setDir 0;
    _baserunover6 setVectorUp surfaceNormal position _baserunover6;
    _baserunover7 = createVehicle ["Land_A_Castle_Wall1_20", [(_position select 0) - 11.6, (_position select 1) + 21.7,-7.28],[], 0, "CAN_COLLIDE"];
    _baserunover7 setDir 0;
    _baserunover7 setVectorUp surfaceNormal position _baserunover7;
    _baserunover8 = createVehicle ["Land_A_Castle_Wall1_20", [(_position select 0) - 35.4, (_position select 1) + 6.4,-7.28],[], 0, "CAN_COLLIDE"];
    _baserunover8 setDir 0;
    _baserunover8 setVectorUp surfaceNormal position _baserunover8;
    _baserunover9 = createVehicle ["Land_A_Castle_Donjon", [(_position select 0) + 16, (_position select 1) - 10.3,-1.93],[], 0, "CAN_COLLIDE"];
    _baserunover9 setDir 0;
    _baserunover9 setVectorUp surfaceNormal position _baserunover9;
    _baserunover10 = createVehicle ["Sign_arrow_down_large_EP1", [(_position select 0) + 15, (_position select 1) - 35,+0.52],[], 0, "CAN_COLLIDE"];
    _baserunover10 setDir 0;
    _baserunover10 setVectorUp surfaceNormal position _baserunover10;
    _baserunover11 = createVehicle ["Sign_arrow_down_large_EP1", [(_position select 0) - 8.6, (_position select 1) - 51,+0.52],[], 0, "CAN_COLLIDE"];
    _baserunover11 setDir 0;
    _baserunover11 setVectorUp surfaceNormal position _baserunover11;
    _baserunover12 = createVehicle ["Sign_arrow_down_large_EP1", [(_position select 0) - 27., (_position select 1) - 30.5,+0.52],[], 0, "CAN_COLLIDE"];
    _baserunover12 setDir 0;
    _baserunover12 setVectorUp surfaceNormal position _baserunover12;
    _baserunover13 = createVehicle ["Sign_arrow_down_large_EP1",[(_position select 0) - 46, (_position select 1) - 17.4,+0.52],[], 0, "CAN_COLLIDE"];
    _baserunover13 setDir 0;
    _baserunover13 setVectorUp surfaceNormal position _baserunover13;
    _baserunover14 = createVehicle ["Sign_arrow_down_large_EP1", [(_position select 0) - 22.7, (_position select 1) + 7.7,+0.52],[], 0, "CAN_COLLIDE"];
    _baserunover14 setDir 0;
    _baserunover14 setVectorUp surfaceNormal position _baserunover14;
    _baserunover15 = createVehicle ["MAP_t_acer2s", [(_position select 0) - 8, (_position select 1) - 31,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover15 setDir 0;
    _baserunover15 setVectorUp surfaceNormal position _baserunover15;
    _baserunover16 = createVehicle ["MAP_t_acer2s", [(_position select 0) - 46.5, (_position select 1) - 15,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover16 setDir 91.4;
    _baserunover16 setVectorUp surfaceNormal position _baserunover16;
    _baserunover17 = createVehicle ["MAP_t_acer2s", [(_position select 0) - 23, (_position select 1) + 10,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover17 setDir 89.09;
    _baserunover17 setVectorUp surfaceNormal position _baserunover17;
    _baserunover18 = createVehicle ["MAP_t_acer2s", [(_position select 0) - 27.3, (_position select 1) - 28,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover18 setDir 90.6;
    _baserunover18 setVectorUp surfaceNormal position _baserunover18;
    _baserunover19 = createVehicle ["MAP_t_acer2s", [(_position select 0) + 14, (_position select 1) - 32,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover19 setDir -88.1;
    _baserunover19 setVectorUp surfaceNormal position _baserunover19;
    _baserunover20 = createVehicle ["MAP_t_acer2s", [(_position select 0) - 8.5, (_position select 1) - 48,-0.12],[], 0, "CAN_COLLIDE"];
    _baserunover20 setDir 86.08;
    _baserunover20 setVectorUp surfaceNormal position _baserunover20;

    _fillBOX = {
    _crate = _this select 0;
    clearWeaponCargoGlobal _crate;
    clearMagazineCargoGlobal _crate;
    _crate addWeaponCargoGlobal ["ItemHatchet_DZE",1];
    _crate addMagazineCargoGlobal ["ItemBandage",8];
    _pistols = [
    "M9","M9SD","Makarov","MakarovSD","COLT1911","SA61_EP1","UZI_EP1","UZI_SD_EP1","REVOLVER_EP1","REVOLVER_GOLD_EP1","GLOCK17_EP1",
    "RH_deagle","RH_Deagleg","RH_Deaglem","RH_Deaglemz","RH_Deaglemzb","RH_Deagles","RH_g17","RH_g17sd","RH_g18",
    "RH_g19","RH_g19t","RH_m1911","RH_m1911old","RH_m1911sd","RH_m9","RH_m93r","RH_m9c","RH_m9csd","RH_m9sd","RH_usp",
    "RH_uspm","RH_uspsd","vil_Glock","vil_Glock_o","vil_USP","vil_USP45","vil_USP45SD","vil_USPSD","vil_uzi","vil_uzimini","vil_uzimini_SD",
    "vil_uzi_c","vil_uzi_SD"
    ];
    for "_i" from 0 to 2 do {
    _item = _pistols call BIS_fnc_selectRandom;
    _crate addWeaponCargoGlobal [_item, 1];
    _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
    if (count _ammo > 0) then { _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))+1]; };
    };
    };

    _loot_pos = [
    [(_position select 0) + 9, (_position select 1) + 2.3, -0.012],
    [(_position select 0) - 18.6, (_position select 1) + 15.6, -0.012],
    [(_position select 0) - 8.5, (_position select 1) - 21, -0.012],
    [(_position select 0) - 33, (_position select 1) - 6, -0.012],
    [(_position select 0) + 5, (_position select 1) - 44, -0.012],
    [(_position select 0) - 23, (_position select 1) - 20, -0.012],
    [(_position select 0) + 13, (_position select 1) - 23, -0.012],
    [(_position select 0) + 7, (_position select 1) - 6, -0.012],
    [(_position select 0) - 5, (_position select 1) + 1, -0.012],
    [(_position select 0) - 42, (_position select 1) - 6, -0.012],
    [(_position select 0) - 4.3, (_position select 1) - 39, -0.012]
    ];

    _clean_box = [];
    {
    _loot_box = createVehicle ["GuerillaCacheBox", _x, [], 0, "NONE"];
    [_loot_box] spawn _fillBOX;
    _clean_box = _clean_box + [_loot_box];
    } forEach _loot_pos;

    _cleanup = [
    _baserunover,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,
    _baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15,
    _baserunover16,_baserunover17,_baserunover18,_baserunover19,_baserunover20
    ];

    waitUntil {labyrinthClean};
    { deleteVehicle _x; } forEach _cleanup;
    { deleteVehicle _x; } forEach _clean_box;
    labyrinthClean = nil;

  3. How about using forEach.

    _weaponsList = [
        [["SCAR_L_STD_EGLM_RCO","30Rnd_556x45_Stanag"],0.1],
        [["SCAR_H_CQC_CCO","20Rnd_762x51_B_SCAR"],0.2]
    ];
    
    _weapons = [];
    _chance = [];
    {
        _weapons = _weapons + [_x select 0];
        _chance = _chance + [_x select 1];
    } forEach _weaponsList;
    

    Although using count instead of forEach might be better choice in this case.

  4. You must setup extDB addon for your server, read guide provided to you

     

    Yes, I certainly did.

     

    You need to add those filters to line 5. This one:

    5 "PVDZE_" !"PVDZE_player" !="PVDZE_send" !="PVDZE_log_lockUnlock" !="PVDZE_Server_Simulation" !="PVDZE_veh_Update" !="PVDZE_plr_GutBody" !="PVDZE_plr_GutBodyZ" !="PVDZE_veh_Lock" !="PVDZE_plr_DeathB" !="PVDZE_maintainArea" !="PVDZE_obj_Publish" !="PVDZE_obj_Swap" !="PVDZE_plr_Save" !="PVDZE_obj_Delete" !="PVDZE_obj_Trade" !="PVDZE_veh_Publish2" !="PVDZE_zed_Spawn" !="PVDZE_plr_Died" !="PVDZE_plr_TradeMenu" !="PVDZE_veh_Upgrade" !="PVDZE_atp" !="PVDZE_plr_Login" !="PVDZE_plr_Login2" !="PVDZE_plr_LoginRecord" !="PVDZE_plr_DeathBResult" !="PVDZE_veh_SFix" !="PVDZE_plr_Hit" !="PVDZE_plr_HitV" !="PVDZE_veh_SFuel" !="PVDZE_plr_HideBody" !="PVDZE_plr_Morph" !="PVDZE_veh_Publish" !="PVDZE_plr_Characters" !="PVDZE_lockVault" !="PVDZE_obj_setlocalVars" !="PVDZE_obj_getlocalVars" !="PVDZE_bank_Save"
    
  5. Alright, here :)

     

    variables.sqf inside dayz_resetSelfActions block

    s_player_sirens_on = 	-1;
    s_player_sirens_off = 	-1;
    copcar_stoppolice = 	-1;
    

    fn_selfActions.sqf

    if (_inVehicle && (typeOf _vehicle in ["policecar","SUV_TK_CIV_EP1","SUV_TK_CIV_EP1_DZE1","SUV_TK_CIV_EP1_DZE2","SUV_TK_CIV_EP1_DZE3","SUV_TK_CIV_EP1_DZE4","LadaLM","LadaLM_DZE1","LadaLM_DZE2","LadaLM_DZE3","LadaLM_DZE4"]) && (driver _vehicle == player)) then {
    	if ((_vehicle getVariable["sirenon",0]) == 0) then {
    		if (s_player_sirens_on < 0) then {
    			s_player_sirens_on = _vehicle addAction ["Sirens on","Scripts\sirens.sqf",[_vehicle,"start"],2,false,true,"",""];
    		};
    	};
    	if (sirensOn == 1) then {
    		if (s_player_sirens_off < 0) then {
    			s_player_sirens_off = _vehicle addAction ["Sirens off","Scripts\sirens.sqf",[_vehicle,"end"],2,false,true,"",""];
    		};
    	};
    } else {
    	_vehicle removeAction s_player_sirens_on;
    	_vehicle removeAction s_player_sirens_off;
    	_vehicle removeAction copcar_stoppolice;
    	s_player_sirens_on = -1;
    	s_player_sirens_off = -1;
    	copcar_stoppolice = -1;
    };
    

    save this as sirens.sqf inside Scripts folder

    //Vehicle Sirens -Sukkaed
    _case = (_this select 3) select 1;
    
    switch (_case) do {
    	case "start": {
    		private ["_vehicle","_inVehicle","_lightRed","_redLight","_lightBlue","_blueLight","_lastValidVehicles","_validVehicles","_nearPlayerVehicles"];
    		s_player_sirens_off = -1;
    		_vehicle = (_this select 3) select 0;
    		_vehicle setVariable["sirenon",1,true];
    		_inVehicle = (_vehicle != player);
    		_lightRed = {
    			_redLight = "#lightpoint" createVehicle (getPos _vehicle); 
    			_redLight setLightBrightness 0.03;	
    			_redLight setLightAmbient [ 0.5, 0, 0 ]; 
    			_redLight setLightColor [0.77,0.05,0.23]; 
    			_redLight lightAttachObject [_vehicle, [1, 0, 1.0]];
    			uiSleep 0.13;
    			deleteVehicle _redLight;
    			uiSleep 0.13;
    		};
    		_lightBlue = {
    			_blueLight = "#lightpoint" createVehicle (getPos _vehicle); 
    			_blueLight setLightBrightness 0.03;
    			_blueLight setLightAmbient [ 0, 0, 0.5 ]; 
    			_blueLight setLightColor [0,0,1.0]; 
    			_blueLight lightAttachObject [_vehicle, [-1, 0, 1.0]];
    			uiSleep 0.13;
    			deleteVehicle _blueLight;
    			uiSleep 0.13;
    		};
    		
    		if (isNil ("sirensOn")) then { sirensOn = 0; };
    		if (sirensOn == 0) then {
    			sirensOn = 1;
    			cutText ["Sirens ON!","PLAIN DOWN"];
    		};
    		_vehicle removeAction s_player_sirens_on;
    		_lastValidVehicles = [];
    
    		while {sirensOn == 1} do {
    			if (_inVehicle and (driver _vehicle == player)) then {
    				_validVehicles = [];
    				_nearPlayerVehicles = position _vehicle nearEntities [["Car","Motorcycle"],50];
    				if ((count _nearPlayerVehicles) > 0) then {
    					{
    						if (_x != _vehicle && ((count (crew _x)) > 0)) then {
    							_validVehicles set [(count _validVehicles), _x];
    						};
    					} forEach _nearPlayerVehicles;
    				};
    				if ((count _validVehicles) > 0) then {
    					if ((count _lastValidVehicles) != (count _validVehicles)) then {
    						_vehicle removeAction copcar_stoppolice;
    						copcar_stoppolice = -1;
    						_lastValidVehicles = _validVehicles;
    					};
    					if (copcar_stoppolice < 0) then {
    						copcar_stoppolice = _vehicle addAction ["STOP POLICE","Scripts\sirens.sqf",[_vehicle,"stop",_lastValidVehicles],2,true,true,"",""];
    					};
    				} else {
    					_vehicle removeAction copcar_stoppolice;
    					copcar_stoppolice = -1;
    				};
    				[nil, _vehicle, rSAY, "siren", 120] call RE;
    				[_vehicle, 200, true, (getPosATL _vehicle)] spawn player_alertZombies;
    				if (_vehicle isKindOf "policecar") then {
    					for "_i" from 1 to 10 do {
    						call _lightRed;
    						call _lightBlue;
    					};
    				} else {
    					for "_i" from 1 to 12 do {
    						player action ["lightOn", _vehicle];
    						uiSleep 0.2;
    						player action ["lightOff", _vehicle];
    						uiSleep 0.2;
    					};
    					uiSleep 0.2;
    				};
    			} else {
    				sirensOn = 0;
    				uiSleep 2;
    				_vehicle setVariable["sirenon",0,true];
    				_vehicle removeAction s_player_sirens_off;
    				_vehicle removeAction copcar_stoppolice;
    				s_player_sirens_on = -1;
    				s_player_sirens_off = -1;
    				copcar_stoppolice = -1;
    			};
    		};
    	};
    	
    	case "end": {
    		private ["_vehicle"];
    		_vehicle = (_this select 3) select 0;
    		_vehicle setVariable["sirenon",0,true];
    		_vehicle removeAction s_player_sirens_off;
    		sirensOn = 0;
    		cutText ["Sirens OFF!","PLAIN DOWN"];
    		uiSleep 5;
    		s_player_sirens_on = -1;
    	};
    	
    	case "stop": {
    		private ["_vehicle", "_vehicleList", "_messageList", "_targetCrew"];
    		_vehicle = (_this select 3) select 0;
    		_vehicleList = (_this select 3) select 2;
    		_vehicle removeAction copcar_stoppolice;
    		copcar_stoppolice = 0;
    		_messageList = [];
    		{
    			_targetCrew = (crew _x);
    			if ((count _targetCrew) > 0) then {
    				{
    					if (!isNull _x && alive _x) then {
    						_messageList set [(count _messageList), _x];			
    					};
    				} forEach _targetCrew;	
    			};
    		} forEach _vehicleList;
    
    		if ((count _messageList) > 0) then {
    			{
    				[nil,(_x),"loc",rTITLETEXT,"! POLICE !\n\n! STOP YOUR VEHICLE - RIGHT NOW !","PLAIN",0] call RE;
    			} forEach _messageList;
    		};
    		uiSleep 30;
    		copcar_stoppolice = -1;
    	};
    };
    

    Use the siren sound from original post.

     

     

    Credits to OtterNas3 for remote stop message function.

  6. You know where client .rpt is? It's there and looks like this.

    "========= Copying Objects [start] ========="
    "["CinderWall_DZ",[2.62939,4.50098,-0.172882],206.237]"
    "["CinderWallDoorSmallLocked_DZ",[4.03955,-4.89941,-0.299347],299.428]"
    "["CinderWall_DZ",[-2.30054,6.90039,0.0140686],205.735]"
    "["CinderWall_DZ",[7.54956,2.10059,-0.49234],205.937]"
    "["Plastic_Pole_EP1_DZ",[6.15942,-5.69922,-0.314575],298.357]"
    "["CinderWall_DZ",[7.68945,-3.59961,-0.585449],207.039]"
    "["CinderWall_DZ",[-4.5105,-8.2998,-0.358459],212.487]"
    "["CinderWall_DZ",[4.93945,-8.59961,-0.480957],27.0268]"
    "["CinderWallDoorLocked_DZ",[-10.2305,-1.19922,-0.0197754],114.9]"
    "["CinderWall_DZ",[-10.6206,3.50098,0.0860901],234.018]"
    "["CinderWall_DZ",[8.60938,-7.19922,-0.585205],296.731]"
    "["CinderWall_DZ",[-7.2605,9.40039,0.128448],206.561]"
    "["CinderWall_DZ",[12.4094,-0.399414,-1.01422],206.76]"
    "["CinderWall_DZ",[-10.9805,8.00098,0.161285],118.716]"
    "["CinderWall_DZ",[-13.8105,-2.39941,-0.0360413],212.632]"
    "["CinderWall_DZ",[13.7195,-3.99902,-1.0166],298.423]"
    "["CinderWall_DZ",[4.74951,-14.0996,-0.772858],32.1188]"
    "========= Copying Objects [end] ========="
    
×
×
  • Create New...