Skip to content

Commit

Permalink
refactor(): adding ESX Prefix
Browse files Browse the repository at this point in the history
* adding prefix where it rejects players connection
  • Loading branch information
Benzo00 committed Jan 2, 2023
1 parent 17f96a7 commit d7414a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions [esx]/es_extended/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ if not Config.Multichar then
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
deferrals.done(
('There was an error loading your character!\nError code: identifier-active\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same account.\n\nYour identifier: %s'):format(
('[ESX] There was an error loading your character!\nError code: identifier-active\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same account.\n\nYour identifier: %s'):format(
identifier))
else
deferrals.done()
end
else
deferrals.done(
'There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
'[ESX] There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end)
end
Expand All @@ -133,9 +133,9 @@ function loadESXPlayer(identifier, playerId, isNew)
end
local index = #userData.accounts + 1
userData.accounts[index] = {
name = account,
name = account,
money = foundAccounts[account] or Config.StartingAccountMoney[account] or 0,
label = data.label,
label = data.label,
round = data.round,
index = index
}
Expand Down Expand Up @@ -299,13 +299,13 @@ function loadESXPlayer(identifier, playerId, isNew)

xPlayer.triggerEvent('esx:playerLoaded',
{
accounts = xPlayer.getAccounts(),
coords = xPlayer.getCoords(),
identifier = xPlayer.getIdentifier(),
accounts = xPlayer.getAccounts(),
coords = xPlayer.getCoords(),
identifier = xPlayer.getIdentifier(),
inventory = xPlayer.getInventory(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
maxWeight = xPlayer.getMaxWeight(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
maxWeight = xPlayer.getMaxWeight(),
money = xPlayer.getMoney(),
sex = xPlayer.get("sex") or "m",
firstName = xPlayer.get("firstName") or "John",
Expand Down
6 changes: 3 additions & 3 deletions [esx_addons]/esx_allowlist/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
local identifier = ESX.GetIdentifier(playerId)

if ESX.Table.SizeOf(AllowList) == 0 then
kickReason = TranslateCap('allowlist_empty')
kickReason = "[ESX] " .. TranslateCap('allowlist_empty')
elseif not identifier then
kickReason = TranslateCap('license_missing')
kickReason = "[ESX] " .. TranslateCap('license_missing')
elseif not AllowList[identifier] then
kickReason = TranslateCap('not_allowlist')
kickReason = "[ESX] " .. TranslateCap('not_allowlist')
end

if kickReason then
Expand Down

0 comments on commit d7414a3

Please sign in to comment.