mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
993 B
993 B
Client -> Server callback
lib.callback
The response is handled in a separate coroutine.
lib.callback(name, delay, cb, ...)
- name:
string - delay:
numberorfalse - cb:
function - ...:
any
lib.callback('ox_inventory:getItemCount', false, function(count)
print(count)
end, 'water', {type = 'fresh'})
lib.callback.await
The current coroutine is yielded until a response is received.
lib.callback.await(name, delay, ...)
- name:
string - delay:
numberorfalse - ...:
any
local count = lib.callback.await('ox_inventory:getItemCount', false, 'water', {type = 'fresh'})
print(count)
Server -> Client callback
lib.callback.register
lib.callback.register(name, cb)
- name:
string - cb:
function
lib.callback.register('ox:getNearbyVehicles', function(radius)
local nearbyVehicles = lib.getNearbyVehicles(GetEntityCoords(cache.ped), radius, true)
return nearbyVehicles
end