From 5f75f5f36f0c699ad5f5fb5d5176cdeadb52f070 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 11 Dec 2021 20:18:46 -0600 Subject: [PATCH] Add tempkey arg to add keybind func --- scripts/server/keybind.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index dd06c03c..3b2b7064 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -69,10 +69,14 @@ function removeKeyBindCommand(command, params, client) { // =========================================================================== -function addPlayerKeyBind(client, keyId, tempCommand, tempParams) { - let keyBindData = new KeyBindData(false, keyId, `${tempCommand} ${tempParams}`); +function addPlayerKeyBind(client, keys, command, params, tempKey = false) { + let keyBindData = new KeyBindData(false, keys, `${command} ${params}`); + if(tempKey == true) { + keyBindData.databaseId = -1; + } + getPlayerData(client).accountData.keyBinds.push(keyBindData); - sendAddAccountKeyBindToClient(client, keyId, KEYSTATE_UP); + sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? VRR_KEYSTATE_COMBO : VRR_KEYSTATE_UP); if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { let keyId = getPlayerKeyBindForCommand(client, "enter");