Register veto#
Use this export to validate or block actions.
Export#
exports['qs-housing']:RegisterHouseTransactionVeto('my_script', function(ctx)
-- Block action
return false, 'You cannot do this.'
-- Allow action
return true
end)Remove veto#
exports['qs-housing']:UnregisterHouseTransactionVeto('my_script')Available actions#
Action | Description |
|---|---|
| Sell house to bank |
| Put house for sale |
| Buy a house from another player |
| Transfer house for free |
ctx data#
Field | Description |
|---|---|
| Current action |
| House name/key |
Extra data depends on the action.
Examples:
ctx.price
ctx.buyerSource
ctx.toIdentifier
Example#
exports['qs-housing']:RegisterHouseTransactionVeto('house_rules', function(ctx)
if ctx.action == 'transfer' then
return false, 'Transfers disabled.'
end
if ctx.action == 'list_player_sale' and ctx.price > 5000000 then
return false, 'Price too high.'
end
return true
end)Important#
qs-housing must start before your script.
ensure qs-housing
ensure your_resource


