Merge Args in command

added so you can merge the args for reports command and other functions when you are sending a message with spaces. Needs to be the last args and validate set to false. / Fores
This commit is contained in:
Fores
2023-04-02 23:00:14 +02:00
committed by GitHub
parent fca0756c65
commit 2eac900202
+8
View File
@@ -100,6 +100,14 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
end
elseif v.type == 'any' then
newArgs[v.name] = args[k]
elseif v.type == 'merge' then
local lenght = 0
for i = 1, k-1 do
lenght = lenght + string.len(args[i]) +1
end
local merge = table.concat(args, " ")
newArgs[v.name] = string.sub(merge, lenght)
end
end