mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
/me command - Use regex to replace formatting text
Uses regex to replace strings that match `<*>` and `~*~` in the `/me` command. Regex: https://regex101.com/r/rrNMnx/1
This commit is contained in:
+1
-2
@@ -256,8 +256,7 @@ QBCore.Commands.Add('me', 'Show local message', {{name = 'message', help = 'Mess
|
||||
if #args < 1 then TriggerClientEvent('QBCore:Notify', source, Lang:t('error.missing_args2'), 'error') return end
|
||||
local ped = GetPlayerPed(source)
|
||||
local pCoords = GetEntityCoords(ped)
|
||||
local msg = table.concat(args, ' ')
|
||||
if string.match(msg, "<") then TriggerClientEvent('QBCore:Notify', source, Lang:t('error.wrong_format'), 'error') return end
|
||||
local msg = table.concat(args, ' '):gsub('[~<].-[>~]', '')
|
||||
local Players = QBCore.Functions.GetPlayers()
|
||||
for i=1, #Players do
|
||||
local Player = Players[i]
|
||||
|
||||
Reference in New Issue
Block a user