Files
Elite-Gaming-FiveM/resources/ImperialCAD-main/utils/misc.lua
T
KingMcDonalds b283de77ee fixing k9script
2026-03-15 14:32:40 -07:00

26 lines
697 B
Lua

--[[
Imperial Export for FiveM
DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOUR DOING!
]]--
function GenerateRandomString(length)
local charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
local result = ""
for i = 1, length do
local rand = math.random(1, #charset)
result = result .. charset:sub(rand, rand)
end
return result
end
--trys to find the discord ID
function getDiscordId(src)
if src == nil then return false end
local identifiers = GetPlayerIdentifiers(src)
for _, v in pairs(identifiers) do
if string.sub(v, 1, 8) == "discord:" then
return string.gsub(v, "discord:", "")
end
end
return false
end