Updated private messages to ESX 1.2

This commit is contained in:
Lincon
2020-09-29 02:18:07 +02:00
committed by GitHub
parent 83914926b2
commit ac2193dc0a
+15
View File
@@ -44,6 +44,21 @@ RegisterCommand('do', function(playerId, args, rawCommand)
end
end, false)
RegisterCommand('msg', function(source, args, user)
if GetPlayerName(tonumber(args[1])) then
local player = tonumber(args[1])
table.remove(args, 1)
TriggerClientEvent('chat:addMessage', player, {args = {"^1MSG de "..GetPlayerName(source).. "[" .. source .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}})
TriggerClientEvent('chat:addMessage', source, {args = {"^1MSG enviado a "..GetPlayerName(player).. "[" .. player .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}})
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "ID de jugador incorrecta!")
end
end,false)
function GetRealPlayerName(playerId)
local xPlayer = ESX.GetPlayerFromId(playerId)