Callback

This page explains how to use the callback system provided by Ambitions to communicate between client and server in a structured way.

Callbacks are a key communication mechanism between the client and server, allowing asynchronous responses and structured data handling. In Ambitions, they are implemented as a lightweight and reliable system, enabling functions to send and receive data easily across environments.

All callback-related functions are accessed via:

ABT.Callback

These functions provide a consistent and intuitive interface for registering and awaiting callback responses.

circle-info

Note: The current callback system used in Ambitions is directly adapted from ox_lib, with only naming conventions adjusted to align with Ambitions standards.


Usage Differences from ox_lib

In ox_lib, callback usage follows the pattern:

lib.callback(...)
lib.callback.register(...)
lib.callback.await(...)

In Ambitions, only the prefix has changed, along with naming convention alignment:

ABT.Callback(...)
ABT.Callback.Register(...)
ABT.Callback.Await(...)

βœ… Same structure, new prefix and PascalCase formatting.


Documentation Reference

For a complete understanding of how the callback system works, you can refer to the original ox_lib callback documentation:

πŸ‘‰ ox_lib callback client-side documentationarrow-up-right

πŸ‘‰ ox_lib callback server-side documentationarrow-up-right


This callback module may evolve in future versions of Ambitions and eventually become fully native. For now, it serves as a simple and effective way to handle asynchronous communication.

Last updated