eXpouk 10 Posted July 1, 2014 Hey guys, Recently I've had some trouble when removing/adding weapons/items/magazines etc from crates using an init line. The games we play at the moment are MP and hosted on a players PC rather than a dedicated server. When I use this additemcargo ["whatever item", 5] it only adds the item for the player hosting the server and not all the connected clients. I thought I could solve this by using additemcargoGlobal ["whatever item", 5]. Now this works but the problem I have is, is that it duplicates the items for every client connected to the game. So for example, if the crates init had additemcargoGlobal ["GPS", 5] and there were 5 players, it would put 25 GPS in the crate. For balancing/realism reasons I was wondering if theres a way I can get this to work in multiplayer without it duplicating for every client? Thanks Share this post Link to post Share on other sites
Larrow 2779 Posted July 1, 2014 (edited) if ( isServer ) then { this addItemCargoGlobal ["whatever", 5]; }; So only the server globally adds stuff to the crate. Edited July 1, 2014 by Larrow Share this post Link to post Share on other sites
eXpouk 10 Posted July 1, 2014 if ( isServer ) then { addItemCargoGlobal ["whatever", 5]; }; So only the server globally adds stuff to the crate. Would this have to be ran via .sqf? Share this post Link to post Share on other sites
cuel 25 Posted July 1, 2014 Either that or a trigger with condition isServer Share this post Link to post Share on other sites
Larrow 2779 Posted July 1, 2014 Should be ok from the init, if you find stuff is missing you may need to wait until time > 0..... e.g for testing from a crates init box h = this spawn { if ( isServer ) then { waitUntil {time > 0}; clearItemCargoGlobal _this; clearMagazineCargoGlobal _this; clearWeaponCargoGlobal _this; _this addItemCargoGlobal [uniform player, 5]; }; }; Will clear the crates contents and add five uniforms of the type the host is wearing to the crate (notice i said host and will not be dedicated friendly) for testing only. Share this post Link to post Share on other sites
eXpouk 10 Posted July 2, 2014 Will test it today. Thanks for your help! Share this post Link to post Share on other sites