Preview
Exports & events
Conventions for the public API of Valencia resources.
Conventions
- Events are namespaced per resource
- Client events request; the server validates and decides
- Exports are documented with parameters and return values per release
Server authority
Anything that changes money, items, ownership or permissions is validated on the server. The pattern below is illustrative — every product documents its real events with its release.
server.lua
Illustrative
RegisterNetEvent('example:server:transfer', function(target, amount)
local source = source
amount = tonumber(amount)
if not amount or amount <= 0 or amount > 1000000 then return end
-- validate sender, recipient and balance on the server
-- before any money moves
end)