41 lines
1.2 KiB
Lua
41 lines
1.2 KiB
Lua
--GLOBAL CONSTANTS
|
|
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
|
local LOG_LEVEL = GetResourceMetadata(GetCurrentResourceName(), "log_level", 0)
|
|
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
|
|
--LOCAL VARIABLES
|
|
|
|
|
|
|
|
--END CONFIG
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-------------------
|
|
--YOUR CODE HERE---
|
|
--HAPPY CODING!----
|
|
-------------------
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------
|
|
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
|
function Log(message, logLevel)
|
|
local line = debug.getinfo(2, "l").currentline
|
|
local name = debug.getinfo(2, "n").name
|
|
if name == "fn" then
|
|
name = "Thread"
|
|
end
|
|
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
|
if tonumber(LOG_LEVEL) >= logLevel then
|
|
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)
|
|
end
|
|
end
|
|
|
|
function GetSID(UUID)
|
|
Log("Requesting SID for UUID: "..UUID, 4)
|
|
local SID = exports.SPH:GetSID(UUID)
|
|
Log("Retreived SID: "..SID.." for UUID: "..UUID, 4)
|
|
return SID
|
|
end
|