diff --git a/server/main.lua b/server/main.lua index 876bbb1e..44d2917c 100644 --- a/server/main.lua +++ b/server/main.lua @@ -57,6 +57,22 @@ 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) + + 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 + +end,false) + function GetRealPlayerName(playerId) local xPlayer = ESX.GetPlayerFromId(playerId)