Exports

Comprehensive instructions on configuring files and utilizing export functions.

triangle-exclamation

Pawnshop Creator Exports

The Pawnshop Creator provides several server-side exports that allow you to fully control pawnshops and their stock from other resources.

All exports are server-side.

You can use these exports from other resources with:

exports["crm-pawncreator"]:functionName(args)

🔸togglePawnshops

Enable or disable all pawnshops globally.

local state = exports['crm-pawncreator']:togglePawnshops()

Returns

  • (string)"crm-disabled" or "crm-enabled"

Example

local state = exports["crm-pawncreator"]:togglePawnshops()
if state == "crm-disabled" then
    print('All pawnshops have been disabled')
else
    print('All pawnshops have been enabled')
end

🔸addPawnshopStock

Add stock to a specific pawnshop item.

Parameters

  • crm_pawnshopid (number) – Pawnshop ID.

  • crm_itemname (string) – Item name.

  • crm_quantity (number) – Quantity to add (must be greater than 0).

Returns

  • (boolean, string) true if stock was added successfully, otherwise false and an error reason.

Example


🔸removePawnshopStock

Remove stock from a specific pawnshop item.

Parameters

  • crm_pawnshopid (number) – Pawnshop ID.

  • crm_itemname (string) – Item name.

  • crm_quantity (number) – Quantity to add (must be greater than 0).

Returns

  • (boolean, string)true if stock was removed successfully, otherwise false and an error reason.

Example


🔸getPawnshopStock

Get stock information from a pawnshop.

Parameters

  • crm_pawnshopid (number) – Pawnshop ID.

  • crm_itemname (string, optional) – Specific item name.

Returns

  • Returns item stock (number) if crm_itemname is provided.

  • Returns full stock table if crm_itemname is not provided.

  • Returns nil if pawnshop does not exist.

Example


🔸wipePawnshopStock

Wipe all stock from a specific pawnshop.

Parameters

  • crm_pawnshopid (number) – Pawnshop ID.

Returns

  • (boolean, string) – true if stock was wiped successfully, otherwise false and an error reason.

Example


🔸wipeAllPawnshopStock

Wipe stock from all pawnshops.

Parameters

  • crm_onequery (boolean) – true → Uses single optimised MySQL query (requires MySQL 5.7+). false → Updates each pawnshop individually.

Example

triangle-exclamation

Last updated