-
Notifications
You must be signed in to change notification settings - Fork 0
/
binds.lua
84 lines (39 loc) · 1.1 KB
/
binds.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
local PLUGIN = PLUGIN
PLUGIN.name = "Binds"
PLUGIN.author = "LeonoJlbD"
PLUGIN.description = "A little binds for easiest gameplay."
-- Auto-walking
local keyWalk = KEY_J -- <== Just put your key here
-- Toggle third person
local keyToggle = KEY_P -- <== Just put your key here
local keyStop = {
IN_FORWARD,
IN_BACK,
IN_MOVELEFT,
IN_MOVERIGHT
}
function PLUGIN:PlayerButtonDown(client, button)
if (button == keyWalk and (!client.keyWalk or client.keyWalk <= CurTime())) then
client.moving = !client.moving
client.keyWalk = CurTime() + 0.1
end
if (CLIENT) then
if (button == keyToggle and (!client.keyToggle or client.keyToggle <= CurTime())) then
client:ConCommand("ix_togglethirdperson")
client.keyToggle = CurTime() + 0.1
end
end
end
function PLUGIN:SetupMove(client, moveData, cmdData)
if (!client.moving) then return end
if (ix.fights and client:GetFight()) then
client.moving = nil
return
end
moveData:SetForwardSpeed(moveData:GetMaxSpeed())
for _, v in pairs(keyStop) do
if (cmdData:KeyDown(v)) then
client.moving = nil
end
end
end