onSocietyWithdrawal
Last updated
Last updated
exports['sd-shops']:registerServerHook('onSocietyWithdrawal', function(data)
-- Log withdrawal
print(('[FINANCE] %s withdrew $%d from %s (Balance: $%d -> $%d)'):format(
data.withdrawnBy, data.amount, data.shopName,
data.previousBalance, data.newBalance
))
-- Send Discord notification
exports['your-logging']:Log('society-withdrawal', {
shop = data.shopName,
amount = data.amount,
method = data.withdrawalMethod,
withdrawnBy = data.withdrawnBy,
newBalance = data.newBalance
})
-- Alert for large withdrawals
if data.amount >= 50000 then
exports['your-logging']:Log('large-withdrawal-alert', {
shop = data.shopName,
amount = data.amount,
withdrawnBy = data.withdrawnBy,
identifier = data.withdrawnByIdentifier
})
end
end)