Jump to content
1 vote
Guests cannot vote

Add some Callbacks for trade release

  • Views: 9
  • Submitted:

Through this, I request that the developers add the following global callbacks to the LuaAPI so that we can create custom scripts that allow us to perform trades with other currencies. Currently, I am trying to perform this action with `onUseCommand`, but the way I am doing it is not very effective since I am basing everything on caching.

In practice, these callbacks fulfill 3 different roles in the trade flow:

Handshake / Lock the offer (anti-snipe / anti-swap with another)

`onTradeRequest(seller, buyer)` and/or `onTradeAccept(seller, buyer)`

Here we identify who the seller is (who opened the shop), inform the price/currency to the buyer, and lock that offer for that buyer for a few seconds.

Finalization (exact moment to charge)

onTradeConfirm(seller, buyer) and/or onTradeOk(seller, buyer)

  • This allows us to:
  • validate the buyer's balance,
  • debit the buyer,
  • credit the seller,
  • and block the trade if there is insufficient balance (returning 1).

Cancellation / Clearing

onTradeCancel(seller, buyer)
Releases locks, cancels the session, and avoids state garbage.

User Feedback

Recommended Comments

There are no comments to display.

×
×
  • Create New...

Important Information


We use technologies, such as cookies, to customize content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy.