localstate=exports["crm-pawncreator"]:togglePawnshops()ifstate=="crm-disabled" thenprint('All pawnshops have been disabled')elseprint('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
This action affects all pawnshops. Use with caution.