Jump to content
Sign in to follow this  
malakdecaen

How to detect if player have a silencer on his weapon ?

Recommended Posts

Hi everybody ,

Is there a way to detect if the player have a silencer on his weapon ?primary and secondary ?

and get a hint if yes .

Thanks a lot guys and sorry for my bad english .

Share this post


Link to post
Share on other sites

Yes, check it out:

_arr = 
[
    "muzzle_snds_H", 
    "muzzle_snds_L",
    "muzzle_snds_M",
    "muzzle_snds_B",
    "muzzle_snds_H_MG"
];

_items = primaryWeaponItems player;

{
    if (_x in _arr) then
    {
         hint format ["Players Pri weapon has a %1", _x];
    };
} forEach _items;

_items = secondaryWeaponItems player;

{
    if (_x in _arr) then
    {
         hint format ["Players Sec weapon has a %1", _x];
    };
} forEach _items;

This is easier if I could look at the configs at work (you can easily get compatible silencers from config).

Edited by Das Attorney

Share this post


Link to post
Share on other sites

thank you very much , i go to test it .

EDIT: Thanks that's exactly what i'm looking for and the code work perfectly !!

Thanks for you'r time .

Edited by kakarot

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
Sign in to follow this  

×