回调事件

客户端可以调用服务器上已注册的回调事件来传输数据

调用回调事件

基本构造:ZeroDream.Callbacks.Trigger( callbackName, callbackHandler, arg1, arg2, ... )
示例代码:

local item  = "water"
local count = 1
ZeroDream.Callbacks.Trigger("my_plugin:useItem", function(result)
    if result.success then
        ESX.ShowNotification("你喝了一瓶水")
    else
        ESX.ShowNotification(result.message)
    end
end, water, count)