Shiz Posted March 6, 2014 Report Share Posted March 6, 2014 Will anyone share with me the setting or script for locked vehicles not to take any damage? Please I would appreciate the help. I am running the R3F heli / towing mod and was able to implement the no towing / lifting of locked vehicles. Thanks Link to comment Share on other sites More sharing options...
NikTesla Posted March 6, 2014 Report Share Posted March 6, 2014 I would be very interested in something like this if anyone is able to get it working. Link to comment Share on other sites More sharing options...
Shiz Posted March 6, 2014 Author Report Share Posted March 6, 2014 its working. there are servers advertising it Link to comment Share on other sites More sharing options...
cen Posted March 6, 2014 Report Share Posted March 6, 2014 You might be able to do something like this in local_lockUnlock.sqf: private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle) then { if(_status) then { _vehicle setVehicleLock "LOCKED"; vehicle_handleDamage = {}; vehicle_handleKilled = {}; (vehicle player) allowDamage false; {_x allowdamage false } foreach (nearestObjects [player,['building','LandVehicle','Air'], 400]); } else { _vehicle setVehicleLock "UNLOCKED"; vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf"; vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf"; (vehicle player) allowDamage true; }; }; Link to comment Share on other sites More sharing options...
Shiz Posted March 6, 2014 Author Report Share Posted March 6, 2014 I tried adding that code and it wouldn't unlock my vehicles.. and still took damage. Link to comment Share on other sites More sharing options...
DayZCenter Posted March 6, 2014 Report Share Posted March 6, 2014 Would be awesome to have a way to do this :) Link to comment Share on other sites More sharing options...
Shiz Posted March 7, 2014 Author Report Share Posted March 7, 2014 common someone help us out =) pretty please with sugar on top!! =) Link to comment Share on other sites More sharing options...
Sukkaed Posted March 7, 2014 Report Share Posted March 7, 2014 Should be pretty simple If you can figure out where all vehicles get locked after restart. Link to comment Share on other sites More sharing options...
Sukkaed Posted March 7, 2014 Report Share Posted March 7, 2014 server_monitor.sqf if(_ownerID != "0" and !(_object isKindOf "Bicycle")) then { _object setvehiclelock "locked"; }; Apply "god mode" inside that block and in local_lockUnlock.sqf when locked and remove when unlocked. That should do it. Link to comment Share on other sites More sharing options...
Randy the old farmer Posted March 9, 2014 Report Share Posted March 9, 2014 I got locked vehicles = indestructible on my server. You just need a custom vehicle_handleDamage.sqf :) Link to comment Share on other sites More sharing options...
Shiz Posted March 10, 2014 Author Report Share Posted March 10, 2014 AWESOME! thank ebaynoob! Link to comment Share on other sites More sharing options...
Shiz Posted March 11, 2014 Author Report Share Posted March 11, 2014 So Ebaynoob. This works..... until you unlock a vehicle and lock it again.. is this a server reset function? does it update every few hours? Link to comment Share on other sites More sharing options...
Shiz Posted March 12, 2014 Author Report Share Posted March 12, 2014 also the vehilces spawn back to where they were before restart? if you buy a car at stary.. strange Link to comment Share on other sites More sharing options...
Shiz Posted March 12, 2014 Author Report Share Posted March 12, 2014 lol.. at least you posted something! =P Link to comment Share on other sites More sharing options...
Shiz Posted March 13, 2014 Author Report Share Posted March 13, 2014 ..... see below Link to comment Share on other sites More sharing options...
Shiz Posted March 13, 2014 Author Report Share Posted March 13, 2014 Confirmed Works.. 1st codeif (isNil "fnc_vehicle_handleDamage") then {fnc_vehicle_handleDamage = vehicle_handleDamage;};vehicle_handleDamage = {private["_unit","_result"];_unit = _this select 0;if (locked _unit) exitWith {_unit allowDamage false;};_unit allowDamage true;_result = _this call fnc_vehicle_handleDamage;_result};in the init.sqf works like a f*****n charm! Link to comment Share on other sites More sharing options...
HellGamer115 Posted March 15, 2014 Report Share Posted March 15, 2014 If you want LOCKED vehicles to be invincible you have to add this in your mpmission init.sqf under your compiles: if (isNil "fnc_vehicle_handleDamage") then { fnc_vehicle_handleDamage = vehicle_handleDamage; }; vehicle_handleDamage = { private["_unit","_result"]; _unit = _this select 0; if (locked _unit) exitWith {_unit allowDamage false;}; _unit allowDamage true; _result = _this call fnc_vehicle_handleDamage; _result }; If you want LOCKABLE vehicles to be invincible you have to add this in your mpmission init.sqf under your compiles: if (isNil "fnc_vehicle_handleDamage") then { fnc_vehicle_handleDamage = vehicle_handleDamage; }; vehicle_handleDamage = { private["_unit","_result"]; _unit = _this select 0; _id = _unit getVariable ["CharacterID","0"]; if (_id != "0") exitWith { _unit allowDamage false; if (local _unit) then { if (isServer) then { [_unit, "damage"] call server_updateObject; } else { PVDZE_veh_Update = [_unit,"damage"]; publicVariableServer "PVDZE_veh_Update"; }; } else { PVDZE_send = [_unit,"VehHandleDam",_this]; publicVariableServer "PVDZE_send"; }; }; _unit allowDamage true; _result = _this call fnc_vehicle_handleDamage; _result }; For example: this doesnt work. please help i used this if (isNil "fnc_vehicle_handleDamage") then { fnc_vehicle_handleDamage = vehicle_handleDamage; }; vehicle_handleDamage = { private["_unit","_result"]; _unit = _this select 0; if (locked _unit) exitWith {_unit allowDamage false;}; _unit allowDamage true; _result = _this call fnc_vehicle_handleDamage; _result }; but all lockable vehicles are invincible and they take no damage. please help Link to comment Share on other sites More sharing options...
calamity Posted March 15, 2014 Report Share Posted March 15, 2014 Not sure if this is the proper way to do it but I just added a few lines to the local_lockUnlock.sqf This seems to work for me.... private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle) then { if(_status) then { _vehicle setVehicleLock "LOCKED"; _vehicle setVariable ["R3F_LOG_disabled",true,true]; _vehicle allowDamage false; _vehicle enableSimulation true; } else { _vehicle setVehicleLock "UNLOCKED"; _vehicle setVariable ["R3F_LOG_disabled",false,true]; _vehicle allowDamage true; _vehicle enableSimulation true; }; }; Link to comment Share on other sites More sharing options...
ebass Posted March 15, 2014 Report Share Posted March 15, 2014 Is the vehicle still indestructible if one were to lock themselves inside it? Link to comment Share on other sites More sharing options...
justchil Posted March 18, 2014 Report Share Posted March 18, 2014 I would say yes with that code. I need to dig around to get the code for ifinside veh because I don't want people to be able to do that. _vehicle = vehicle player; _inVehicle = (_vehicle != player); Is used in selfactions. So maybe like: if (isNil "fnc_vehicle_handleDamage") then {fnc_vehicle_handleDamage = vehicle_handleDamage; }; vehicle_handleDamage = { private["_unit","_result","_vehicle","_inVehicle"]; _unit = _this select 0; _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (locked _unit and !_inVehicle) exitWith {_unit allowDamage false;}; _unit allowDamage true; _result = _this call fnc_vehicle_handleDamage; _result }; Ok this didn't work for me nvm Link to comment Share on other sites More sharing options...
calamity Posted March 19, 2014 Report Share Posted March 19, 2014 couldn't you just add this to your local_lockUnlock.sqf if you dont have the locked towing protection I would put money on this private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle) then { if(_status) then { _vehicle setVehicleLock "LOCKED"; _vehicle allowDamage false; _vehicle enableSimulation true; } else { _vehicle setVehicleLock "UNLOCKED"; _vehicle allowDamage true; _vehicle enableSimulation true; }; }; Link to comment Share on other sites More sharing options...
justchil Posted March 21, 2014 Report Share Posted March 21, 2014 I've tried a few of these methods without much testing other than hopping on my server and shooting my locked vehicles... they always take damage. Can anyone confirm what they have tested/working? Link to comment Share on other sites More sharing options...
Zeiss Posted March 21, 2014 Report Share Posted March 21, 2014 when a Player gets in the vehicle and an another Player Close the car, the Driver and the vehicle will be invincible. Is it possible to Close a vehicle only when nobody in inside? Link to comment Share on other sites More sharing options...
calamity Posted March 21, 2014 Report Share Posted March 21, 2014 I've tried a few of these methods without much testing other than hopping on my server and shooting my locked vehicles... they always take damage. Can anyone confirm what they have tested/working? when I tested I had same result almost gave up and then tried re-locking vehicle and then it was in god mode. so if its already locked b4 the script was loaded you need to relock it for godmode to take efffect Link to comment Share on other sites More sharing options...
Sukkaed Posted March 21, 2014 Report Share Posted March 21, 2014 Maybe something like this. This won't allow you to lock the vehicle if there is someone inside. Untested. local_lockUnlock.sqf private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle) then { if(_status) then { if (count crew _vehicle == 0) then { _vehicle setVehicleLock "LOCKED"; _vehicle removeAllEventHandlers "handleDamage"; _vehicle addEventHandler ["handleDamage", {false}]; _vehicle enableSimulation false; _vehicle allowDamage false; titleText ["LOCKED! Can not be damaged!","PLAIN DOWN"]; titleFadeOut 4; } else { titleText ["You can't lock while there is someone inside!","PLAIN DOWN"]; titleFadeOut 4; }; } else { _vehicle setVehicleLock "UNLOCKED"; _vehicle removeAllEventHandlers "handleDamage"; _vehicle addEventHandler ["handleDamage", {true}]; _vehicle enableSimulation true; _vehicle allowDamage true; vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf"; titleText ["UNLOCKED!","PLAIN DOWN"]; titleFadeOut 4; }; }; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now