fix(es_extended/server/functions): drop leading space from merge command arguments

The merge argument type computes the length of the preceding arguments plus
their separators, then passes that value straight to string.sub. Lua strings
are 1-indexed, so the merged text actually starts one character later and the
separating space ends up at the front of the value.

Tested with a command whose merge argument sits at position 1, 2 and 3:
positions 2 and 3 returned " def ghi" and " ccc ddd", now they return
"def ghi" and "ccc ddd". Position 1 is unaffected because string.sub clamps
index 0 to 1.
This commit is contained in:
Selt
2026-07-27 02:51:21 +02:00
parent ca597cf6f4
commit d80274187c
+1 -1
View File
@@ -136,7 +136,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
end
local merge = table.concat(args, " ")
newArgs[v.name] = string.sub(merge, length)
newArgs[v.name] = string.sub(merge, length + 1)
elseif v.type == "coordinate" then
local coord = tonumber(args[k]:match("(-?%d+%.?%d*)"))
if not coord then