Client

Pastikan anda sudah menambahkan modules dari rhd_guard di fxmanifest script yang ingin menggunakan fungsi ini.

Register Event

Event:Register(event, cb)
  • event: string

Example:

Event:Register("rhd_guard:client:testEvent", function(namadepan, namabelakang)
    print(("Nama saya: %s %s"):format(namadepan, namabelakang))
end)

Trigger Event

Client:

Event:Trigger(event, ...)

Server:

Event:TriggerServer(event, ...)
  • event: string or table

Example:

  1. Default trigger (hanya untuk mentrigger event yang di register menggunakan rhd_guard)

-- Client Event
Event:Trigger("rhd_guard:client:testEvent", "Goku", "Muhammad")

-- Server Event
Event:TriggerServer("rhd_guard:server:testEvent", "Goku", "Muhammad")
  1. Gunakan ini untuk mentrigger event yang di register tanpa menggunakan rhd_guard

-- Client Event
Event:Trigger({"rhd_guard:client:testEvent", true}, "Goku", "Muhammad")

-- Server Event
Event:TriggerServer({"rhd_guard:server:testEvent", true}, "Goku", "Muhammad"

Last updated