Jump to content
Sign in to follow this  
Bnae

hasWeapon

Recommended Posts

Seen similiar questions and now i'm asking it again.

 

example_1

player hasWeapon "arifle_Katiba_C_F";

So if player takes Katiba this will run. No matter if from ground or from backpack.

 

example_2

"30Rnd_65x39_caseless_mag_Tracer" in magazines player

Same thing with magazine.

 

example_3

"ItemMap" in assigneditems player

Same thing with map.

 

 

But how about balaclava / face cover?

 

Cannot find any topic or Biki page about these things. If anyone knows there is, please link it.

And if there is not, could somebody share this info.

Share this post


Link to post
Share on other sites
_goggles = goggles player;
if (_goggles == "classname") then {true};

 

Okay this is working.

 

But it works only once when that script is activated. How do i make that constantly activated?

Share this post


Link to post
Share on other sites

Okay this is working.

 

But it works only once when that script is activated. How do i make that constantly activated?

 

What do you mean by "constantly activated" ?

constantly checking ?

Share this post


Link to post
Share on other sites

But it works only once when that script is activated. How do i make that constantly activated?

 

 

waitUntil {sleep 1; _goggles == "classname"}; A while loop would also work.

Share this post


Link to post
Share on other sites

What do you mean by "constantly activated" ?

constantly checking ?

 

Yeah constantly checking.

Share this post


Link to post
Share on other sites

waitUntil {sleep 1; _goggles == "classname"}; A while loop would also work.

 

This only added 1sec delay.

 

Why there is no "when" command? :huh:

Share this post


Link to post
Share on other sites

This only added 1sec delay.

 

Why there is no "when" command? :huh:

Because that's unfortunately not how sqf works. ;) You could try something like this: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Takebut that only works if the item is taken from a container (and I don't know if groundweaponholder is a container in this regard).

Share this post


Link to post
Share on other sites

When player hasWeapon "xxxxx"; ? How would that work, same like waitUntil, it would constantly check if the condition is met.

 

 

You can remove the sleep from the waitUntil, but keep in mind that it will then run on each frame.

Share this post


Link to post
Share on other sites

 

Why there is no "when" command? :huh:

 

In which langage do you find this command ?

Share this post


Link to post
Share on other sites

When player hasWeapon "xxxxx"; ? How would that work, same like waitUntil, it would constantly check if the condition is met.

 

 

You can remove the sleep from the waitUntil, but keep in mind that it will then run on each frame.

 

It took waay too long for me to figure this out.

 

Thanks davidoss and R3vo for quick and simple answers!

waitUntil{
    sleep 1;
    _goggles = goggles player;
    _goggles == "G_Diving";
};

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  

×