Jump to content
suffer4real

[Tutorial] how to add Anti-VDM

Recommended Posts

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Difficulty: Easy

Publish by:  suffer4real

Source AltisLifeRPG.com cache

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Go to "core\functions\fn_handleDamage.sqf" and add this block at the end

 

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


That was it ....

or take AlaskaVet his version of it.
 

//VDM Report And ADD
if ((isPlayer _source) && (vehicle _source != _source)) then {
if(_part == "body" && (player getVariable["limit",true]) && (side _source == civilian)) then {
player setVariable ["limit",false];
[_source] spawn {
_driver = _this select 0;
[0,format["%1 just ran over %2!", name _driver, name player]] remoteExec ["life_fnc_broadcast",0];
sleep(10);
player setVariable ["limit",true];
	};
};				
_damage = getDammage player;
};

Share this post


Link to post
Share on other sites

Or you could do this:

//VDM Report And ADD
if ((isPlayer _source) && (vehicle _source != _source)) then {
if(_part == "body" && (player getVariable["limit",true]) && (side _source == civilian)) then {
player setVariable ["limit",false];
[_source] spawn {
_driver = _this select 0;
[0,format["%1 just ran over %2!", name _driver, name player]] remoteExec ["life_fnc_broadcast",0];
sleep(10);
player setVariable ["limit",true];
	};
};				
_damage = getDammage player;
};

This way to tells you in chat who ran over who. Kinda handy to see if someone is trying to run people over. You could also just log it. or just hint it to the player that got ran over.

  • Like 1

Share this post


Link to post
Share on other sites
On 9/17/2016 at 4:12 PM, AlaskaVet said:

2nd one is anti vdm and reports who is trying to do it.

For some reason, tyour anti-vdm doesn't work, it tells them in chat but doesn't stop them from dying

Share this post


Link to post
Share on other sites

Been tested and keeps any damage the same IE doesnt heal or damage More

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;  
	};  
};

 

Share this post


Link to post
Share on other sites
4 minutes ago, JeffJ said:

None of these worked for me ... Running 4.4r3 with no errors, but the person who gets run over dies.

Anyone got a working one?

Post your fn_handleDamage.sqf

Share this post


Link to post
Share on other sites
On 11/7/2016 at 0:44 AM, AlaskaVet said:

Post your full file.

 

I swapped my file for your one that I downloaded and it still doesn't work I just think the VDM script doesn't work at all same as everyone else has been saying

Share this post


Link to post
Share on other sites
On 11/11/2016 at 2:43 PM, PG Wisdom said:

 

I swapped my file for your one that I downloaded and it still doesn't work I just think the VDM script doesn't work at all same as everyone else has been saying

And yet it works..

Share this post


Link to post
Share on other sites

heres mine:

            if (vehicle _unit == _unit) then {
            if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Motorcycle" OR _source isKindOf "Boat" OR _source isKindOf "Tank" ) then
            {
            }
            else
            {
                
                _isVehicle = vehicle _source;
                if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Motorcycle" OR _isVehicle isKindOf "Tank") then
                {
                    _damage = _currdamage;
                };
            };
		};

place it after:

//Temp fix for super tasers on cops.
			if(playerSide == west && side _source == west) then {
				_damage = false;
			};
		};
	};
};

 

Share this post


Link to post
Share on other sites

I have tested them all, and they all work for me, I use 4.4r3, but what I need is a way of allowing people to shoot from the back of vehicles ie like offroads, and it allows damage and does not activate the VDM Script.

I have been playing with it for a week or so and cant seem to get it right.

Share this post


Link to post
Share on other sites

doesnt seem to do anything for me i tried all 3 of the scripts above seperately oFC but none of them seemed to work, the first one worked the first time i hit some one, then didnt work again, the 2nd one listed in original post just spat out a message in chat but the player still died and the 3rd one from comments doesnt seem to do anything at all

Share this post


Link to post
Share on other sites

@Nova-StreamerThreads This is the one that works for me. I will post what my whole file looks like.

  if (vehicle _unit == _unit) then {
            if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Motorcycle" OR _source isKindOf "Boat" OR _source isKindOf "Tank" ) then
            {
            }
            else
            {
                
                _isVehicle = vehicle _source;
                if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Motorcycle" OR _isVehicle isKindOf "Tank") then
                {
                    _damage = _currdamage;
                };
            };
		};
  • Like 1

Share this post


Link to post
Share on other sites

Make sure you add it right where mine is located.

#include "..\..\script_macros.hpp"
/*
    File: fn_handleDamage.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
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;

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (_unit getVariable["Revive",false]) exitWith {};
        _curWep = currentWeapon _source;
        if (_projectile in ["B_9x21_Ball","B_556x45_dual"] && _curWep in ["hgun_P07_snds_F","arifle_SDAR_F"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                private["_distance"];
                _distance = if (_projectile == "B_556x45_dual") then {100} else {35};
                _damage = false;
                if (_unit distance _source < _distance) then {
                    if (!life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                        if (vehicle player != player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazed;
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazed;
                        };
                    };
                };
            };

            //Temp fix for super tasers on cops.
            if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
                _damage = false;
            };
        };
    };
};

if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
{
    _damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
};

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

[] spawn life_fnc_hudUpdate;
_damage;
 

  • Like 1

Share this post


Link to post
Share on other sites

And this is the one that worked..

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

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×