DirkScripts Logo

Login With FiveM

Login

πŸ“š Library
β€Ί
Modules
β€Ί

callback

Callback

ℹ️ Shared - These functions can be used server and client however take note of the direction of callbacks and regration.

Client & Server are able to callback between however you are unable to callback between clients.

lib.callback.await

ℹ️ the playerId is only present on the server side, it is not required for the client side.

Call and await for a response of a server callback

lua
-- Client
lib.callback.await(event, ...)
-- Server
lib.callback.await(event, playerId, ...)
Parameter TypeRequiredDescription
eventStringtrueServer defined event name
playerIdNumbertrueServer Only - source to send request to
cbFunctiontrueCallback function, there must be at least one defined

lib.callback (async)

Call a callback without blocking the current thread. The response is handled in the provided callback function.

lua
-- Client
lib.callback(event, cb, ...)
-- Server
lib.callback(event, playerId, cb, ...)
ParameterTypeRequiredDescription
eventstringyesEvent name of the registered callback
playerIdnumberyesServer only β€” target player source
cbfunctionyesFunction to receive the response
...anynoAdditional arguments to pass

lib.callback.register

Register a callback handler. This can be used to easily request data from a client from the server, or vice versa

lua
lib.callback.register(event, cb)
Parameter TypeRequiredDescription
eventStringtrueEvent name to be called from the server
cbFunctiontrueCallback function, should return values for the callback

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.