-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
rankme.inc
209 lines (192 loc) · 5.3 KB
/
rankme.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#if defined _rankme_included
#endinput
#endif
#define _rankme_included
enum WEAPONS_ENUM{
KNIFE,
GLOCK,
HKP2000,
USP_SILENCER,
P250,
DEAGLE,
ELITE,
FIVESEVEN,
TEC9,
CZ75A,
REVOLVER,
NOVA,
XM1014,
MAG7,
SAWEDOFF,
BIZON,
MAC10,
MP9,
MP7,
UMP45,
P90,
GALILAR,
AK47,
SCAR20,
FAMAS,
M4A1,
M4A1_SILENCER,
AUG,
SSG08,
SG556,
AWP,
G3SG1,
M249,
NEGEV,
HEGRENADE,
FLASHBANG,
SMOKEGRENADE,
INFERNO,
DECOY,
TASER,
MP5SD,
BREACHCHARGE,
}
enum STATS_NAMES{
SCORE,
KILLS,
DEATHS,
ASSISTS,
SUICIDES,
TK,
SHOTS,
HITS,
HEADSHOTS,
CONNECTED,
ROUNDS_TR,
ROUNDS_CT,
C4_PLANTED,
C4_EXPLODED,
C4_DEFUSED,
CT_WIN,
TR_WIN,
HOSTAGES_RESCUED,
VIP_KILLED,
VIP_ESCAPED,
VIP_PLAYED,
MVP,
DAMAGE,
MATCH_WIN,
MATCH_DRAW,
MATCH_LOSE,
FB,
NS,
NSD
}
enum HITBOXES{
NULL_HITBOX,
HEAD,
CHEST,
STOMACH,
LEFT_ARM,
RIGHT_ARM,
LEFT_LEG,
RIGHT_LEG
}
public SharedPlugin __pl_rankme=
{
name = "rankme",
file = "kento_rankme.smx",
#if defined REQUIRE_PLUGIN
required = 1
#else
required = 0
#endif
}
typedef RankCallback = function Action(int client, int rank, any data);
public void __pl_rankme_SetNTVOptional()
{
MarkNativeAsOptional("RankMe_GivePoint");
MarkNativeAsOptional("RankMe_GetRank");
MarkNativeAsOptional("RankMe_GetPoints");
MarkNativeAsOptional("RankMe_GetStats");
MarkNativeAsOptional("RankMe_GetSession");
MarkNativeAsOptional("RankMe_GetWeaponStats");
MarkNativeAsOptional("RankMe_GetHitbox");
MarkNativeAsOptional("RankMe_IsPlayerLoaded");
}
/*********************************************************
* Give point(s) to a player on the server
*
* @param client The client index of the player to receive the points
* @param points Points to be given to the player
* @param reason The reason to be given the points
* @param printtoplayer Print the change to the player
* @param printtoall Print the change to the everyone
* @noreturn
*********************************************************/
native void RankMe_GivePoint(int client, int points, char[] reason, int printtoplayer, int printtoall);
/*********************************************************
* Get rank of a player on the server
*
* @param client The client index of the player to get the rank
* @param callback The return Callback
* @param data Any data you would like that return on the callback
* @noreturn
*********************************************************/
native void RankMe_GetRank(int client, RankCallback callback, any data = 0);
/*********************************************************
* Get the score (points) of a player on the server
*
* @param client The client index of the player to get the rank
* @param data Any data you would like that return on the callback
* @return The score of the client
*********************************************************/
native int RankMe_GetPoints(int client);
/*********************************************************
* Get stats of a player on the server
*
* @param client The client index of the player to get the stats
* @param stats_return The array that will return the data following the ENUM STATS_NAME;
* @noreturn
*********************************************************/
native void RankMe_GetStats(int client, int[] stats_return);
/*********************************************************
* Get session of a player on the server
*
* @param client The client index of the player to get the session
* @param session_return The array that will return the data following the ENUM STATS_NAME;
* @noreturn
*********************************************************/
native void RankMe_GetSession(int client,int[] session_return);
/*********************************************************
* Get weapon stats of a player on the server
*
* @param client The client index of the player to get the session
* @param session_return The array that will return the data following the ENUM WEAPONS_ENUM;
* @noreturn
*********************************************************/
native void RankMe_GetWeaponStats(int client, int[] weapons_return);
/*********************************************************
* Get hitbox stats of a player on the server
*
* @param client The client index of the player to get the session
* @param session_return The array that will return the data following the ENUM HITBOXES;
* @noreturn
*********************************************************/
native void RankMe_GetHitbox(int client, int[] hitbox_return);
/*********************************************************
* Get if player is loaded
*
* @param client Client index
* @return If the client is loaded
*********************************************************/
native void RankMe_IsPlayerLoaded(int client);
/**********************************************************************
* When a player has been loaded
* *
* @param client The client index of the player that has been loaded
* @noreturn
**********************************************************************/
forward Action RankMe_OnPlayerLoaded(int client);
/**********************************************************************
* When a player has been saved
* *
* @param client The client index of the player that has been saved
* @noreturn
**********************************************************************/
forward Action RankMe_OnPlayerSaved(int client);