From 7e95f75ba943329f475d00e9c68dc5c99a341eef Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 24 Dec 2020 19:37:38 -0600 Subject: [PATCH] Fix cmd str check on keybind use --- scripts/server/keybind.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index b303b5b0..359e5f64 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -211,7 +211,7 @@ function removePlayerKeyBind(client, keyId) { function doesPlayerHaveKeyBindForCommand(client, command) { let accountKeyBinds = getClientData(client).accountData.keyBinds; for(let i in accountKeyBinds) { - if(accountKeyBinds[i].command == command) { + if(toLowerCase(accountKeyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { return true; } } @@ -223,7 +223,7 @@ function doesPlayerHaveKeyBindForCommand(client, command) { function getPlayerKeyBindForCommand(client, command) { let accountKeyBinds = getClientData(client).accountData.keyBinds; for(let i in accountKeyBinds) { - if(accountKeyBinds[i].command == command) { + if(toLowerCase(accountKeyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { return accountKeyBinds[i]; } } @@ -285,7 +285,6 @@ function sendAccountKeyBindsToClient(client) { // --------------------------------------------------------------------------- function sendAccountKeyBindToClient(client, key, keyState) { - console.log(key); triggerNetworkEvent("ag.keybinds.add", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); }