Client

Synchronous client-side decision functions located in custom/client/validate.lua. Return true to allow the action or false to block it.

CanSellNPC

Validates before opening negotiation with an NPC during drug sales.

CanSellNPC = function(zoneData, item, amount, price)
    return true
end
Parameter Type Description
zoneData table Zone configuration table or default settings
item string Item name being sold
amount number Quantity to sell
price number Total price expected
  • Returns: boolean - true to permit sale, false to cancel.

CanSellDealer

Validates before selling items to a dealer shop.

CanSellDealer = function(shopData, item, amount, price)
    return true
end
Parameter Type Description
shopData table Dealer configuration table
item string Item name being sold
amount number Quantity to sell
price number Total money expected
  • Returns: boolean - true to permit sale, false to cancel.

CanBuyDealer

Validates before purchasing items from a dealer shop.

CanBuyDealer = function(shopData, item, amount, price)
    return true
end
Parameter Type Description
shopData table Dealer configuration table
item string Item name being purchased
amount number Quantity to buy
price number Total money required
  • Returns: boolean - true to permit purchase, false to cancel.

CanStockCornerboy

Validates before depositing drugs into a corner boy inventory.

CanStockCornerboy = function(cornerboyData, item, amount)
    return true
end
Parameter Type Description
cornerboyData table Corner boy configuration table
item string Item name being stocked
amount number Quantity to stock
  • Returns: boolean - true to permit deposit, false to cancel.

CanTakeCornerboyProfit

Validates before withdrawing profits from a corner boy.

CanTakeCornerboyProfit = function(cornerboyData, amount, currency)
    return true
end
Parameter Type Description
cornerboyData table Corner boy configuration table
amount number Profit amount to withdraw
currency string Currency type (cash, black_money, etc.)
  • Returns: boolean - true to permit withdrawal, false to cancel.

CanHarvestField

Validates before starting to harvest a plant in a drug field.

CanHarvestField = function(fieldData, plantId)
    if IsPedInAnyVehicle(PlayerPedId(), false) then
        return false
    end
    return true
end
Parameter Type Description
fieldData table Field configuration table
plantId number Plant index in field
  • Returns: boolean - true to permit harvesting, false to cancel.

CanCollect

Validates before collecting materials from a collection zone.

CanCollect = function(collectData)
    return true
end
Parameter Type Description
collectData table Collection zone configuration table
  • Returns: boolean - true to permit collection, false to cancel.

CanProcess

Validates before starting processing in a laboratory zone.

CanProcess = function(processData)
    return true
end
Parameter Type Description
processData table Process zone configuration table
  • Returns: boolean - true to permit processing, false to cancel.

CanHandcraft

Validates before starting to handcraft an item.

CanHandcraft = function(craftData)
    return true
end
Parameter Type Description
craftData table Handcraft recipe table
  • Returns: boolean - true to permit crafting, false to cancel.

CanUseDrug

Validates before consuming a drug item.

CanUseDrug = function(item, drugData)
    if IsPedInAnyVehicle(PlayerPedId(), false) and drugData.usetype == 'bong' then
        Lib47.Notify('You cannot use a bong while driving!', 'error')
        return false
    end
    return true
end
Parameter Type Description
item string Item name being consumed
drugData table Drug configuration and effects table
  • Returns: boolean - true to permit drug consumption, false to cancel.