AMXX-BG.INFO kreedz_api.inc Raw include

kreedz_api.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _kreedz_api_included
2 #endinput
3 #endif
4
5 #define _kreedz_api_included
6
7 #define CHAT_PREFIX "^1[^4KreedZ^1] "
8
9 enum _:KZReturn {
10 KZ_CONTINUE = 0,
11 KZ_SUPERCEDE,
12 };
13
14 enum TimerState {
15 TIMER_DISABLED,
16 TIMER_PAUSED,
17 TIMER_ENABLED,
18 };
19
20 enum _:PosStruct {
21 Float:pos_x,
22 Float:pos_y,
23 Float:pos_z,
24 };
25
26 enum _:RunStruct {
27 Float:run_time,
28 run_cpCount,
29 run_tpCount,
30 run_weapon,
31 run_airaccelerate,
32 };
33
34 enum _: {
35 CHANNEL_HUD = 2,
36 };
37
38 enum _:AirAccelerateEnum {
39 AIR_ACCELERATE_10 = 0,
40 AIR_ACCELERATE_100 = 1,
41 };
42
43 enum _:WeaponsEnum {
44 WPN_AWP = 0,
45 WPN_M249 = 1,
46 WPN_M4A1 = 2,
47 WPN_SG552 = 3,
48 WPN_FAMAS = 4,
49 WPN_P90 = 5,
50 WPN_USP = 6,
51 WPN_SCOUT = 7,
52 };
53
54 enum _:JumpStatsOptionFlags {
55 flagHasColorChat = (1 << 0), // a
56 flagLjStats = (1 << 1), // b
57 flagShowSpeed = (1 << 2), // c
58 flagShowPre = (1 << 3), // d
59 flagStrafeStats = (1 << 4), // e
60 flagBeam = (1 << 5), // f
61 flagStatsPre = (1 << 6), // g
62 flagFailEarly = (1 << 7), // h
63 flagMultiBhopPre = (1 << 8), // i
64 flagShowDuck = (1 << 9), // j
65 flagLjPre = (1 << 10), // k
66 flagShowEdge = (1 << 11), // l
67 flagShowEdgeFail = (1 << 12), // m
68 flagEnableSounds = (1 << 13), // n
69 flagIngameStrafes = (1 << 14), // o
70 flagJumpOff = (1 << 15),
71 flagJumpHeight = (1 << 16),
72 };
73
74 //
75 // Core section
76 //
77
78 forward kz_timer_start_pre(id);
79
80 forward kz_timer_start_post(id);
81
82 forward kz_timer_pause_pre(id);
83
84 forward kz_timer_pause_post(id);
85
86 forward kz_timer_finish_pre(id, runInfo[RunStruct]);
87
88 forward kz_timer_finish_post(id, runInfo[RunStruct]);
89
90 forward kz_timer_stop_pre(id);
91
92 forward kz_timer_stop_post(id);
93
94 forward kz_cp_pre(id);
95
96 forward kz_cp_post(id);
97
98 forward kz_tp_pre(id);
99
100 forward kz_tp_post(id);
101
102 forward kz_starttp_pre(id);
103
104 forward kz_starttp_post(id);
105
106
107 native TimerState:kz_get_timer_state(id);
108
109 native kz_start_timer(id);
110 native kz_end_timer(id);
111
112 native kz_set_pause(id);
113
114 native kz_tp_last_pos(id);
115
116 native kz_get_cp_num(id);
117 native kz_set_cp_num(id, value);
118
119 native kz_get_tp_num(id);
120 native kz_set_tp_num(id, value);
121
122 native kz_get_last_pos(id, value[PosStruct]);
123 native kz_set_last_pos(id, value[PosStruct]);
124
125 native kz_get_last_vel(id, value[PosStruct]);
126 native kz_set_last_vel(id, value[PosStruct]);
127
128 native kz_get_last_cp(id, value[PosStruct]);
129 native kz_set_last_cp(id, value[PosStruct]);
130
131 native Float:kz_get_actual_time(id);
132 native kz_set_start_time(id, Float:value);
133
134 /**
135 * Checks is player has start position
136 *
137 * @param id
138 *
139 * @return bool
140 */
141 native bool:kz_has_start_pos(id);
142
143 //
144 // Hook & noclip section
145 //
146
147 forward kz_noclip_pre(id);
148
149 forward kz_noclip_post(id);
150
151 forward kz_hook_pre(id);
152
153 forward kz_hook_post(id);
154
155 native kz_in_hook(id);
156 native kz_in_noclip(id);
157
158 //
159 // Spec section
160 //
161
162 forward kz_spectator_pre(id);
163
164 forward kz_spectator_post(id);
165
166 //
167 // Weapons section
168 //
169
170 native kz_get_min_rank(id);
171
172 native kz_set_min_rank(id, value);
173
174 native kz_get_weapon_name(iRank, szWeapon[], iLen);
175
176 native kz_get_usp(id);
177
178 //
179 // Records section
180 //
181
182 /**
183 * Checks is map has pro record
184 *
185 * @param aa check AirAccelerateEnum constants
186 *
187 * @return true if record exists, false otherwise
188 */
189 native bool:kz_has_map_pro_rec(aa = AIR_ACCELERATE_10);
190
191 stock CPC(const pPlayer, iColor, const szInputMessage[], any:...)
192 {
193 static szMessage[191];
194 new iLen = formatex(szMessage, charsmax(szMessage), "%s ", CHAT_PREFIX);
195 vformat(szMessage[iLen], charsmax(szMessage) - iLen, szInputMessage, 3);
196
197 client_print_color(pPlayer, iColor, szMessage);
198 }