From ac2193dc0a8020371202b88d374f85f6217842d5 Mon Sep 17 00:00:00 2001 From: Lincon <59184093+ItsLincon@users.noreply.github.com> Date: Tue, 29 Sep 2020 02:18:07 +0200 Subject: [PATCH 1/2] Updated private messages to ESX 1.2 --- server/main.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/main.lua b/server/main.lua index 6671e76d..21236cc1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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) From 26c229b20783c5622df3a7298acba674c9bd36d8 Mon Sep 17 00:00:00 2001 From: Lincon <59184093+ItsLincon@users.noreply.github.com> Date: Tue, 29 Sep 2020 02:38:44 +0200 Subject: [PATCH 2/2] Added english lang to pm --- server/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 21236cc1..cbb88722 100644 --- a/server/main.lua +++ b/server/main.lua @@ -50,9 +50,10 @@ RegisterCommand('msg', function(source, args, user) 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}}) - + ESP --TriggerClientEvent('chat:addMessage', player, {args = {"^1MSG de "..GetPlayerName(source).. "[" .. source .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) + ESP --TriggerClientEvent('chat:addMessage', source, {args = {"^1MSG enviado a "..GetPlayerName(player).. "[" .. player .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) + ENG TriggerClientEvent('chat:addMessage', player, {args = {"^1PM from "..GetPlayerName(source).. "[" .. source .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) + ENG TriggerClientEvent('chat:addMessage', source, {args = {"^1PM SEND TO "..GetPlayerName(player).. "[" .. player .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) else TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "ID de jugador incorrecta!") end