Files
reallife-gamemode/Client/Player/keys.js
2018-10-27 12:53:19 +02:00

58 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @overview Life of German Reallife - Player Keys keys.js
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
//https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes
var chat = false;
var showInventory = false;
//ENTER
mp.keys.bind(0x0D, false, function () {
if (chat === true) {
chat = false;
}
});
//I
mp.keys.bind(0x49, false, function () {
if (!chat) {
mp.events.callRemote("keyPress:I");
//mp.events.call("showPlayerlist");
}
});
//J
mp.keys.bind(0x4A, false, function () {
if (showInventory === false) {
mp.events.call("showInventory", true);
showInventory = true;
} else {
mp.events.call("showInventory", false);
showInventory = false;
}
});
//N
mp.keys.bind(0x4E, false, function () {
if (!chat) {
mp.events.callRemote("keyPress:N");
}
});
//T
mp.keys.bind(0x54, false, function () {
if (chat === false) {
chat = true;
}
});
//X
mp.keys.bind(0x58, false, function () {
if (!chat) {
mp.events.callRemote("keyPress:X");
}
});