Events & Exports
Server event hooks
Three public hooks fire on the server. Handle them in rm_decalv/server/events.lua; the file is open (escrow-ignored) and safe to edit.
AddEventHandler('rm_decalv:server:onDecalAdded', function(data)
-- data.source number player who placed it
-- data.type 'sticker' | 'graffiti'
-- data.fileName string
-- stickers: data.plate, data.model
-- graffiti: data.posX, data.posY, data.posZ
end)
AddEventHandler('rm_decalv:server:onDecalRemoved', function(data)
-- same payload as onDecalAdded
end)
AddEventHandler('rm_decalv:server:onRestrictedAttempt', function(data)
-- data.source number player who tried
-- data.zone string cfg.restrictedZones label
-- data.posX / posY / posZ
-- hook this into your dispatch for "someone tagging near the PD" alerts
end)Per-decal canUse
Any catalog entry (or whole block) can carry a server-side gate that runs as the final check on save. The decal still shows in the catalog, but locked:
Discord logging
Decal create/clear events route through rm_decalv/server/discord_log.lua, an open file you can rewrite entirely. Logging is off by default: set enabled = true and your webhook URL in the file's config to turn it on, and shape the embed however you like. v2-era discordLog = { enabled, webhook, sendLog } table copies are still honored.
The default logger attaches the decal's image to every create/clear embed as its thumbnail, so moderators see what was sprayed without joining. Drop the image field from the entry in discord_log.lua if you'd rather keep the logs text-only.
Last updated