User Tools

Site Tools


arma3:missions:add-cargo-global

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

arma3:missions:add-cargo-global [2022-06-25 17:54] (current)
snakeman created initial page.
Line 1: Line 1:
 +====== ArmA 3 Add Cargo Global ======
 +
 +[[:​arma3|ArmA 3]], [[arma3:​config|Config]],​ [[arma3:​missions|Missions]],​ [[arma3:​modeling|3D Modeling]], [[arma3:​scripting|Scripting]],​ [[arma3:​terrain|Terrain]],​ [[arma3:​texturing|Texturing]],​ [[arma3:​tools|Tools]]
 +
 +Adding gunz to weapon boxes or trucks etc.
 +
 +addWeaponCargoGlobal,​ addItemCargoGlobal or other global commands cannot be run from mission.sqm init line because that is run for all clients as well (join in progress for example), you can do it but add LOCAL check to it, see below:
 +
 +<code cpp>
 +/*
 +
 +[vehicle, 10] execVM "​PMC\PMC_CUP_UniformsToCargo.sqf";​
 +
 +*/
 +private _v = _this select 0;
 +private _amount = _this select 1;
 +// if we are not local (in one machine only, in MP usually the server), we exit
 +if !(local _v) exitWith {};
 +_v addItemCargoGlobal ["​CUP_H_FR_BandanaGreen",​ _amount];
 +</​code>​
  
arma3/missions/add-cargo-global.txt ยท Last modified: 2022-06-25 17:54 by snakeman