[Help] Loot Editing in MPMissions

Ife found this script in this forum !
How can i Implement this in server ?
need to add this to server.pbo (load function in function.sqf)
or can i add this to my mpmissions ?

spawn_YankheliCrash = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log("DEBUG: Spawning a US Crash at " + str(_position));
_veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
dayzFire = [_veh,2,time,false,false];
publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spawn BIS_Effects_Burn;
};
_num = round(random 6) + 3;
//_itemType = [] + getArray (_config >> "itemType");
//_itemChance = [] + getArray (_config >> "itemChance");
_itemType = [["M14_EP1","weapon"], ["Remington870_lamp","weapon"], ["LeeEnfield","weapon"], ["huntingrifle","weapon"], ["Colt1911","weapon"], ["M9","weapon"], ["Winchester1866","weapon"], ["", "trash"], ["ItemGPS","weapon"], ["ItemCompass", "generic"], ["","medical"], ["MedBox0","object"], ["Skin_Camo1_DZ","magazine"], ["Skin_Sniper1_DZ","magazine"], ["DZ_CivilBackpack_EP1","object"], ["DZ_Backpack_EP1","object"]];
_itemChance = [0.005, 0.05, 0.005, 0.002, 0.2, 0.003, 0.03, 0.002, 0.01, 0.04, 0.01, 0.15, 0.05, 0.025, 0.01, 0.02];
//diag_log ("DW_DEBUG: _itemType: " + str(_itemType));
//_itemChance = [] + getArray (_config >> "itemChance");
//diag_log ("DW_DEBUG: _itemChance: " + str(_itemChance));
//diag_log ("DW_DEBUG: (isnil fnc_buildWeightedArray): " + str(isnil "fnc_buildWeightedArray"));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
//diag_log ("DW_DEBUG: _weights: " + str(_weights));
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
//diag_log ("DW_DEBUG: " + str(count (_itemType)) + " select " + str(_index));
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
};
 
If you use bliss, you can edit the server_functions.sqf & the server_monitor.sqf helicrashes very easily.

The code you've linked is what your looking for in the files. To add weapons, just add a new , ["your weapon","weapon"] in the _itemType line and place a chance in the _itemChance line.
 
I've never used razor's hive, but the function should be the same. Someone has copied the yankicrash line from something I posted a while ago, so make sure that you are keeping it as spawn_helicrash or whatever the default is!!!
 
Razors pack should be use a normal dayz_server.pbo :) If you like we can meet us on a ts and look for a solution or something else.
 
so i make now a test ! i add the file named spawn.sql
dayz_server/compiled/spawn.sqf
dayz_server/init/server_fucntion i make the following insert
spawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn.sqf";

i will test it tomorrow and hope it works :)
thanks xmoondockx when its not work i will call you again :D
 
ok funzt nicht server kommt nicht ausm loading :) wennst bock hast schieb mal deine ts daten rüber :D
 
dmk.4np.de
kann irgendwie keine nachrichten verschicken. sobald in in der überschrift/betreff irgendwas eintragen will passiert nicht^^
 
Back
Top