Shared Functions
This page will explain all exported functions from the SonoranCAD Core that can be used on the client and server side
isPluginLoaded
exports.sonorancad.isPluginLoaded(submoduleName)Parameter
Type
Description
Type
Description
submodules = { "callcommands", "dispatchnotify", "civintegration" }
local isLoaded = isPluginLoaded("dispatchnotify")
print(isLoaded) -- Output: true
local isLoaded2 = isPluginLoaded("vehreg")
print(isLoaded2) -- Output: falseshallowcopy
exports.sonorancad.shallowcopy(data)Parameter
Type
Description
Type
Description
-- Example 1: Shallow copying a table
local original = { a = 1, b = 2, c = { 3, 4 } }
local copy = exports.sonorancad.shallowcopy(original)
print(copy.a) -- Output: 1
print(copy.b) -- Output: 2
print(copy.c) -- Output: table: 0x... (same reference as original.c in shallow copy)
-- Example 2: Copying a non-table value
local value = 42
local valueCopy = exports.sonorancad.shallowcopy(value)
print(valueCopy) -- Output: 42
stringsplit
exports.sonorancad.stringsplit(inputstr, sep)Parameter
Type
Description
Type
Description
local result = exports.sonorancad.stringsplit("Hello,World,Lua", ",")
-- result = { "Hello", "World", "Lua" }
local result2 = exports.sonorancad.stringsplit("One Two Three")
-- result2 = { "One", "Two", "Three" } (uses default separator: whitespace)
findIndex
Parameter
Type
Description
Type
Description
GetIdentifiers
Parameter
Type
Description
Type
Description
PerformHttpRequestS
Parameter
Type
Description
Type
Description
has_value
Parameter
Type
Description
Type
Description
compareVersions
Parameter
Type
Description
Type
Description
Last updated
Was this helpful?

