Raised This Month: $57 Target: $400

[NMRiH] Backpack (v1.3.0, 2018-12-30)

Post New Thread Reply   
Thread Tools Display Modes
Join Date: Jan 2018
Plugin ID:
Plugin Version:
Plugin Category:
Plugin Game:
No More Room in Hell
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Adds portable inventory boxes to NMRiH
    Old 06-11-2018 , 02:55   [NMRiH] Backpack (v1.3.0, 2018-12-30)
    Reply With Quote #1

    This plugin for No More Room in Hell adds portable inventory boxes to the game. They function just like normal inventory boxes except they also pick up items that are dropped on top of them. Punching one will place it on your back and allow you to carry it around the level.

    Backpacks are able to store more ammo than a regular inventory box. By default backpacks store up to 4 boxes worth of ammo per slot. This means one slot holds 4 barricade boards or 40 rounds of 9mm or 80 rounds of .22.

    Backpacks are randomly coloured to help distinguish them.

    Using backpacks
    • Punch backpack to wear it
    • Press drop weapon key when fists are equipped to drop it
    • Press use on a dropped backpack to access its inventory
    • Drop items on top of the backpack to store them inside

    By default all commands require slay permission.
    • /backpack - Opens the backpack menu
    • /createbackpack [#userid|name]
      • Creates a backpack for the executing player or in front of the player(s) specified
    • /removebackpack [#userid|name]
      • Removes a backpack targeted by the executing player or worn by the specified player(s)
    • /bringbackpack [#userid|name]
      • Opens a menu for teleporting backpacks to the player. Takes backpacks from the specified player(s)

    • sm_backpack_count "1"
      • Number of backpacks to create at round start. Won't create more backpacks than there are players.
    • sm_backpack_ammo_stack_limit "4"
      • Number of ammo pickups that can be stored in each ammo slot. Use 0 for infinite.
    • sm_backpack_only_admins_can_wear "0"
      • Only allow admins to wear backpacks.
    • sm_backpack_only_admins_can_open "0"
      • Only allow admins to open backpacks.
    • sm_backpack_colorize "1"
      • Randomly colorize backpacks to help distinguish them.
    • sm_backpack_glow "1"
      • Glow dropped backpacks and add marker to compass.
    • sm_backpack_speed "0"
      • Whether players should be slowed down when carrying a backpack.
    • sm_backpack_speedfactor_norm "1.0"
      • Move speed factor when backpack is less than half full.
    • sm_backpack_speedfactor_half "0.9"
      • Move speed factor when backpack is at least half full.
    • sm_backpack_speedfactor_full "0.75"
      • Move speed factor when backpack is full.

    Thanks to
    NMRiH team
    SourceMod team
    1.3.0 - 2018-12-30
    • Added option to glow backpacks and show compass marker: sm_backpack_glow
    • Added option to slow down backpack carrier:
      • sm_backpack_speed, whether to slow down backpack carrier
      • sm_backpack_speedfactor_norm, move factor when backpack is less than half full
      • sm_backpack_speedfactor_half, move factor when backpack is more than half full
      • sm_backpack_speedfactor_full, move factor when backpack is full
    • Added support for multiple backpack types:
      • Defined in backpack.cfg
      • Each backpack type can specify its own model and sounds
      • Types can override sm_backpack_colorize and sm_backpack_only_admins_*
    • Fixed backpack blocking flare gun calling chopper -- Thanks GEEEX221
      • sm_backpack_keep_supply_drops, prevents non-empty inventory boxes from fading out when a new one is created
      • sm_backpack_supply_drop_cooldown, number of seconds players must wait between calling supply drops
    • Updated gamedata for NMRiH 1.10

    • Fixed gear items' ammo not saving correctly -- Thanks Flammable

    • More plugin control from backpack.cfg:
      • Added "itembox_model" and "ornament_model"
      • Added "backpack_sounds"
    • Added sm_backpack_colorize cvar
    • Implemented OnSupplyChancesModifyBox to cooperate with Supply Chances plugin
    • Fixed missing call to AutoExecConfig: will now load plugin.backpack.cfg

    • Per Flammable's feedback:
      • Added sm_backpack_only_admins_can_wear
      • Added sm_backpack_only_admins_can_open
      • Fixed readme showing wrong cvar name
    Attached Files
    File Type: zip nmrih-backpack-v1.3.0.zip (140.5 KB, 29 views)

    Last edited by Ryan.; 12-31-2018 at 00:32. Reason: Updated to v1.3.0
    Ryan. is offline
    Junior Member
    Join Date: Jun 2018
    Old 06-16-2018 , 14:21   Re: [NMRiH] Backpack (v1.0, 2018/06/10)
    Reply With Quote #2

    Hi, it seems like sm_backpack_ammos_per_slot is does not exist.

    Great plugins btw, especially QOL, this brings new life to nmrih

    You should realy make an option to disallow regular players to pick it up.

    Something like

    sm_allow_players_to_pick_up_backack 1


    sm_allow_platyers_to_open_backpack 1

    And thanks again for your amazing work, your plugins is awesome
    Lol, i'v found this cvar, it's actully


    Last edited by Flammable; 06-16-2018 at 15:05. Reason: PS
    Flammable is offline
    Join Date: Jan 2018
    Old 06-17-2018 , 05:46   Re: [NMRiH] Backpack (v1.1, 2018/06/17)
    Reply With Quote #3

    Thanks for the feedback, Flammable. I've updated the readme and main post so they use the actual cvar name, sm_backpack_ammo_stack_limit

    Version 1.1 is ready and it includes your suggestions: sm_backpack_only_admins_can_wear and sm_backpack_only_admins_can_open. If either one is true then non-admin players will never spawn with a backpack.
    Ryan. is offline
    Junior Member
    Join Date: Jun 2018
    Old 06-18-2018 , 03:13   Re: [NMRiH] Backpack (v1.1, 2018/06/17)
    Reply With Quote #4

    Thanks for making my suggestion out, new cvars works fine at me. btw, lifehack, if you wanna set specific backpack so noone can grab it, and other backpacks can be grabbed you can set it invulnerable using plugin ent control
    I want to ask you if you take sourcemod plugins requests.. you see, i have quite unusual nmrih server, and few plugins would improve it soo much. The thing is, we always have waves like 50 or 60 or even 90, and we always store our supplies. We play from wave 1 to wave 50, and everytime we leave server, i SAVE all our weapons and ammo, by writing it down on paper. Next time i want to play, i load up wave 50 with same exact ammo i had before, and it's all work great to me BUT.

    In order to spawn ammo i always have to.. spawn a weapon, then turn infinite ammo on, then unload it couple of times, and then drop same amount of ammo we had before ._.

    It would be soo cool, if you make plugin that allows to set specific amount of ammo in player's inventory. Such as:

    sm_setammo @me ammobox_45acp 500 (set's 500 45acp bullets in my inventory)
    sm_setammo @all ammobox_357 10 (set's everyone's 357 bullets in inventory)

    and if player have over 10 357 bullet's it removes the rest and set exactly to 10.

    Can you make it?

    ps even if it's impossible to SET ammo, GIVE specific amount already can make our lifes so much easer.
    And second plugin is just..

    "sm_set_item_inventory_box_model" "models/props/custom_box.mdl"

    I already managed to change it's model, but i had to edit server.dll, which is you know, too hard and tricky, sometimes i wish i can have smaller or bigger inventory_boxes.
    Sorry if i post it in wrong section, anyway, thanks for you amazing work, backpack plugin is awesome, and easy to edit, to meet the needs of the server. And plugin QoL, is just fire

    Last edited by Flammable; 06-18-2018 at 03:20. Reason: ps
    Flammable is offline
    Join Date: Jan 2018
    Old 06-18-2018 , 18:20   Re: [NMRiH] Backpack (v1.1, 2018/06/17)
    Reply With Quote #5

    I'm occupied with projects right now but I think both of your ideas are possible.

    The save/restore system essentially exists in QOL for its /skaterboy command. Players are respawned and all their previous loot is returned to them (including ammo). It's just a matter of writing the loot to a file and allowing it be loaded with a command. QOL doesn't save non-player entities though so all unequipped items, med-boxes and supply drops would be lost.

    The second plugin sounds trivial to implement using SDKHooks. Hook item_inventory_box's spawn and then call SetEntityModel. If you're comfortable modifying server.dll this may be a relatively simple first plugin to build.
    Ryan. is offline
    Junior Member
    Join Date: Jun 2018
    Old 06-19-2018 , 10:45   Re: [NMRiH] Backpack (v1.1, 2018/06/17)
    Reply With Quote #6

    Unfortunality I'm not sourcemod codder at all. I had alot of expirience writing plugins for simple games like doom, i'm very good at editing nmrih scripts and all, but when i said that backpack plugin is easy to edit.. I just changed both models on floor and on back, and got rid of colorizing, also changed few sounds, because my backpack is metall box.

    And that's it, i can't write even simple plugin. So I can only count on you to make requested plugins. If you are too busy, i aint telling you to drop everything and do it lol, we can live without this plugins, it's just plugins that improve our gaming expirience (our quality of life lol), and it's totally fine for me to wait till you decide that you have time for someone's request. You already improved nmrih more then anyone else.
    Flammable is offline
    New Member
    Join Date: Jun 2018
    Old 06-21-2018 , 07:58   Re: [NMRiH] Backpack (v1.2, 2018/06/20)
    Reply With Quote #7

    Hello Ryan!
    Firstly - I express the HUGE gratitude to you for your plugins, which cardinally changes the game for the better. Thank you.
    Secondly - I wanted to ask something about this (BackPack) plugin. And suggest how to improve it.
    I paid attention to the file, backpack.cfg, where I saw that every thing has its own category. I began to experiment, and I achieved that, for example, pills can be placed in the category of "weapons",or in any category, if you put the item "none". Next, I opened a file backpack.sp, in which I found several parameters, such as:
    #define ITEMBOX_MAX_SLOTS 8
    #define ITEMBOX_MAX_GEAR 4
    I modified the parameter ITEMBOX_MAX_SLOTS, put the number 20 (as many cells in the bag). The problem is that if an item (any thing, except ammo) falls into the Ammo category, its name changes: Pills to #item_pills_short. (sks to #fa_sks_short, etc.).
    Moreover, such an object, if you take it, you will get emptiness - literally.
    What do I change in the file backpack.sp to make it possible to use all the cells in the bag? This would be useful, for example, in order to create boxes with only medicines, or only weapons.
    By the way, my friend Flammable knows about my problem, and gave a link to another of your plug-in (Supply Chances), more precisely, to the phrase "The weapon and gear categories are interchangeable; weapon and medical items can appear in either. The ammo category is handled differently by the game and should be restricted to just ammo types".
    In this case, can it not be done so that the bag contains only weapons and medicines, but does not lose the number of cells (or even better so that the number of cells is adjustable).
    If there is no way to do this to me - could you update this plugin by adding this functionality? Would be very grateful.

    Last edited by GEEEX221; 06-21-2018 at 08:13.
    GEEEX221 is offline
    Junior Member
    Join Date: Jun 2018
    Old 06-21-2018 , 10:23   Re: [NMRiH] Backpack (v1.2, 2018/06/20)
    Reply With Quote #8

    Hey, Ryan, first of all your latest changes in Supply Chances work great, thank you for updating it, you can check this out how cool could it be, (first few moments in video).

    But I'v found a bug about backpacks... You see, gear and weapons is not compatible. When any firearm get's into gear selection, it will give the wrong ammo. Well, just see the video and you will understand. But maybe it was not in your plans to make it possible to store 12 weapons instead of 8. Just letting you know that this issue exist, and players are not able to use gear for firearms



    There is no such bug in Supply Chances, even if you put firearms in gear selection correct ammo will be given

    Last edited by Flammable; 06-21-2018 at 10:28.
    Flammable is offline
    Join Date: Jan 2018
    Old 06-21-2018 , 17:28   Re: [NMRiH] Backpack (v1.2.1, 2018/06/21)
    Reply With Quote #9

    Originally Posted by GEEEX221 View Post
    What do I change in the file backpack.sp to make it possible to use all the cells in the bag?
    Quite a bit would have to be changed since it essentially tries to mimic vanilla inventory boxes. It was built with the assumption that each item has a specific category it belongs to. As you've seen, the game doesn't like when ammo and weapons mix; names don't appear correctly and items become unobtainable.

    Sourcemod can make items obtainable and the names can be fixed by adding to your resources/nmrih_<language>.txt
    PHP Code:
    "weapon_ammobox_9mm_short" "9mm" // Add 9mm name for weapons category
    "item_pills_short" "Pills"       // Add pills name for ammo category 
    ITEMBOX_MAX_SLOTS and MAX_GEAR are hardcoded limits. Increasing them beyond their original value can lead to memory stomping. The backpack's inventory space could be extended beyond 20 cells using separate memory but this would lead to some difficult usability questions (UI).

    Originally Posted by Flammable View Post
    But I'v found a bug about backpacks... You see, gear and weapons is not compatible. When any firearm get's into gear selection, it will give the wrong ammo.
    Fixed in newest version. Thanks for spotting it.
    Ryan. is offline
    New Member
    Join Date: Jun 2018
    Old 06-21-2018 , 19:51   Re: [NMRiH] Backpack (v1.2.1, 2018/06/21)
    Reply With Quote #10

    Hello again, Ryan.
    As you said, I changed the name of things through this file (nmrih_russian.txt). Indeed, it corrected the incorrect name of the subject, found in the category of "ammo". But. Items remain unobtainable.
    Question. Why did not the replacement change help in the file (nmrih_russian.txt), or how to make sure that the sourcemod things happen obtainable?

    Last edited by GEEEX221; 06-21-2018 at 19:53.
    GEEEX221 is offline

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump

    All times are GMT -4. The time now is 05:48.

    Powered by vBulletin®
    Copyright ©2000 - 2019, vBulletin Solutions, Inc.
    Theme made by Freecode