onProductUpdated
Last updated
Last updated
exports['sd-shops']:registerServerHook('onProductUpdated', function(data)
-- Log product update
print(('[PRODUCT] %s updated "%s" at %s'):format(
data.actorName, data.productName, data.shopName
))
-- Log price change if applicable
if data.previousPrice ~= data.newPrice then
print((' Price: $%d -> $%d'):format(data.previousPrice, data.newPrice))
end
-- Send Discord notification
exports['your-logging']:Log('product-updated', {
shop = data.shopName,
product = data.productName,
previousPrice = data.previousPrice,
newPrice = data.newPrice,
updatedBy = data.actorName
})
end)