Skip to content

Custom framework ​

Running a framework the bridge does not support, or a heavily modified one? Plug it in yourself: every Nayretis script will use it.

The file nay_lib/bridge/custom.lua is shipped readable, outside the Cfx escrow. It holds two tables, one for the server and one for the client, with every function the scripts need: reading the player and their job, money, items, notifications. Each function is documented in the file with its arguments and the values it must return.

Steps ​

  1. Open nay_lib/bridge/custom.lua and implement every function of the server and client tables with your framework's exports or events.

  2. In server.cfg, force the custom adapter:

    cfg
    setr nay:framework "custom"
  3. Restart the server. The file is read by every resource that uses nay_lib, so restart them all after any change.

The console confirms it on start: Bridge ready: framework=custom ....

What the bridge already does for you ​

You only have to talk to your framework. The bridge itself:

  • validates amounts and accounts (cash and bank, whole positive amounts);
  • checks the balance before removing money and the count before removing items;
  • tells the scripts when a player disconnects.

Need a hand? Open a post in #support on the Nayretis Discord.