This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAntiJC.inc
132 lines (104 loc) · 2.61 KB
/
AntiJC.inc
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
127
128
129
130
131
132
/*
Anti jetpack cheats by Rogue 2018/3/26.
-=-=-=-=
Last updated on April 18th.
-=-=-=-
OnPlayerJetpackCheat(playerid);
-=-=-=-=
playerid = the cheater who spoofed a jetpack.
-=-=-=-=-=--=-=-=
*/
#include <a_samp>
#if defined _rAntiJC_Included
#endinput
#endif
#define _rAntiJC_Included
#if !defined FILTERSCRIPT
#if defined OnPlayerJetpackCheat
forward OnPlayerJetpackCheat(playerid);
#endif
forward AJC_SetPlayerSpecialAction(playerid, actionid);
static bool:AJC_Protection[MAX_PLAYERS char];
#if defined AJC_OnPlayerUpdate
forward AJC_OnPlayerUpdate(playerid);
#endif
#if defined AJC_OnPlayerDisconnect
forward AJC_OnPlayerDisconnect(playerid, reason);
#endif
#if defined AJC_OnPlayerSpawn
forward AJC_OnPlayerSpawn(playerid);
#endif
public AJC_SetPlayerSpecialAction(playerid, actionid)
{
if(playerid > MAX_PLAYERS || playerid < 0) return 0;
if(actionid == 2) AJC_Protection{playerid} = true;
return SetPlayerSpecialAction(playerid, actionid);
}
public OnPlayerDisconnect(playerid, reason)
{
AJC_Protection{playerid} = false;
#if defined AJC_OnPlayerDisconnect
return AJC_OnPlayerDisconnect(playerid, reason);
#else
return 1;
#endif
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerSpecialAction(playerid) == 2 && !AJC_Protection{playerid})
{
AJC_Protection{playerid} = true;
SetPlayerHealth(playerid, 0.0);
#if defined OnPlayerJetpackCheat
OnPlayerJetpackCheat(playerid);
#endif
}
#if defined AJC_OnPlayerUpdate
return AJC_OnPlayerUpdate(playerid);
#else
return 1;
#endif
}
public OnPlayerSpawn(playerid)
{
AJC_Protection{playerid} = false;
#if defined AJC_OnPlayerSpawn
return AJC_OnPlayerSpawn(playerid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerUpdate
#undef OnPlayerUpdate
#else
#define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate AJC_OnPlayerUpdate
#if defined _ALS_OnPlayerSpawn
#undef OnPlayerSpawn
#else
#define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn AJC_OnPlayerSpawn
#if defined _ALS_OnPlayerDisconnect
#undef OnPlayerDisconnect
#else
#define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect AJC_OnPlayerDisconnect
#if defined _ALS_SetPlayerSpecialAction
#undef SetPlayerSpecialAction
#else
#define _ALS_SetPlayerSpecialAction
#endif
#define SetPlayerSpecialAction AJC_SetPlayerSpecialAction
#else
stock AJC_FSetPlayerSpecialAction(playerid, actionid)
return CallRemoteFunction("AJC_SetPlayerSpecialAction", "ii", playerid, actionid);
#if defined _ALS_SetPlayerSpecialAction
#undef SetPlayerSpecialAction
#else
#define _ALS_SetPlayerSpecialAction
#endif
#define SetPlayerSpecialAction AJC_FSetPlayerSpecialAction
#endif