Mission File

john

New Member
I've been trying to remove/substitute the as50,l85 aws, and the m107. Ive been following some peoples posts on here and just cant seem to get anything to work. Where I am at right now is all that are spawning at heli crashes are fn fal's and bissons.

Any other changes I make I just get stuck at the loading screen. I was wondering if anyone just had a server pbo file all ready for me to upload with custom loot tables and all. If not then I can supply a default pbo and can someone possibly show me what to edit over teamviewer?

Thanks its really bugging me, I guess im not cut out for all this lol.
 
This is mine, though it's set up for taviana so you will need to change the weapons to what you want

In your mission file make a folder called fixes and inside make a file called spawn_loot.sqf

In there paste this and change the weapons to what you want

Code:
private["_itemType","_iPos","_indexLootSpawn","_iArray","_iItem","_iClass","_item","_qty","_max","_tQty","_arrayLootSpawn","_canType","_holderItem"];
// [_itemType,_weights]
_iItem = _this select 0;
_iClass = _this select 1;
_iPos = _this select 2;
_radius = _this select 3;
_holderItem = _iItem;
switch (_iItem) do {
        case "BAF_AS50_scoped": { _holderItem = "M40A3"};
        case "M107_DZ": { _holderItem = "G36K_camo"};
        case "MR43": { _holderItem = "AK_74"};
        case "10Rnd_127x99_m107": { _holderItem = "5Rnd_762x51_M24"};
        case "FN_FAL_ANPVS4": { _holderItem = "BAF_L85A2_RIS_Holo"};
        case "revolver_EP1": { _holderItem = "revolver_gold_EP1"};
        case "AKS_74_kobra": { _holderItem = "AK_107_kobra"};
        case "BAF_L85A2_RIS_CWS": { _holderItem = "M4SPR"};
        default {};
        };
_iItem = _holderItem;
switch (_iClass) do {
default {
//Item is food, add random quantity of cans along with an item (if exists)
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_arrayLootSpawn = [] + getArray (configFile >> "cfgLoot" >> _iClass);
_itemType = _arrayLootSpawn select 0;
_weights = _arrayLootSpawn call fnc_buildWeightedArray;
_qty = 0;
_max = ceil(random 4) + 1;
//diag_log ("LOOTSPAWN: QTY: " + str(_max) + " ARRAY: " + str(_arrayLootSpawn));
while {_qty < _max} do {
private["_tQty","_indexLootSpawn","_canType"];
_tQty = floor(random 1) + 1;
//diag_log ("LOOTSPAWN: ITEM QTY: " + str(_tQty));
 
_indexLootSpawn = _weights call BIS_fnc_selectRandom;
_canType = _itemType select _indexLootSpawn;
 
_holderItem = _canType;
switch (_canType) do {
case "10Rnd_127x99_m107": { _holderItem = "5Rnd_762x51_M24"};
case "2Rnd_shotgun_74Slug": { _holderItem = "15Rnd_W1866_Slug"};
case "2Rnd_shotgun_74Pellets": { _holderItem = "8Rnd_B_Beneli_Pellets"};
default {};
};
_canType = _holderItem;
 
//diag_log ("LOOTSPAWN: ITEM: " + str(_canType));
_item addMagazineCargoGlobal [_canType,_tQty];
_qty = _qty + _tQty;
};
if (_iItem != "") then {
_item addWeaponCargoGlobal [_iItem,1];
};
};
case "weapon": {
//Item is a weapon, add it and a random quantity of magazines
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item addWeaponCargoGlobal [_iItem,1];
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
if (count _mags > 0) then {
_item addMagazineCargoGlobal [(_mags select 0),(round(random 3)+2)];
};
};
case "magazine": {
//Item is one magazine
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item addMagazineCargoGlobal [_iItem,1];
};
case "object": {
//Item is one magazine
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
};
};
if (count _iPos > 2) then {
_item setPosATL _ipos;
};

then open your init file and under progressLoadingScreen 1.0;

put this

Code:
spawn_loot = compile preprocessFileLineNumbers "fixes\spawn_loot.sqf";

That will do it, no more AS50's or M107's :D
 
The gold revolver bugs out with Taviana so ive replaced it and replaced its ammo, to the sa61

Code:
case "BAF_AS50_scoped": { _holderItem = "M40A3"};
        case "M107_DZ": { _holderItem = "G36K_camo"};
        case "MR43": { _holderItem = "AK_74"};
        case "10Rnd_127x99_m107": { _holderItem = "5Rnd_762x51_M24"};
        case "FN_FAL_ANPVS4": { _holderItem = "BAF_L85A2_RIS_Holo"};
        case "revolver_EP1": { _holderItem = "Sa61_EP1"};
        case "AKS_74_kobra": { _holderItem = "AK_107_kobra"};
        case "BAF_L85A2_RIS_CWS": { _holderItem = "M4SPR"};
        case "6Rnd_45ACP": { _holderItem = "20Rnd_B_765x17_Ball"};
 
No probs, it should definitely work as we have it on our server at present. It wont replace any As50's or banned weapons in players inventory's but will stop them spawning.
 
I followed what you had posted and loaded into the server just fine. Thank you again. Hoping it worked.
 
Yeah you can add any, all though be carefull if you have weapon detection on your server as players will loose them when they log in.

The weapon after case " is the one you want removed, holderitem= is the weapon you want to put in.
Also make sure to replace the ammo as well as you dont want weapons spawning that you cant find weapons for :D
 
Back
Top