Jump to content
Sign in to follow this  
alef

Some ammo fired

Recommended Posts

Hi,

I would need a method to check if a vehicle (not a soldier) has fired some ammo. It's the opposite of checking if it has some ammo left. I need to know it the vehicle has fired at least a single shot with any weapon.

The reason is a kind of bug for which in MP pilot and gunner ammo count don't get synced on reammo. For this, I'm putting a trigger which delete/createVehicle once vec enters in and waituntil count crew is 0. It works, but need the extra check if the vehicle has fired in it's life.

Thanks,

alef

edited: just explained more.

Share this post


Link to post
Share on other sites

Thanks InqWiper for the suggestion.

The code used previously setVehicleAmmo 1 for the vehicle, but didn't work completely, see the first post about MP. I'm quite sure to have seen a report about this bug before, but maybe has been buried with the BTS.

As I understand, the code to implement that should be like this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_wepvec = weapons _vec;

_magvec = magazines _vec;

removeAllWeapons _vec; // On vehicle only ammo is removed

{_vec addmagazine _x} forEach _magvec;

{_vec addweapon _x} forEach _wepvec;

Greetings,

alef

Share this post


Link to post
Share on other sites

I think setvehicleammo will work if you run the command on both clients. Either both the pilot and the gunner runs the same script or you run the command line in a trigger. I think what might have happened before is that you have run the command for only one of the two.

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  

×