AMXX-BG.INFO crxranks.inc Raw include

crxranks.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _crxranks_included
2 #endinput
3 #endif
4
5 #define _crxranks_included
6
7 #if !defined _crxranks_const_included
8 #include <crxranks_const>
9 #endif
10
11 /**
12 * Called when the client's level changes.
13 *
14 * @param id Client index.
15 * @param level New level.
16 * @param levelup True if the client gained a level, false if he lost one.
17 * @noreturn
18 */
19 forward crxranks_user_level_updated(id, level, bool:levelup)
20
21 /**
22 * Called right before the client receives XP.
23 *
24 * @param id Client index.
25 * @param xp Amount of XP ready to be received.
26 * @param source The XP source.
27 * @return CRXRANKS_STOP to prevent the XP from being added,
28 * CRXRANKS_CONTINUE to let the XP pass through,
29 * any integer value to modify the amount of XP that
30 * is going to be received
31 */
32 forward crxranks_user_receive_xp(id, xp, CRXRanks_XPSources:source)
33
34 /**
35 * Called right after the client's XP amount changes.
36 *
37 * @param id Client index.
38 * @param xp Amount of XP the client has after the change.
39 * @param source The XP source that caused the change.
40 * @noreturn
41 */
42 forward crxranks_user_xp_updated(id, xp, CRXRanks_XPSources:source)
43
44 /**
45 * Returns the chat prefix set in the plugin's configuration file.
46 *
47 * @param buffer Buffer to store the prefix in.
48 * @param len Maximum buffer length.
49 * @noreturn
50 */
51 native crxranks_get_chat_prefix(buffer[], len)
52
53 /**
54 * Returns the flags that clients will receive when they reach the final level.
55 *
56 * @param buffer Buffer to store the flags in.
57 * @param len Maximum buffer length.
58 * @return Flags as bit value.
59 */
60 native crxranks_get_final_flags(buffer[] = "", len = 0)
61
62 /**
63 * Returns the HUD info format set in the plugin's configuration file.
64 *
65 * @param final If true, it will get the HUD_FORMAT_FINAL settings, otherwise HUD_FORMAT if false.
66 * @param buffer Buffer to store the HUD info format in.
67 * @param len Maximum buffer length.
68 * @noreturn
69 */
70 native crxranks_get_hudinfo_format(bool:final, buffer[], len)
71
72 /**
73 * Returns the number of available levels.
74 *
75 * @return Number of available levels.
76 */
77 native crxranks_get_max_levels()
78
79 /**
80 * Searches for a rank name by a specific level number.
81 *
82 * @param level Level number.
83 * @param buffer Buffer to store the rank name in.
84 * @param len Maximum buffer length.
85 * @return 0 if the level number is out of range, 1 otherwise.
86 */
87 native crxranks_get_rank_by_level(level, buffer[], len)
88
89 /**
90 * Returns the data saving type set in the plugin's configuration file.
91 *
92 * @note You can use the constants CRXRANKS_ST_NICKNAME, CRXRANKS_ST_IP
93 * and CRXRANKS_ST_STEAMID instead of numbers.
94 *
95 * @return 0 if it's set to nickname, 1 for IP and 2 for SteamID.
96 */
97 native CRXRanks_SaveTypes:crxranks_get_save_type()
98
99 /**
100 * Returns a key value set in the [Settings] section in the plugin's configuration file.
101 *
102 * @param key Key to search for.
103 * @param value Buffer to store the value in.
104 * @param len Maximum buffer length.
105 * @return True if the key was found, false otherwise.
106 */
107 native bool:crxranks_get_setting(key[], value[], len)
108
109 /**
110 * Returns the client's HUD information.
111 *
112 * @param id Client index.
113 * @param buffer Buffer to store the HUD information in.
114 * @param len Maximum buffer length.
115 * @noreturn
116 */
117 native crxranks_get_user_hudinfo(id, buffer[], len)
118
119 /**
120 * Returns the client's current level.
121 *
122 * @param id Client index.
123 * @return Client's current level.
124 */
125 native crxranks_get_user_level(id)
126
127 /**
128 * Returns the client's next rank.
129 *
130 * @param id Client index.
131 * @param buffer Buffer to store the rank name in.
132 * @param len Maximum buffer length.
133 * @noreturn
134 */
135 native crxranks_get_user_next_rank(id, buffer[], len)
136
137 /**
138 * Returns the XP needed for the client to reach the next level.
139 *
140 * @param id Client index.
141 * @return XP needed for the client to reach the next level.
142 */
143 native crxranks_get_user_next_xp(id)
144
145 /**
146 * Returns the client's current rank.
147 *
148 * @param id Client index.
149 * @param buffer Buffer to store the rank name in.
150 * @param len Maximum buffer length.
151 * @noreturn
152 */
153 native crxranks_get_user_rank(id, buffer[], len)
154
155 /**
156 * Returns the amount of XP that the client has.
157 *
158 * @param id Client index.
159 * @return Client's current XP.
160 */
161 native crxranks_get_user_xp(id)
162
163 /**
164 * Returns the vault name set in the plugin's configuration file.
165 *
166 * @param buffer Buffer to store the vault name in.
167 * @param len Maximum buffer length.
168 * @noreturn
169 */
170 native crxranks_get_vault_name(buffer[], len)
171
172 /**
173 * Returns the VIP flags set in the plugin's configuration file.
174 *
175 * @param buffer Buffer to store the flags in.
176 * @param len Maximum buffer length.
177 * @return Flags as bit value.
178 */
179 native crxranks_get_vip_flags(buffer[] = "", len = 0)
180
181 /**
182 * Returns the amount of XP required for a specific level.
183 *
184 * @param level Level number.
185 * @return -1 if the level is out of range, XP required for that level otherwise.
186 */
187 native crxranks_get_xp_for_level(level)
188
189 /**
190 * Returns the XP reward that the client will get in a specific sitaution.
191 *
192 * @param id Client index.
193 * @param reward Reward keyword.
194 * @return XP reward that the client will get.
195 */
196 native crxranks_get_xp_reward(id, reward[])
197
198 /**
199 * Gives a specific amount of XP to the client.
200 *
201 * @note If the "reward" parameter is set, the plugin will ignore the amount set
202 * in the "amount" parameter and will attempt to give the XP set in the
203 * configuration file by the specific keyword set in the "reward" parameter.
204 *
205 * @param id Client index.
206 * @param amount XP amount.
207 * @param reward Reward keyword.
208 * @param source XP source.
209 * @return Amount of XP given.
210 */
211 native crxranks_give_user_xp(id, amount = 0, reward[] = "", CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)
212
213 /**
214 * Checks if the client has HUD information enabled.
215 *
216 * @param id Client index.
217 * @return True if he has, false otherwise.
218 */
219 native bool:crxranks_has_user_hudinfo(id)
220
221 /**
222 * Checks if the HUD info system is using DHUD messages.
223 *
224 * @return True if it is, false otherwise.
225 */
226 native bool:crxranks_is_hi_using_dhud()
227
228 /**
229 * Checks if the HUD information system is enabled.
230 *
231 * @return True if it is, false otherwise.
232 */
233 native bool:crxranks_is_hud_enabled()
234
235 /**
236 * Checks if the screen fade when a client loses a level is enabled.
237 *
238 * @return True if it is, false otherwise.
239 */
240 native bool:crxranks_is_sfdn_enabled()
241
242 /**
243 * Checks if the screen fade when a client gains a level is enabled.
244 *
245 * @return True if it is, false otherwise.
246 */
247 native bool:crxranks_is_sfup_enabled()
248
249 /**
250 * Checks if the client is on the final level.
251 *
252 * @param id Client index.
253 * @return True if he is, false otherwise.
254 */
255 native bool:crxranks_is_user_on_final(id)
256
257 /**
258 * Checks if the client is VIP according to the VIP flags set in the plugin's configuration file.
259 *
260 * @param id Client index.
261 * @return True if he is, false otherwise.
262 */
263 native bool:crxranks_is_user_vip(id)
264
265 /**
266 * Checks if the plugin is using MySQL to save/load XP.
267 *
268 * @return True if it is, false otherwise.
269 */
270 native bool:crxranks_is_using_mysql()
271
272 /**
273 * Checks if the XP notifier system is enabled.
274 *
275 * @return True if it is, false otherwise.
276 */
277 native bool:crxranks_is_xpn_enabled()
278
279 /**
280 * Checks if the XP notifier system is using DHUD messages.
281 *
282 * @return True if it is, false otherwise.
283 */
284 native bool:crxranks_is_xpn_using_dhud()
285
286 /**
287 * Sets the exact amount of XP that th client has.
288 *
289 * @param id Client index.
290 * @param amount XP amount.
291 * @param source XP source.
292 * @return Amount of XP given.
293 */
294 native crxranks_set_user_xp(id, amount, CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)
295
296 /**
297 * Checks if the plugin's option to use combined events is enabled.
298 *
299 * @return True if it is, false otherwise.
300 */
301 native bool:crxranks_using_combined_events()