generated from ClaudiuHKS/AdvancedQuakeSounds
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmovement_unlocker.sp
126 lines (103 loc) · 2.57 KB
/
movement_unlocker.sp
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/**
* MAIN REQUIREMENTS
*/
#include <sourcemod>
#include <sdktools>
/**
* CUSTOM INFORMATION
*/
public Plugin myinfo =
{
name = "Movement Unlocker",
author = "CARAMEL® HACK",
description = "Unlocks The Game Players Movement",
version = __DATE__,
url = "https://hattrick.go.ro/",
};
/**
* GLOBAL VARIABLES
*/
static int g_nPatchSize = -1;
static int g_nPatchOffs = -1;
static int g_nPatchOrigBytes[512] = { 0, ... };
static Address g_hPatchAddr = Address_Null;
static bool g_bPatchStatus = false;
/**
* CUSTOM PUBLIC FORWARDS
*/
public void OnPluginStart()
{
OnMapStart();
}
public void OnMapStart()
{
static Handle hData = INVALID_HANDLE;
static int nIter = 0;
if
(
(
(hData = LoadGameConfigFile("movement_unlocker.games"))
!=
(INVALID_HANDLE)
)
&&
(
(g_hPatchAddr = GameConfGetAddress(hData, "WalkMoveMaxSpeed"))
!=
(Address_Null)
)
&&
(
(g_nPatchOffs = GameConfGetOffset(hData, "CappingOffset"))
!=
(-1)
)
&&
(
(g_nPatchSize = GameConfGetOffset(hData, "PatchBytes"))
!=
(-1)
)
)
{
if (!g_bPatchStatus)
{
for (nIter = 0; nIter < g_nPatchSize; nIter++)
{
g_nPatchOrigBytes[nIter] = LoadFromAddress(g_hPatchAddr + view_as<Address>(g_nPatchOffs) + view_as<Address>(nIter), NumberType_Int8);
StoreToAddress(g_hPatchAddr + view_as<Address>(g_nPatchOffs) + view_as<Address>(nIter), 0x90, NumberType_Int8);
}
g_bPatchStatus = true;
}
}
if (hData != INVALID_HANDLE)
{
CloseHandle(hData);
hData = INVALID_HANDLE;
}
}
public void OnMapEnd()
{
static int nIter = 0;
if (g_hPatchAddr != Address_Null)
{
if (g_nPatchSize != -1)
{
if (g_nPatchOffs != -1)
{
if (g_bPatchStatus)
{
for (nIter = 0; nIter < g_nPatchSize; nIter++)
{
StoreToAddress(g_hPatchAddr + view_as<Address>(g_nPatchOffs) + view_as<Address>(nIter), g_nPatchOrigBytes[nIter], NumberType_Int8);
}
g_bPatchStatus = false;
}
}
}
}
}
public void OnPluginEnd()
{
OnMapEnd();
}