Jump to content
Sign in to follow this  
Muzzleflash

add-Mag/Wep-Cargo with JIP

Recommended Posts

I have a problem with the addWeaponCargo and addMagazineCargo commands. I'm aware from the BIKI that the commands are local and only manual changes are transmitted over the network. I work around this by using publicVariable and event where I add the weapons and magazines on all clients and that part appears to work. To get this working with JIP I though that doing it on the server might help since the JIP get synced to what the server sees, it does not seem to work.

The JIP's only see what was initially placed in init.sqf, not seeing added or removed items. How do I make add-Weapon/Magazine-Cargo work in multiplayer?

And no... I cannot just add the weapons from the start of the mission.

Thanks

Share this post


Link to post
Share on other sites

1) setvariable + getvariable

2) setvehicleinit + processinitcommands

3) publicvariable

Pick one. ;)

Share this post


Link to post
Share on other sites

Can't remember where and when, but I once read somewhere it better to avoid setVehicleInit..

I'm still not sure how to go about this. Lets say I use option 1. It would be easy to setVariable something, at start with the content of the ammo crate, or wait I still use an ammo crate? When something get's added I could add using getVariable and setVariable. What about when something get's removed? There is no such thing as an event handler for taking stuff from a crate. Also I guess it's implied that I clear the ammo box and add again, eg. since there's no removeWeapon command.?

Regarding option 3, I thought that was what I already did. How's this supposed to work?

Just to be clear on the end result:

There is only one box shared by many players, eg. someone takes the last stinger, others should not be able to grab a stinger.

During the course of the missions items get added to crate (not with regular intervals or content).

Share this post


Link to post
Share on other sites

Or do you mean, that I add the start-up content to the ammobox. Save that to a variable on the server. Everytime someone connects (JIP), I read the current content of the ammobox (serverside). Then tell every client to clearWeaponCargo and add the stuff the server sees? Would that work? Or did you have something else (better) in mind?

----------

EDIT: oh wait that wouldn't work since this lead back to the server not seeing stuff removed problem. :(

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Just tested. No they do not. Even if it did I don't think it would help since the server apparently doesn't keep track of weapons or ammo at all, at least not with addWeaponCargo and it's magazine equivalent :(. Surely someone must have come across this problem before and know a solution.

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  

×