English Solved How to add stun weapon with vertigo effect to police?

  • Auteur de la discussion Auteur de la discussion Paris0
  • Date de début Date de début

Paris0

User
25/6/21
6
0
100
I want to know how to add the stun weapon of the police. I tried some methods, but it didn't work.(With vertigo effect)
 
Solution
Can you try to replace this line :
Code:
if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F","srifle_EBR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual","20Rnd_762x51_Mag"]) then {
by this one :
Code:
if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F","srifle_EBR_F"]) then {

I removed the condition about the projectile, maybe you used one that is not in the array and that's why the condition didn't pass
I tried to modify this script (fn_handleDamage.sqf), but it didn't work.我试过修改(fn_handleDamage.sqf)这个脚本,但是不起作用.
 
Code:
params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]]
];

if (!isNull _source && {_source != _unit}) then {
    if (side _source isEqualTo west) then {
    //晕枪判断
        if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F","srifle_EBR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual","20Rnd_762x51_Mag"]) then {
       
            if (alive _unit) then {
                if (playerSide isEqualTo civilian && {!life_istazed}) then {
                    private _distance = 35;
                    if (_projectile isEqualTo "B_556x45_dual"||_projectile isEqualTo "20Rnd_762x51_Mag") then {_distance = 100};
                    if (_unit distance _source < _distance) then {
                        if !(isNull objectParent _unit) then {
                            if (typeOf (vehicle _unit) isEqualTo "B_Quadbike_01_F") then {
                                _unit action ["Eject",vehicle _unit];
                                [_unit,_source] spawn life_fnc_tazed;
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazed;
                        };
                    };
                };
                _damage = if (_part isEqualTo "") then {
                    damage _unit;
                } else {
                    _unit getHit _part;
                };
            };
        };
    };
};

[] spawn life_fnc_hudUpdate;
_damage;
 
Dernière édition par un modérateur:
{ "hgun_P07_snds_F", [眩晕], 2000, 1000, "" },
{ "arifle_SDAR_F",[眩晕], 2000, 1000, "" },
{ "srifle_EBR_F", [眩晕], 10000, 5000, "call life_donorlevel > 4&&call life_coplevel >= 4" },//MK18-迷彩
this
 
Can you try to replace this line :
Code:
if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F","srifle_EBR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual","20Rnd_762x51_Mag"]) then {
by this one :
Code:
if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F","srifle_EBR_F"]) then {

I removed the condition about the projectile, maybe you used one that is not in the array and that's why the condition didn't pass
 
Solution