mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(server): attempt to index a nil value (local 'xPlayer')
This commit is contained in:
@@ -302,7 +302,7 @@ end
|
||||
|
||||
AddEventHandler("chatMessage", function(playerId, _, message)
|
||||
local xPlayer = ESX.GetPlayerFromId(playerId)
|
||||
if message:sub(1, 1) == "/" and playerId > 0 then
|
||||
if xPlayer and message:sub(1, 1) == "/" and playerId > 0 then
|
||||
CancelEvent()
|
||||
local commandName = message:sub(1):gmatch("%w+")()
|
||||
xPlayer.showNotification(TranslateCap("commanderror_invalidcommand", commandName))
|
||||
|
||||
Reference in New Issue
Block a user