Check login and spawned on keybind use

This commit is contained in:
Vortrex
2020-12-27 21:27:40 -06:00
parent c67d8ddf4c
commit 6268d02f4c

View File

@@ -257,6 +257,14 @@ function getPlayerKeyBindForKey(client, key) {
// ---------------------------------------------------------------------------
function playerUsedKeyBind(client, key) {
if(!isClientLoggedIn(client)) {
return false;
}
if(!isPlayerSpawned(client)) {
return false;
}
console.log(`[Asshat.KeyBind] ${getClientDisplayForConsole(client)} used keybind ${sdl.getKeyName(key)} (${key})`);
if(doesPlayerHaveKeyBindForKey(client, key)) {
let keyBindData = getPlayerKeyBindForKey(client, key);
@@ -303,4 +311,6 @@ function getKeyIdFromParams(params) {
return i;
}
}
}
}
// ---------------------------------------------------------------------------