Zeiss Posted March 21, 2014 Report Share Posted March 21, 2014 Hi Hardend. the script works, but if it is build, the car go at 4 committee on the engin or ib a collision at once in flames on without not sorry for my bad english Link to comment Share on other sites More sharing options...
pewes Posted March 22, 2014 Report Share Posted March 22, 2014 this is my custom vehicle_handleDamage.sqf. try this... /*********************************************************** ASSIGN DAMAGE TO A UNIT - Function Vehicle_HandleDamage - [unit, selectionName, damage, source, projectile] call Vehicle_HandleDamage; ************************************************************/ private["_unit","_selection","_strH","_total","_damage","_needUpdate"]; _unit = _this select 0; _selection = _this select 1; _total = _this select 2; if (locked _unit) exitWith {}; //<--add this line if (_selection != "") then { _strH = "hit_" + _selection; } else { _strH = "totalDmg"; }; if (_total >= 0.98) then { _total = 1.0; }; if (local _unit) then { if ( _total>0 ) then { _unit setVariable [_strH,_total,true]; _unit setHit [_selection, _total]; if (isServer) then { [_unit, "damage"] call server_updateObject; } else { PVDZE_veh_Update = [_unit,"damage"]; publicVariableServer "PVDZE_veh_Update"; }; }; } else { // vehicle is not local to this client, ask the client which vehicle is local to set damage /* PVS/PVC - Skaronator */ PVDZE_send = [_unit,"VehHandleDam",_this]; publicVariableServer "PVDZE_send"; }; // all "HandleDamage event" functions should return the effective damage that the engine will record for that part _total Gr8 1 Link to comment Share on other sites More sharing options...
Zeiss Posted March 22, 2014 Report Share Posted March 22, 2014 Hi, thanks for your script, but than T may have problem that man may enter the car when someone site in it Link to comment Share on other sites More sharing options...
FreakingFred Posted March 23, 2014 Report Share Posted March 23, 2014 this is my custom vehicle_handleDamage.sqf. try this... /*********************************************************** ASSIGN DAMAGE TO A UNIT - Function Vehicle_HandleDamage - [unit, selectionName, damage, source, projectile] call Vehicle_HandleDamage; ************************************************************/ private["_unit","_selection","_strH","_total","_damage","_needUpdate"]; _unit = _this select 0; _selection = _this select 1; _total = _this select 2; if (locked _unit) exitWith {}; //<--add this line if (_selection != "") then { _strH = "hit_" + _selection; } else { _strH = "totalDmg"; }; if (_total >= 0.98) then { _total = 1.0; }; if (local _unit) then { if ( _total>0 ) then { _unit setVariable [_strH,_total,true]; _unit setHit [_selection, _total]; if (isServer) then { [_unit, "damage"] call server_updateObject; } else { PVDZE_veh_Update = [_unit,"damage"]; publicVariableServer "PVDZE_veh_Update"; }; }; } else { // vehicle is not local to this client, ask the client which vehicle is local to set damage /* PVS/PVC - Skaronator */ PVDZE_send = [_unit,"VehHandleDam",_this]; publicVariableServer "PVDZE_send"; }; // all "HandleDamage event" functions should return the effective damage that the engine will record for that part _total If you change line 12 to if (locked _unit && (count (crew _unit)) == 0) exitWith {}; it will stop players from being able to abuse the script. Basically, this just checks if the vehicle has any players in it and if it does, regardless of whether it is locked or not, it will take damage. Unmanned locked vehicles will still take no damage. Draftkid, justchil, cikez and 3 others 6 Link to comment Share on other sites More sharing options...
carl101 Posted March 23, 2014 Report Share Posted March 23, 2014 thanks pewes, works a treat Link to comment Share on other sites More sharing options...
HellGamer115 Posted March 23, 2014 Report Share Posted March 23, 2014 If you change line 12 to if (locked _unit && (count (crew _unit)) == 0) exitWith {}; it will stop players from being able to abuse the script. Basically, this just checks if the vehicle has any players in it and if it does, regardless of whether it is locked or not, it will take damage. Unmanned locked vehicles will still take no damage. can you help me, how do i add this to safe zone traders? so if they are in safe, the car wont take any damage Link to comment Share on other sites More sharing options...
flakvest Posted March 25, 2014 Report Share Posted March 25, 2014 Where would one find and call a custom vehicle_handleDamage.sqf? Link to comment Share on other sites More sharing options...
justchil Posted March 25, 2014 Report Share Posted March 25, 2014 Works great :D day_code and call it in custom compiles.sqf flakvest 1 Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2014 Report Share Posted March 26, 2014 Hey how does with work with salvageable vehicles? When locked can you still remove a tire when it's indestructible? Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2014 Report Share Posted March 26, 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; }; }; Where do i have to place this? I have infistar and want to use this skript. Thanks! Link to comment Share on other sites More sharing options...
Sukkaed Posted March 26, 2014 Report Share Posted March 26, 2014 Where do i have to place this? I have infistar and want to use this skript. Thanks! Do what FreakingFred said in post #33. Get vehicle_handleDamage.sqf from dayz_code and call it from compiles.sqf. Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2014 Report Share Posted March 26, 2014 Do what FreakingFred said in post #33. Get vehicle_handleDamage.sqf from dayz_code and call it from compiles.sqf. Ok thanks. i´m not sure what i am going to use. In Epoch 1.0.5 it will be possible to show which player made what damage to this vehicle. Or maybe it is a good idea to use this costum vehicle damage handler. i think i am going to ask the players on my server, what they are thinking is the best. Thank you all anyway!!! Link to comment Share on other sites More sharing options...
calamity Posted March 28, 2014 Report Share Posted March 28, 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 false; } else { _vehicle setVehicleLock "UNLOCKED"; _vehicle setVariable ["R3F_LOG_disabled",false,true]; _vehicle allowDamage true; _vehicle enableSimulation true; }; }; is there something wrong with this way ??? It works.... could anyone tell why I shouldn't do it this way ?? Snobby 1 Link to comment Share on other sites More sharing options...
Guest Posted March 31, 2014 Report Share Posted March 31, 2014 Hey, maybe also add a time, so that players can´t just lock there vehicles if they are getting into combat. Would it help to simply insert a sleep 1800 seconds (30 mins) ? Where would i have to insert it ? I want the vehicle to be locked but invincible after 30 minutes after the lock. Thanks Exo Link to comment Share on other sites More sharing options...
Guest Posted April 3, 2014 Report Share Posted April 3, 2014 Could someone help me ? I would like to use this but i want the vehicle to be indestructable after 30 minutes. So the owner locks the vehicle and 30 minutes later its indestructable. Where do i have to insert the sleep ? Want to use the script from post #33 Link to comment Share on other sites More sharing options...
Lacost Posted April 3, 2014 Report Share Posted April 3, 2014 is there something wrong with this way ??? It works.... could anyone tell why I shouldn't do it this way ?? I think after the restart god mode disappear Link to comment Share on other sites More sharing options...
Spec-CrazyG Posted April 14, 2014 Report Share Posted April 14, 2014 It does work calamity, used along with freakinfred's post. Doesn't matter restart or not, no problems here.. been using since posting it. Link to comment Share on other sites More sharing options...
calamity Posted April 14, 2014 Report Share Posted April 14, 2014 only problem I have is some vehicles are floating... not sure if its my locked god fault though... Link to comment Share on other sites More sharing options...
Spec-CrazyG Posted April 15, 2014 Report Share Posted April 15, 2014 That must be from something else.. never seen that happen with this. Link to comment Share on other sites More sharing options...
Hannibal_5 Posted May 6, 2014 Report Share Posted May 6, 2014 Calamity I tried using the code you posted... not working for me did you make anymore changes to it after your post to get it working? As of right now when i add it in im getting the unlock option on vehicle but its not unlocking and vics are still able to be destroyed. Link to comment Share on other sites More sharing options...
shan1784 Posted May 7, 2014 Report Share Posted May 7, 2014 I don't see these files to modify.. Do I have to create new ones? I am running Epoch Taviana.. Any help would be appreciated... Link to comment Share on other sites More sharing options...
Soldat5155 Posted May 21, 2014 Report Share Posted May 21, 2014 Is there anyway to make LOCKED vehicles invincible only near a plot pole? Any help would be appreciated.. I have seen servers like this and it would be helpful for my private server at work, since my co-workers have an obsession with suicide bombing my locked vehicles lol. Draftkid 1 Link to comment Share on other sites More sharing options...
Draftkid Posted May 21, 2014 Report Share Posted May 21, 2014 Is there anyway to make LOCKED vehicles invincible only near a plot pole? Any help would be appreciated.. I have seen servers like this and it would be helpful for my private server at work, since my co-workers have an obsession with suicide bombing my locked vehicles lol. I'm also interested in this instead of them being invincible across the map. have a check for a plot pole with in so many meters. code after line 12..? Link to comment Share on other sites More sharing options...
Soldat5155 Posted May 21, 2014 Report Share Posted May 21, 2014 Thank you so much ebaynoob! I've been looking high and low for this! Link to comment Share on other sites More sharing options...
Chris9183 Posted May 26, 2014 Report Share Posted May 26, 2014 EDIT: FreakingFred's method works fine, I made a mistake. Sorry. 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