Jonassm
Well-Known Member
Adding smoke to carepackages
My code: (code is 5th line)
However, when starting server i get this.
12:47:41 File z\addons\dayz_server\compile\fnc_carePkgs.sqf, line 3
12:47:41 Error in expression <,"_iArray"];
(publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spaw>
12:47:41 Error position: <;
if (isServer) then {
nul=dayzFire spaw>
12:47:41 Error Missing )
Any ideas? Thanks!
My code: (code is 5th line)
Code:
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
(publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spawn BIS_Effects_Burn;]
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,7000,10,0,2000,0] call BIS_fnc_findSafePos;
_randomvehicle = ["Misc_cargo_cont_net1","Misc_cargo_cont_net2","Misc_cargo_cont_net3"] call BIS_fnc_selectRandom;
_vehicleloottype = ["Military","HeliCrash"] call BIS_fnc_selectRandom;
_veh = createVehicle [_randomvehicle,_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
if (_randomvehicle == "Misc_cargo_cont_net1") then { _num = round(random 3) + 3; };
if (_randomvehicle == "Misc_cargo_cont_net2") then { _num = round(random 6) + 4; };
if (_randomvehicle == "Misc_cargo_cont_net3") then { _num = round(random 12) + 5; };
switch (_vehicleloottype) do {
case "Military": {
_itemType = [["M9", "weapon"], ["M16A2", "weapon"], ["M16A2GL", "weapon"], ["M9SD", "weapon"], ["AK_47_M", "weapon"], ["AK_74", "weapon"], ["M4A1_Aim", "weapon"], ["AKS_74_kobra", "weapon"], ["AKS_74_U", "weapon"], ["AK_47_M", "weapon"], ["M24", "weapon"], ["M1014", "weapon"], ["DMR", "weapon"], ["M4A1", "weapon"], ["M14_EP1", "weapon"], ["UZI_EP1", "weapon"], ["Remington870_lamp", "weapon"], ["glock17_EP1", "weapon"], ["MP5A5", "weapon"], ["MP5SD", "weapon"], ["M4A3_CCO_EP1", "weapon"], ["Binocular", "weapon"], ["ItemFlashlightRed", "military"], ["ItemKnife", "military"], ["ItemGPS", "weapon"], ["ItemMap", "military"], ["DZ_Assault_Pack_EP1", "object"], ["DZ_Patrol_Pack_EP1", "object"], ["DZ_Backpack_EP1", "object"], ["", "medical"], ["", "generic"], ["", "military"], ["ItemEtool", "weapon"], ["ItemSandbag", "magazine"]];
_itemChance = [0.05, 0.05, 0.01, 0.02, 0.2, 0.15, 0.01, 0.08, 0.05, 0.05, 0.01, 0.1, 0.01, 0.02, 0.01, 0.05, 0.08, 0.1, 0.04, 0.02, 0.01, 0.06, 0.1, 0.1, 0.01, 0.05, 0.06, 0.04, 0.02, 0.1, 1.0, 2.5, 0.05, 0.02];
};
case "HeliCrash": {
_itemType = [[5Rnd_86x70_L115A1, "weapon"], [[FN_FAL, "weapon"], ["G36_C_SD_eotech", "weapon"], [M14_EP1, "weapon"], [FN_FAL_ANPVS4, "weapon"], [M107_DZ, "weapon"], ["BAF_LRR_scoped", "weapon"], ["Mk_48_DZ", "weapon"], [M249_DZ, "weapon"], [BAF_L85A2_RIS_CWS, "weapon"], [DMR, "weapon"], ["", "military"], ["", "medical"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"]];
_itemChance = [0.15, 0.02, 0.05, 0.05, 0.02, 0.01, 0.02, 0.03, 0.05, 0.01, 0.1, 1, 0.5, 0.1, 0.01, 0.1, 0.1, 0.08, 0.12];
};
};
diag_log("DEBUG: Spawning a " + str (_randomvehicle) + " at " + str(_position) + " with loot type " + str(_vehicleloottype) + " With total loot drops = " + str(_num));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
for "_x" from 1 to _num do {
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,10];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
However, when starting server i get this.
12:47:41 File z\addons\dayz_server\compile\fnc_carePkgs.sqf, line 3
12:47:41 Error in expression <,"_iArray"];
(publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spaw>
12:47:41 Error position: <;
if (isServer) then {
nul=dayzFire spaw>
12:47:41 Error Missing )
Any ideas? Thanks!