Ammo Crates Fix

Discussion in 'DayZ Mod' started by BoNeHeD, Jun 19, 2013.

  1. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    I got my ammo crates to work again... Go the the server.pbo system folder and the server_cleanup.fsm and comment out the following code:

    "//Check for Ammobox" \n
    "// {" \n
    "//if(!(_x isKindOf ""WeaponHolder"")) then {" \n
    "//diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
    "//deleteVehicle _x;" \n
    "//};" \n
    "//} forEach allMissionObjects ""ReammoBox"";" \n
    "//*/" \n
    ""// \n
     
    Fox and DonProtz like this.
  2. SgtRedPhoenix

    SgtRedPhoenix New Member

    Joined:
    Jun 3, 2013
    Messages:
    22
    Likes Received:
    1
    Thanks bud :D I was working on something that was using ammo boxes.
     
  3. b4r0n

    b4r0n Member

    Joined:
    May 17, 2013
    Messages:
    89
    Likes Received:
    6
    i already tested this some days ago and it doesnt work for me.
    which ammoboxes are u guys using?
     
  4. Timmy_kirton

    Timmy_kirton Well-Known Member

    Joined:
    Apr 3, 2013
    Messages:
    151
    Likes Received:
    8
    did you do change any other files?
     
  5. b4r0n

    b4r0n Member

    Joined:
    May 17, 2013
    Messages:
    89
    Likes Received:
    6
    many script runnings. but i dont think these affect server_cleanup.
    i will try later running a vanilla 1.7.7.1 instance.

    are u importing them via deployable tables or mission?
    if your using mission, how can you spawn them with gear in it?
     
  6. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    I am using the editor to bring in the crates. Let me test this with the new update.
     
  7. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    I am using all the basic boxes in the editor. I tested this with update 1.7.7.1 and it worked.
     
  8. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    Timmy,

    No I didn't change any other files. Just the latest pbo and comment out the above code...
     
  9. b4r0n

    b4r0n Member

    Joined:
    May 17, 2013
    Messages:
    89
    Likes Received:
    6
    how do you add loot in it when using the mission way?
     
  10. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    Cur,

    If dayz.st hosting you server? Use the following tutorial to help you install the boxes:
    The database he is talking about is located on your dayz.st control panel.

    Go the the server.pbo system folder and the server_cleanup.fsm and comment out the following code:

    "//Check for Ammobox" \n
    "// {" \n
    "//if(!(_x isKindOf ""WeaponHolder"")) then {" \n
    "//diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
    "//deleteVehicle _x;" \n
    "//};" \n
    "//} forEach allMissionObjects ""ReammoBox"";" \n
    "//*/" \n
    ""// \n

    If you have further questions, just let me know...

     
  11. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
  12. Cur

    Cur Member

    Joined:
    Mar 27, 2013
    Messages:
    78
    Likes Received:
    6
    Just a heads up for people reading this

    Ammo boxes are NOT the same thing as Ammo/Weapon crates.
     
  13. ebay

    ebay OpenDayZ Guru!

    Joined:
    Jan 9, 2013
    Messages:
    828
    Likes Received:
    296
    I found in variables.sqf you can edit this line to include any ammo crates you want to add as safe objects:
    Code:
    SafeObjects = ["Land_Fire_DZ", "TentStorage", "Wire_cat1", "Sandbag1_DZ", "Hedgehog_DZ", "StashSmall", "StashMedium"];
    If you add them to that list it will prevent the server_monitor.sqf from deleting them here:
    Code:
    else { // else for object or non legit vehicle
                if (!(_class in SafeObjects )) then {  
                    _damage = 1; 
                };
    This requires a custom variables.sqf. If you don't already have one you can add it to your mission by editing your init.sqf like this:
    Code:
    call compile preprocessFileLineNumbers "variables.sqf";
    Copy variables.sqf from ArmA 2\@Dayz\Addons\dayz_code\init to the root of your mission pbo then make your changes.
     
  14. bajaboy1972

    bajaboy1972 Well-Known Member

    Joined:
    Jun 9, 2013
    Messages:
    202
    Likes Received:
    19
    Is this why crates are disappearing on my server a little bit after a fresh restart ?
     
  15. J3T

    J3T Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    292
    Likes Received:
    29


    confirmed working. Thanks :).
     
  16. bajaboy1972

    bajaboy1972 Well-Known Member

    Joined:
    Jun 9, 2013
    Messages:
    202
    Likes Received:
    19
    This works for crates but not boxes?
     
  17. J3T

    J3T Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    292
    Likes Received:
    29
    The problem we encountered now is that not every box is spawning. In our base the boxes are spawning fine, but in every other base they doesn't spawn. Anybody knows how to fix this?.
     
  18. barry egginton

    barry egginton Member

    Joined:
    Jan 30, 2013
    Messages:
    90
    Likes Received:
    1
    if we already have ammo boxes will this help to put mine in?
     
  19. BoNeHeD

    BoNeHeD Member

    Joined:
    Jun 9, 2013
    Messages:
    55
    Likes Received:
    4
    On my server. I commented out the lines in the the server.pbo system folder and the server_cleanup.fsm and I can see all the ammo and weapons crates and use them....

    "//Check for Ammobox" \n
    "// {" \n
    "//if(!(_x isKindOf ""WeaponHolder"")) then {" \n
    "//diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
    "//deleteVehicle _x;" \n
    "//};" \n
    "//} forEach allMissionObjects ""ReammoBox"";" \n
    "//*/" \n
    ""// \n
     
    barry egginton likes this.
  20. barry egginton

    barry egginton Member

    Joined:
    Jan 30, 2013
    Messages:
    90
    Likes Received:
    1
    i deleated that but my crates or boxes are'nt showing i am a total noob at this lol, at the stage were i am ready to give up or pay someone to sort it out for me, but thank you for you'r responce.
     

Share This Page