👮
Five-O M
  • Five-O M
  • 💻Client
    • Server Callbacks
    • Progress Bars
    • Keypress
    • Notifications
    • Menus
    • Blips
    • Vehicles (to-do)
    • Peds (to-do)
    • Callouts (to-do)
    • Client Callbacks (to-do)
  • 💿Server
    • Server Callbacks
    • Client Callbacks (to-do)
Powered by GitBook
On this page
  1. Server

Server Callbacks

Allows for callbacks initiated from the client used to return information to a client from the server.

RegisterServerCallback(name, func)

Registers a callback on the server-side ready to be called from a client.

  • name* (string) - uniquely identifying name of the callback

  • func* (function (source, callback, ...) ) - function to call when the callback is called. All optional arguments sent from the client will be the optional arguments of this function.

* = required arguments

Example (paired with the client-side example):

FOM.RegisterServerCallback('test', function(source, cb, s1, s2)
    print(s1 .. ' ' .. s2)
    cb('hello', 1)
end)

See Server Callbacks on the client-side for triggering a callback.

Reference: utils/sv_callback.lua

PreviousClient Callbacks (to-do)NextClient Callbacks (to-do)

Last updated 2 years ago

💿