From d80274187c240ed1bb4e8cb74a323a502ddd1e40 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Mon, 27 Jul 2026 02:51:21 +0200 Subject: [PATCH] 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. --- [core]/es_extended/server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 7ab5f9b4..c3b5ee05 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -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