Jump to content
[IL] KingCrazyHunter

[5.0] SCROLL WHEEL RUBBER BULLETS (Like Asylum & Olympus)

Recommended Posts

AuthorsSkalicon, Mahribar, Edward Cullen & Jokahghost

Updated by: Jokahghost

Difficulty: Easy

VersionTested on 5.0 (Could work on 4.4)

(special thanks to @Josh for sharing the tazedRubber.sqf)

 

STEP 1:
Go to into Core >> Civilian and create file called fn_tazedRubber.sqf and paste this inside the file:

Spoiler
#include "..\..\script_macros.hpp"
/*
    File: fn_tazedRubber.sqf
    Author: Skalicon modded by Mahribar
    Further modded and updated to 5.0 by Edward Cullen

    Description: Downed state for rubber bullets
*/
private["_curWep","_curMags","_attach"];
params [
    ["_unit",objNull,[objNull]],
    ["_shooter",objNull,[objNull]]
];

if(isNull _unit OR isNull _shooter) exitWith {player allowDamage true; life_isdowned = false;};


if (_shooter isKindOf "Man" && alive player) then {
    if (!life_istazed) then {
        life_istazed = true;
        _curWep = currentWeapon player;
        _curMags = magazines player;
        _attach = if (!(primaryWeapon player isEqualTo "")) then {primaryWeaponItems player} else {[]};

        {player removeMagazine _x} forEach _curMags;
        player removeWeapon _curWep;
        player addWeapon _curWep;
        if (!(count _attach isEqualTo 0) && !(primaryWeapon player isEqualTo "")) then {
            {
                _unit addPrimaryWeaponItem _x;
            } forEach _attach;
        };

        if (!(count _curMags isEqualTo 0)) then {
            {player addMagazine _x;} forEach _curMags;
        };

        [_unit] remoteExecCall ["life_fnc_tazeSound",RCLIENT];
        _obj = "Land_ClutterCutter_small_F" createVehicle ASLTOATL(visiblePositionASL player);
        _obj setPosATL ASLTOATL(visiblePositionASL player);
        [player,"AinjPfalMstpSnonWnonDf_carried_fallwc"] remoteExecCall ["life_fnc_animSync",RCLIENT];
        [0,"STR_NOTF_Rubber",true,[profileName, _shooter getVariable ["realname",name _shooter]]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
        _unit attachTo [_obj,[0,0,0]];
        disableUserInput true;
        sleep 15;

        [player,"AmovPpneMstpSrasWrflDnon"] remoteExecCall ["life_fnc_animSync",RCLIENT];

        if (!(player getVariable ["Escorting",false])) then {
            detach player;
        };
        life_istazed = false;
        player allowDamage true;
        disableUserInput false;
    };
}
    else
{
    _unit allowDamage true;
    life_isdowned = false;
};

 

 

STEP 2:
Open your Functions.hpp inside your main mission directory and paste this in Class Civilian

Spoiler
        class tazedRubber {};

 

It should look like this: 

Spoiler
class Civilian {
        file = "core\civilian";
        class civLoadout {};
        class civMarkers {};
        class demoChargeTimer {};
        class demoChargeTimerBank {};
        class freezePlayer {};
        class jail {};
        class jailMe {};
        class knockedOut {};
        class knockoutAction {};
        class removeLicenses {};
        class robPerson {};
        class robReceive {};
        class tazed {};
        class tazedRubber {};
    };

 

 

STEP: 3

Go into your core >> functions folder then open up your handle damage and replace with this:

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

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]]
];

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 35;
                    //if (_projectile == "B_556x45_dual") then {_distance = 100;};
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent 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 = 0;
            };
        };
    };
};

//Rubberbullets
    if (currentWeapon _source in ["arifle_MXM_Black_F"] && (_source getVariable ["nonLethals",true]) && _projectile in ["B_65x39_Caseless"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_isdowned && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 300;
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazedRubber; //change this too
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazedRubber; // here too
                        };
                    };
                };
            };

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

[] spawn life_fnc_hudUpdate;

_damage;

 

Here's what it looks like if you have seatbelt/anti VDM

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

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]]
];

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 35;
                    //if (_projectile == "B_556x45_dual") then {_distance = 100;};
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent 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 = 0;
            };
        };
    };
};

//Rubberbullets
    if (currentWeapon _source in ["arifle_MXM_Black_F"] && (_source getVariable ["nonLethals",true]) && _projectile in ["B_65x39_Caseless"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_isdowned && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 300;
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazedRubber; //change this too
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazedRubber; // here too
                        };
                    };
                };
            };

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

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

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

[] spawn life_fnc_hudUpdate;

_damage;

 

 

STEP 4:

Go into the core folder and open up fn_initCop.sqf and add this to the very bottom

Spoiler
player setVariable["nonLethals",true,true];

 

 

STEP 5:

Still in the core folder open up configuration.sqf and add this under life_istazed = false;

Spoiler
life_isdowned = false;

 

 

STEP 6

Open up setup actions in the core folder and add this to the west class

Spoiler
life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];

 

 

STEP 7
Go to your stringtable.xml and add

Spoiler
	<Key ID="STR_NOTF_Rubber">
            <Original>%1 was downed by %2</Original>
        </Key>

 

 

 

 

To change what weapons can be used with the script just open handleDamage.sqf and change the line like so:

         1                    2                         3                                                                                      1                       2                      3
["arifle_MXM_Black_F","WEAPON CLASSNAME HERE","WEAPON CLASSNAME HERE"] && (_source getVariable ["nonLethals",true]) && _projectile in ["B_65x39_Caseless","BULLET CLASSNAME HERE","BULLET CLASSNAME HERE"]

ITS BULLET/AMMO CLASSNAMES NOT MAGAZINE TO FIND BULLET/AMMO CLASSNAMES GO HERE UNDER THE AMMO COLUMN:

https://docs.google.com/spreadsheets/d/1w2LK46k9qXPlFOB7d_-N3AI_WAbvCMUY7RYqGBqkVMI/edit#gid=12

Edited by [IL] KingCrazyHunter

Share this post


Link to post
Share on other sites

I followed all steps and it doesn't work.

5.0

 

EDIT: Never mind! I was using the mag class name not the bullet class name xD

Edited by Motra

Share this post


Link to post
Share on other sites
11 minutes ago, [IL] KingCrazyHunter said:

make sure you are calling _damage at the bottom of your handle damage

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

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]]
];

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 35;
                    //if (_projectile == "B_556x45_dual") then {_distance = 100;};
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent 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 = 0;
            };
        };
    };
};

//Rubberbullets
    if (currentWeapon _source in ["arifle_Mk20_F","arifle_SPAR_01_blk_F","arifle_MX_Black_F","arifle_MXC_Black_F","arifle_MXM_Black_F","arifle_MX_SW_Black_F"] && (_source getVariable ["nonLethals",true]) && _projectile in ["B_556x45_Ball_Tracer_Red","B_65x39_Caseless_green"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_isdowned && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 300;
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazedRubber; //change this too
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazedRubber; // here too
                        };
                    };
                };
            };

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

[] spawn life_fnc_hudUpdate;

_damage;
 

 

Im using the exact same one as you posted.

Share this post


Link to post
Share on other sites
Just now, [IL] KingCrazyHunter said:

you have 6 weapons defined but only 2 projectiles

Yes. Those bullets are for the same calibre gun. 6.5 

When  I shoot someone with that bullets I added, it does no damage. 

Share this post


Link to post
Share on other sites
3 minutes ago, [IL] KingCrazyHunter said:

you have 6 weapons defined but only 2 projectiles

You are gonna have to be more specific with this coz i am new to coding. Hence im here using this script. 

Share this post


Link to post
Share on other sites
On 2017-6-18 at 0:38 AM, Motra said:

I added the correct bullet class name and when i shoot a civ, it just does no damage. It doesn't down them or anything.

If you are trying to shoot a AI it will not work.

Share this post


Link to post
Share on other sites
53 minutes ago, WitZ said:

If you are trying to shoot a AI it will not work.

nah, i tried to shoot my friend who was on civilian (i was on cop)

Share this post


Link to post
Share on other sites
On 17/06/2017 at 10:29 PM, [IL] KingCrazyHunter said:

STEP 6

Open up setup actions in the core folder and add this to the west class

  Hide contents

life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];

I don't see a part for west in my file i have ? do i need to make this part in the file?

 

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
    };
};
life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];

 

Thanks for the help guys!

Share this post


Link to post
Share on other sites
1 minute ago, {Ë} Sparky said:

I don't see a part for west in my file i have ? do i need to make this part in the file?

 

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
    };
};
life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];

 

Thanks for the help guys!

yes

Share this post


Link to post
Share on other sites
2 minutes ago, [IL] KingCrazyHunter said:

yes

a better bit of help i would apparate :) 

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
    };
};

without the edit!

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
    };
};
life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];

with the edit!

Will this work like this or am i missing anything ?

Thank you 

Share this post


Link to post
Share on other sites

or is it this??

 

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
    };
	
    case cop: {
        //Load Rubber Bullets
        life_actions = life_actions + [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
        //Load Lethal Bullets
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];
    };
};

 

Edited by {Ë} Sparky

Share this post


Link to post
Share on other sites
 //Load Rubber Bullets
        life_actions = [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
        //Load Lethal Bullets
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];
    };

 

Try that, you need life action= then all others are life actions=life actions +

Share this post


Link to post
Share on other sites
/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
        //Load Rubber Bullets
        life_actions = [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
        //Load Lethal Bullets
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];
    };
};

 

Like this?? I will test in a few hours to see, Thank you so much for all the help :) 

Share this post


Link to post
Share on other sites
26 minutes ago, {Ë} Sparky said:
/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable["robbed",FALSE]) ']];
        //Load Rubber Bullets
        life_actions = [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
        //Load Lethal Bullets
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];
    };
};

 

Like this?? I will test in a few hours to see, Thank you so much for all the help :) 

like this 

case west: {
	//Load Rubber Bullets
    life_actions = [player addAction["<t color='#51FF00'>Load Rubber Bullets</t>",{player setVariable ['nonLethals',true,true];},"",0,false,false,"",'(!(player getVariable ["nonLethals",false])']];
    //Load Lethal Bullets
	life_actions = life_actions + [player addAction["<t color='#FF0000'>Load Lethal Bullets</t>",{player setVariable ['nonLethals',false,true];},"",0,false,false,"",'((player getVariable ["nonLethals",false])']];
};

 

Share this post


Link to post
Share on other sites

so im having an issue with the script not sure if its the weapon i used or not but i have confirmed that the bullet is the correct class name for the rifle the Var si changing when the cop is switch form lethal to no so i know it it isnt that and the tazer works and the VDM prevention works but the rubber bullet does not any help would be helpful

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

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]]
];

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 35;
                    //if (_projectile == "B_556x45_dual") then {_distance = 100;};
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent 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 = 0;
            };
        };
    };
};

//Rubberbullets
//Type 115 rifle being Used
    if (currentWeapon _source in ["arifle_ARX_blk_F"] && (_source getVariable ["nonLethals",true]) && _projectile in ["B_50BW_Ball_F "]) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                _damage = 0;
                if (alive player && !life_isdowned && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                    private ["_distance"];
                    _distance = 300;
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazedRubber; //change this too
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazedRubber; // here too
                        };
                    };
                };
            };

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

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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...