Jump to content

Script Locked Vehicles No Damage?


Shiz

Recommended Posts

@ebayn0.0b

 

Would this take in count for players inside the vehicles? I really dont want my players to figure out that they are able to enter a vehicle. Have a friend lock it and then be in an invinsible vehicle.

Unless the vehicle is completely disabled while being locked? Can one use the minigun on a locked suv if inside for example?

Link to comment
Share on other sites

I have a problem when using this. after I have locked the car within the range of the plot pole, it stays indestructible after I unlock it, it also stays indestructible after I drive away from the plot pole.

Link to comment
Share on other sites

I have a problem when using this. after I have locked the car within the range of the plot pole, it stays indestructible after I unlock it, it also stays indestructible after I drive away from the plot pole.

 

can confirm this is the case, any idea of a fix ebay?

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

A comment that hasn't been answered since the 26th of march :P is there a way to incorporate this with the salvage script so basically you can't salvage locked vehicles, i would try at it myself but i would indefinitely break something important xD

Link to comment
Share on other sites

  • 3 weeks later...

InfiSTAR's code kinda works. The first vehicle I tried was invincible when locked & able to be destroyed when unlocked. However when I tried another vehicle, it was invincible no matter what. Any solution for that?

Also, if I wanted to go the other route, what DayZ_Code.pbo would you use when running overpoch? The one in the @epoch folder or the one in the @overwatch folder?

Link to comment
Share on other sites

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.

 Guys am i being stupid, I lost a bit in this thread Do i need to make a new Vehicledamage.sqf (copy from dayz_code.pbo) and delete all that is in there and replace with the above code or do I have to add the above code to the init.sqf and if so where at the bottom or in a specific place thanks#

MegaZ

Link to comment
Share on other sites

  • 3 weeks later...

I don't have the original version, i just looked at what has been posted here. This worked (with limited testing) as intended for near a plot pole. I set it to only 10 meters from the pole so you can adjust as you wish. If you find it doesn't work right I would like to here about it.

 

/***********************************************************
ASSIGN DAMAGE TO A UNIT
- Function Vehicle_HandleDamage
- [unit, selectionName, damage, source, projectile] call Vehicle_HandleDamage;
************************************************************/
private["_selection","_state","_strH","_total","_unit"];
_unit = _this select 0;
_selection = _this select 1;
_total = _this select 2;
_state = false;
 
 
if ((locked _unit && (count (crew _unit)) == 0) && (count(nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"],10]) > 0)) exitWith {_state = true;};
if (_state) exitWith {};
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 {
    PVDZE_send = [_unit,"VehHandleDam",_this];
    publicVariableServer "PVDZE_send";
};
_total
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 9 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...