This commit is contained in:
2021-04-07 01:51:15 +02:00
parent e4d6ebb1f2
commit 4ef97cff7c
5 changed files with 16 additions and 9 deletions

View File

@@ -6,7 +6,8 @@
//https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes
const player = mp.players.local;
import { Key } from '../game';
import BetterBindings from 'ragemp-better-bindings';
export default function keys(globalData: IGlobalData) {
var showGui = true;
@@ -140,12 +141,10 @@ export default function keys(globalData: IGlobalData) {
mp.gui.takeScreenshot(new Date().toLocaleDateString(), 1, 100, 80);
});
setInterval(() => {
if (mp.keys.isDown(17) && mp.keys.isDown(72)) { //CTRL + H
mp.events.call("keyPress:ControllH"); //hup
return;
}
}, 100);
BetterBindings.bind('ctrl + g', () => {
mp.events.call("keyPress:ControllH"); //hup
return;
});
//F2 //Noclip
mp.keys.bind(0x71, false, () => {

View File

@@ -2879,6 +2879,11 @@
"integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
"dev": true
},
"ragemp-better-bindings": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/ragemp-better-bindings/-/ragemp-better-bindings-1.0.4.tgz",
"integrity": "sha512-mev0UT74EmBen1rdg8FP9bKFsxUtDH56X2SM2JQQsWWzCzVvRP0HIt1Wqn1DuomszgSt/uzxZaufwCFbeOU+/Q=="
},
"randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",

View File

@@ -22,5 +22,8 @@
"ProjectOpened": [
"watch"
]
},
"dependencies": {
"ragemp-better-bindings": "^1.0.4"
}
}

View File

@@ -106,7 +106,7 @@ namespace ReallifeGamemode.Server.Commands
[Command("hup")]
public void CmdAnim(Player player)
{
if (player.HasAnimation("hup")) { player.ClearAnimation(); }
if (player.HasAnimation("hup")) { player.ClearAnimation(); return; }
if (player.HasAnimation())
return;

View File

@@ -969,7 +969,7 @@ namespace ReallifeGamemode.Server.Events
[RemoteEvent("keyPress:ControllH")]
public void KeyPressControllH(Player player)
{
if (player.HasAnimation("hup")) { player.ClearAnimation(); }
if (player.HasAnimation("hup")) { player.ClearAnimation(); return; }
if (player.HasAnimation())
return;