Initial commit for player keys

This commit is contained in:
VegaZ
2018-09-29 00:07:36 +02:00
parent 5ea4612873
commit 9f33cfbd89
7 changed files with 91 additions and 10 deletions

37
Client/Player/keys.js Normal file
View File

@@ -0,0 +1,37 @@
/**
* @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;
//ENTER
mp.keys.bind(0x0D, false, function () {
if (chat === true) {
chat = 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");
}
});