Jump to content

new hook

Pending 1.0.17

Xacku Mapping
Xacku Mapping

Posted

       [HookMethod("GetShortNameBackpack")]
        private List<string> GetShortNameBackpack()
        {
            return config.f_BackpacksByShortname.Keys.ToList();
        }

        [HookMethod("GetHaveBackpack")]
        private bool GetHaveBackpack(BasePlayer player)
        {
            if (player != null)
            {
                if (!Instance.permission.UserHasPermission(player.UserIDString, PERM_BACKPACKSLIMIT_BYPASS))
                {
                    int backpacksAmount = 0;
                    foreach (var item in player.inventory.containerWear.itemList.Concat(player.inventory.containerBelt.itemList.Concat(player.inventory.containerMain.itemList)))
                    {
                        if (config.ContainsBackpack(item.info.shortname))
                            backpacksAmount++;

                        if (backpacksAmount >= config.GeneralSettings.MaxBackpacksAmount)
                        {
                            return true;
                        }

                    }

                    return false;
                }
            }
            return false;
        }

Please add these hooks in the next update so that we don't have to constantly add them. We're using your plugin, just tweaking it a little bit.

Also, it would be great if you added some implementations in the plugin.

Quote

• allow empty backpacks to be placed in the player's inventory, but prohibit the storage of filled backpacks. for example, this is necessary if someone implements the crafting of backpacks, like me, for example.

 

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11.1k
Customers served
Files Sold
159.7k
Total sales
Payments
3.4m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.