Quasar Store Logo

Transaction veto API

Cancel housing transactions before the system removes money or changes ownership.

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

ActionDescription
sell_bankSell house to bank
list_player_salePut house for sale
buy_from_playerBuy a house from another player
transferTransfer house for free





ctx data

FieldDescription
ctx.actionCurrent action
ctx.houseHouse 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