Get Penal Codes
Retrieve the community penal code configuration.
Example Request
-- luarocks install sonoran.lua
-- For SonoranCADFiveM in-game usage, see the SonoranCADFiveM tab for the export-based client.
local Sonoran = require("sonoran")
local sonoran = Sonoran.createClient({
product = Sonoran.productEnums.CAD,
communityId = "YOUR_COMMUNITY_ID",
apiKey = "YOUR_API_KEY",
defaultServerId = 1
})
local response = sonoran.cad:getPenalCodesV2()
if response.success then
print(("Found %d penal codes"):format(#response.data))
else
print(response.reason)
endlocal cad = exports["sonorancad"]:getCadClient()
local response = cad:getPenalCodesV2()
if response.success then
print(("Found %d penal codes"):format(#response.data))
else
print(response.reason)
end(async () => {
const cad = exports["sonorancad"].getCadClient();
const response = await cad.getPenalCodesV2();
if (response.success) {
console.log(response.data);
} else {
console.error(response.reason);
}
})();Response
Last updated
Was this helpful?

