From 206f7e691e5e2f688e9a42cb1f0de792acb3811c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 26 Jul 2022 01:01:42 -0500 Subject: [PATCH] Add duration arg to used keybind handler --- scripts/server/keybind.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index 011da3a8..2bf1e412 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -200,7 +200,7 @@ function getPlayerKeyBindForKey(client, key) { // =========================================================================== -function playerUsedKeyBind(client, key) { +function playerUsedKeyBind(client, key, duration = 0) { if (!isPlayerLoggedIn(client)) { return false; } @@ -219,7 +219,9 @@ function playerUsedKeyBind(client, key) { if (splitCommandString.length > 1) { tempParams = splitCommandString.slice(1).join(" "); } + getPlayerData(client).keyBindDuration = duration; getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client); + getPlayerData(client).keyBindDuration = 0; //triggerEvent("OnPlayerCommand", null, tempCommand, tempParams, client); } }