onShopSold
Last updated
Last updated
exports['sd-shops']:registerServerHook('onShopSold', function(data)
-- Log shop sale
print(('[BUSINESS] %s sold %s for $%d refund'):format(
data.ownerName, data.shopName, data.refundAmount
))
-- Remove from business registry
exports['your-mdt']:RemoveBusiness({
businessId = data.shopId,
owner = data.ownerIdentifier,
soldDate = os.date('%Y-%m-%d %H:%M:%S', data.timestamp)
})
-- Send Discord notification
exports['your-logging']:Log('business-sold', {
shop = data.shopName,
owner = data.ownerName,
refund = data.refundAmount,
originalPrice = data.originalPurchasePrice
})
end)