Check login and spawned on keybind use
This commit is contained in:
@@ -257,6 +257,14 @@ function getPlayerKeyBindForKey(client, key) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function playerUsedKeyBind(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})`);
|
console.log(`[Asshat.KeyBind] ${getClientDisplayForConsole(client)} used keybind ${sdl.getKeyName(key)} (${key})`);
|
||||||
if(doesPlayerHaveKeyBindForKey(client, key)) {
|
if(doesPlayerHaveKeyBindForKey(client, key)) {
|
||||||
let keyBindData = getPlayerKeyBindForKey(client, key);
|
let keyBindData = getPlayerKeyBindForKey(client, key);
|
||||||
@@ -303,4 +311,6 @@ function getKeyIdFromParams(params) {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
Reference in New Issue
Block a user