1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Check Pocket Items & Increase Pocket Size

Discussion in 'DarkRP Modding Questions & Help' started by Display, Nov 21, 2017.

  1. Display

    Display New Member

    Is there a way to check players pocket/inventory in DarkRP, to allow or disallow that player to buy certain items.
    I want to make it so that players can only buy a certain item if they have a permit in their inventory.

    DarkRP.createFood("Example Supplements", {
    model = "models/weapons/w_packate.mdl",
    energy = 0,
    price = 0,
    requiresCook = 0,
    category = "Testing",
    buttonColor = Color(0, 0, 0, 0),
    customCheck = function (ply) return ply:getPocketItems() == permit end,
    CustomCheckFailMsg = "This is for testing only.",

    Side question. Is there a way to increase the pocket size using entities such as a bag, suitcase or something similar? How would I go about doing this if it is possible?

    Edit: To be clear, I want the customCheck to see if I have the specific item in my inventory/pocket and then allow or disallow me to buy it.

Share This Page