How can I show in es_extended 1.1 the identity name instead the steamname?
Instead the “luzifer” my realname
local source = source
local xPlayerr = ESX.GetPlayerFromId(source)
local coords = xPlayerr.getCoords(true)
local _player = xPlayerr.getName()
local radius = tonumber(args[1])
if source > 0 then
if radius == nil then radius = 100.0 end
if xPlayerr.job.name == 'police' or xPlayerr.job.name == 'fib' or xPlayerr.job.name == 'lssd' or xPlayerr.job.name == 'army' then
if #args ~= 0 then
TriggerClientEvent('sperrzone:blip', -1, coords, radius)
TriggerClientEvent("notifications", -1,5, 'SPERRZONE','EINE NEUE SPERRZONE WURDE EINGERICHTET! Der Radius dieser Sperrzone beträgt ' .. args[1] .. ' Meter. Mfg: ' .. _player .. '.','#9317FF',10000)
Underneath this line;
local _player = xPlayerr.getName()
Add the following;
local result = MySQL.Sync.fetchAll('SELECT firstname, lastname FROM users WHERE identifier = @identifier', {
['@identifier'] = xPlayerr.identifier
})
if result[1] then
_player = result[1].firstname .. " " .. result[1].lastname
end
And ensure you have "@mysql-async/lib/MySQL.lua"
under server_scripts
in your fxmanifest.lua or __resource.lua file (whichever this script uses).
And how can I do that everything else is the has the identity name too?
and not working btw. it still shows the steam name
This is going to come across rude, but it’s not meant to be. It’s meant to be helpful as it will save you a lot of time, money and headaches. The code that I shared is pretty easy to understand if you know Lua, which is what FiveM primarily uses. If you don’t understand it, despite being provided with the code and simple instructions on where to add it, then don’t host a server. Everything you need is in my previous reply. Good luck! 