sv_utils.lua
Framework = "qb"
local Core
if GetResourceState("qbx_core") == "started" or Config.framework == "qbx" then
Framework = "qbx"
Core = exports.qbx_core
lib.print.info("Detected Framework: QBOX")
elseif GetResourceState("es_extended") == "started" or Config.framework == "esx" then
Framework = "esx"
Core = ESX
lib.print.info("Detected Framework: ESX")
elseif GetResourceState("qb-core") == "started" or Config.framework == "qb" then
Framework = "qb"
Core = exports['qb-core']:GetCoreObject()
lib.print.info("Detected Framework: QB")
else
Framework = Config.framework
end
function GetPlayerFullName(playerId)
if Framework == "qb" then
local Player = Core.Functions.GetPlayer(playerId)
local fullname = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
return fullname
elseif Framework == "esx" then
local xPlayer = Core.GetPlayerFromId(playerId)
local fullname = xPlayer.getName()
return fullname
elseif Framework == "qbx" then
local Player = Core:GetPlayer(playerId)
local fullname = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
return fullname
else
--Custom Framework here
return "Unknown"
end
end
Last updated