Jump to content
Sign in to follow this  
Ghost

Detect Access To Weapons Crate

Recommended Posts

I know how to fill a weapons crate and I know how to keep it filled but I want to do it in a different way. I am wanting to know how to detect when someone access the gear on a specified weapons crate so that a script can launch and fill it. This way no need to have a script looping to keep the crate full and you can have small numbers of weapons to get the most weapons possible into a weapons crate.

Share this post


Link to post
Share on other sites

At mission start declare two variables with load of your ammobox with commands:

myWeapons = getWeaponCargo box1;

myMagazines = getMagazineCargo box1;

To check if cargo has changed during mission compare your loadout in condition row of a trigger: isServer AND ((myWeapons != getWeaponCargo box1) OR (myMagazines != getMagazineCargo box1))

In activation row put your command/script to reload the box1.

:rolleyes:

Edited by Buliwyf

Share this post


Link to post
Share on other sites

Thanks for the reply. So basically I still have to have a loop script to check if the weapon list has changed. Similar to what I have now but could be a useful check still. I was hoping for an eventhandler type setup that detects play at gear. Guess my best bet would be to figure out a proper weapon script dialog for my needs.

Share this post


Link to post
Share on other sites

Think the best you could do is to check people's animation-state when within a certain radius of the box (if you want to be able to do your thing even without the ammo box contents changing), but even that requires a passive script to 'watch'.

Share this post


Link to post
Share on other sites

Does anyone know what scripts are launched or how the addaction for the gear action is setup on ammo boxes? If I knew that I am sure I could figure something out.

Share this post


Link to post
Share on other sites
Does anyone know what scripts are launched or how the addaction for the gear action is setup on ammo boxes? If I knew that I am sure I could figure something out.

Anyway you look at it you need a script running to check animation or weapons in crate wich is best way like Buliwyf explained.

Do this for every crate you want to monitor:

place at end of the fill part of your script:

myWeapons = getWeaponCargo nameOfBox;
myMagazines = getMagazineCargo nameOfBox;

WaitUntil {sleep 1; myWeapons  != getWeaponCargo nameOfBox OR myMagazines != getMagazineCargo nameOfBox};
// run the fill box script again here.
[whatever] execVM "whatever_Script.sqf";
//end

Edited by Demonized

Share this post


Link to post
Share on other sites

Thank you all for the replies. I will have to tinker with the system. Was hoping to find a way to bypass the limited box quantities.

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  

×