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.

 

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • 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.