Jump to content
AngryHerring

handleDamage - STOP VEHICLE DAMAGE ON PLAYERS

Recommended Posts

I'm looking for an Anti "VDM", to 'disable' damage when vehicle collides with AI or players. Many Thanks!

I've tried the following; but with no luck.

Spoiler

if(vehicle _source isKindOf "LandVehicle") then { if(_source != _unit AND {alive _unit} AND {isPlayer _source}) then { _damage = 0.001; }; };

Spoiler

if (((vehicle _source isKindOf "Ship") OR ( vehicle _source isKindOf "Air") OR (vehicle _source isKindOf "LandVehicle")) AND (_projectile == "")) then { _unit allowDamage false; _unit setVariable ["life_fnc_allowDamage", False]; _unit spawn { sleep 2; _this setVariable ["life_fnc_allowDamage", True]; _this allowDamage true; }; };

Spoiler

/*
    File: fn_handleDamage.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Handles damage.
*/
private["_unit","_damage","_source","_projectile","_part","_curWep"];
_unit = _this select 0;
_part = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;

 

//ANTI VDM
    if(vehicle _source isKindOf "LandVehicle") then {
     if(_source != _unit AND {alive _unit} AND {isPlayer _source}) then {
     _damage = 0.001;
    };
};
_damage;
 

 

My file name is fn_handleDamage.sqf.

I am hosting this on a private server via the Eden editor (I am only making this for small fun missions for me and my friends).

 

With the script, no error shows up, and the damage is still there

Any help please?

 

Share this post


Link to post
Share on other sites

You mix damage in combat and collision injury.

 

The disableCollisionWith command works for that but , I can't say why, you can't loop it for several couples (unit/vehicle).

Note: No answer for this weird behavior.

 

So, If you find a solution, this could be a must.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×