Icaruk 14 Posted May 15, 2014 That's the code I want to run just one time, but the items spawned should be visible for everybody. This works for me on local, and if I create the game (I'm the server), but if I run this on a dedicated server (I'm not the server) no one can see the loot. if (isServer) then { { _mkrcolor = getmarkercolor _x; _num = [0,0,0,1,1,1,1,1,1,2] call BIS_fnc_selectRandom; _num2 = [0,0,1,1,1,1,1,1,2,2] call BIS_fnc_selectRandom; _num3 = [0,0,1,1,1,1,1,1,1,1] call BIS_fnc_selectRandom; switch (_mkrcolor) do { //civ item case "ColorGreen" : { _civ1 = ["FirstAidKit","FirstAidKit","FirstAidKit","Binocular","Rangefinder"] call BIS_fnc_selectRandom; _item1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _item1 addItemcargo [_civ1,_num]; }; //backpacks case "ColorBlue" : { _mochila = ["B_AssaultPack_mcamo","B_AssaultPack_mcamo","B_FieldPack_oucamo","B_FieldPack_oucamo"] call BIS_fnc_selectRandom; _item2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _item2 addBackpackcargo [_mochila,_num3]; }; //normal loot case "ColorBlack" : { _armaN = ["arifle_Katiba_C_F", "arifle_Katiba_C_F", "arifle_Katiba_C_ACO_F", "arifle_Katiba_GL_F"] call BIS_fnc_selectRandom; _arma1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _arma1 addweaponcargo [_armaN,_num]; }; //normal ammo case "ColorWhite" : { _ammoN = ["30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "6Rnd_45ACP_Cylinder", "6Rnd_45ACP_Cylinder"] call BIS_fnc_selectRandom; _ammo1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _ammo1 addmagazinecargo [_ammoN,_num]; }; //military loot case "ColorRed" : { _armaM = ["srifle_DMR_01_F","LMG_Zafir_F"] call BIS_fnc_selectRandom; _arma2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _arma2 addweaponcargo [_armaM,_num3]; }; //military ammo case "ColorOrange" : { _ammoM = ["10Rnd_762x51_Mag","150Rnd_762x51_Box_Tracer"] call BIS_fnc_selectRandom; _ammo2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _ammo2 addmagazinecargo [_ammoM,_num3]; }; //military optics case "ColorPink" : { _opticM = ["optic_ACO_grn","optic_Aco","optic_ACO_grn","optic_Aco","optic_Holosight","optic_Holosight","optic_MRCO","optic_Arco","optic_LRPS","optic_Nightstalker"] call BIS_fnc_selectRandom; _optic = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _optic addItemcargo [_opticM,_num3]; }; };} foreach allmapmarkers; }; Share this post Link to post Share on other sites
champ-1 40 Posted May 15, 2014 addItemcargoGlobal and so on... Share this post Link to post Share on other sites
Von Quest 1161 Posted May 15, 2014 and maybe? if ((isServer) || (isDedicated)) then {...); wiki and kylania Share this post Link to post Share on other sites
Icaruk 14 Posted May 15, 2014 addItemcargoGlobal and so on... Oh I totally forgot it >_< thanks! Share this post Link to post Share on other sites