{
  "Setup SLF Vars": {
    "prefix": "SLFVARS",
    "body": [
      "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)"
    ],
    "description": ""
  },
  "Log to SLF": {
    "prefix": "Log",
    "body": "Log(\"${1:Your Log Message Here}\", ${2|4,3,2,1|})$0",
    "description": "Sets up basic Log function for use with SLF"
  },
  "Log to Discord": {
    "prefix": "DisLog",
    "body": "DisLog(\"${1:Your Error Text Here}\")$0",
    "description": "SLF Function to log error to Discord."
  },
  "Sets up a basic Citizen Thread for CFX": {
    "prefix": "thread",
    "body": [
      "Citizen.CreateThread(function()",
      "$0",
      "",
      "",
      "end)"
    ],
    "description": "Sets up a basic Citizen Thread for CFX"
  },
  "Sets up Net Event and its corresponding header": {
    "prefix": "netevent",
    "body": [
      "RegisterNetEvent(RESOURCE_CODE..\":${1:EventNameHere}\")",
      "AddEventHandler(RESOURCE_CODE..\":${2:EventNameHere}\", function(${3:args})",
      "  $0",
      "end)"
    ],
    "description": "Sets up Net Event and its corresponding header"
  },
  "Sets up command to be registered": {
    "prefix": "registercmd",
    "body": [
      "RegisterCommand(string.lower(RESOURCE_CODE)..\"${1:COMMANDNAMEHERE}\", function(source, args) ",
      "  $0",
      "end, false)"
    ],
    "description": "Sets up command to be registered"
  },
  "Server Side SLF Function": {
    "prefix": "slfserver",
    "body": [
      "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:LogToServer(RESOURCE_CODE, logLevel, value)",
      "  end",
      "end"
    ],
    "description": "Server Side SLF Function"
  },
  "Client Side SLF Function": {
    "prefix": "slfclient",
    "body": [
      "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"
    ],
    "description": "Client Side SLF Function"
  },
  "Sets up TriggerClientEvent": {
    "prefix": "tce",
    "body": [
      "TriggerClientEvent(RESOURCE_CODE..\":${1:EventNameHere}\", ${2:targetId}, ${3:args})$0"
    ],
    "description": "Sets up TriggerClientEvent"
  },
  "Sets up TriggerEvent": {
    "prefix": "te",
    "body": [
      "TriggerEvent(RESOURCE_CODE..\":${1:EventNameHere}\", ${2:args})$0"
    ],
    "description": "Sets up TriggerEvent"
  },
  "Sets up TriggerServerEvent": {
    "prefix": "tse",
    "body": [
      "TriggerServerEvent(RESOURCE_CODE..\":${1:EventNameHere}\", ${2:args})$0"
    ],
    "description": "Sets up TriggerServerEvent"
  },
  "Sets up trigger for CSTMI invite": {
    "prefix": "cstmi",
    "body": [
      "TriggerClientEvent(\"CSTMI:StartInvite_cl\", ${1:targetId}, ${2:(Invite code... MUST HAVE RESOURCE IDENTIFIER)})$0"
    ],
    "description": "Sets up trigger for CSTMI invite"
  },
  "While True Do": {
    "prefix": "wtd",
    "body": [
      "while true do",
      "  $0",
      "  Wait(${1:1})",
      "end"
    ],
    "description": "While True Do"
  },
  "Look up SID by UUID": {
    "prefix": "sidconvert",
    "body": [
      "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"
    ],
    "description": "Look up SID by UUID"
  },
  "Discord Rich Presence Call": {
    "prefix": "drpset",
    "body": [
      "local drp = {",
      "  logo = '$1'",
      "  hovText = \"$2\"",
      "  description = \"$3\"",
      "}",
      "TriggerEvent(\"DRP:UpdateDRP\", drp)$0"
    ],
    "description": "Discord Rich Presence Call"
  },
  "Discord Rich Presence Reset": {
    "prefix": "drpclear",
    "body": [
      "TriggerEvent(\"DRP:ClearDRP\", drp)$0"
    ],
    "description": "Discord Rich Presence Reset"
  },
  "Thread Client Event Call": {
    "prefix": "tct",
    "body": [
      "TriggerClientEvent(threadID..\":${1:EventNameHere}\", ${2:targetId}, ${3:args})$0"
    ],
    "description": "Thread Client Event Call"
  },
  "Thread Server Event Call": {
    "prefix": "tst",
    "body": [
      "TriggerServerEvent(threadID..\":${1:EventNameHere}\", ${2:args})$0"
    ],
    "description": "Thread Server Event Call"
  },
  "Thread Net Register": {
    "prefix": "tnet",
    "body": [
      "RegisterNetEvent(threadID..\":${1:EventNameHere}\")",
      "AddEventHandler(threadID..\":${2:EventNameHere}\", function(${3:args})",
      "  $0",
      "end)"
    ],
    "description": "Thread Net Register"
  }
}