FindEvent

Search events by name with exact or substring matching.

Syntax

Susano.FindEvent(needle[, exact]) -> { { resource = "<string>", event = "<string>" }, ... }

Parameters

needle (string): Text to match against the event name.

exact (boolean, optional): true for exact match, false for substring. Default: false.

Return(s)

results (array of tables): Matches as { resource = string, event = string }.

Behavior

Substring search is case-sensitive.

Exact match compares full strings, case-sensitive.

Scans all known events; complexity O(n).

No deduplication; multiple identical events may appear from different resources.

Example(s)

-- substring search
for _, ev in ipairs(Susano.FindEvent("esx_")) do
  print(ev.resource, ev.event)
end

-- exact match
local hits = Susano.FindEvent("esx_policejob:handcuff", true)
if #hits == 0 then
  print("no exact match")
else
  for _, ev in ipairs(hits) do
    print("match:", ev.resource, ev.event)
  end
end

Last updated