summaryrefslogtreecommitdiff
path: root/sourcemod/scripting/include/gokz/kzplayer.inc
blob: 8176d39af65a0774c22bc9c5fad2f46d30032d13 (plain)
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
/*
	GOKZ KZPlayer Methodmap Include
	
	Website: https://bitbucket.org/kztimerglobalteam/gokz
*/

#if defined _gokz_kzplayer_included_
#endinput
#endif
#define _gokz_kzplayer_included_

#include <movementapi>

#include <gokz>



methodmap KZPlayer < MovementAPIPlayer {
	
	public KZPlayer(int client) {
		return view_as<KZPlayer>(MovementAPIPlayer(client));
	}
	
	
	
	// =====[ GENERAL ]=====
	
	property bool Valid {
		public get() {
			return IsValidClient(this.ID);
		}
	}
	
	property bool InGame {
		public get() {
			return IsClientInGame(this.ID);
		}
	}
	
	property bool Authorized {
		public get() {
			return IsClientAuthorized(this.ID);
		}
	}
	
	property bool Fake {
		public get() {
			return IsFakeClient(this.ID);
		}
	}
	
	property bool Alive {
		public get() {
			return IsPlayerAlive(this.ID);
		}
	}
	
	property ObsMode ObserverMode {
		public get() {
			return GetObserverMode(this.ID);
		}
	}
	
	property int ObserverTarget {
		public get() {
			return GetObserverTarget(this.ID);
		}
	}
	
	
	
	// =====[ CORE ]=====
	#if defined _gokz_core_included_
	
	public void StartTimer(int course) {
		GOKZ_StartTimer(this.ID, course);
	}
	
	public void EndTimer(int course) {
		GOKZ_EndTimer(this.ID, course);
	}
	
	public bool StopTimer() {
		return GOKZ_StopTimer(this.ID);
	}
	
	public void TeleportToStart() {
		GOKZ_TeleportToStart(this.ID);
	}
	
	public void TeleportToSearchStart(int course) {
		GOKZ_TeleportToSearchStart(this.ID, course);
	}
	
	public void TeleportToEnd(int course) {
		GOKZ_TeleportToEnd(this.ID, course);
	}

	property StartPositionType StartPositionType {
		public get() {
			return GOKZ_GetStartPositionType(this.ID);
		}
	}
	
	public void MakeCheckpoint() {
		GOKZ_MakeCheckpoint(this.ID);
	}
	
	property bool CanMakeCheckpoint {
		public get() {
			return GOKZ_GetCanMakeCheckpoint(this.ID);
		}
	}

	public void TeleportToCheckpoint() {
		GOKZ_TeleportToCheckpoint(this.ID);
	}
	
	property bool CanTeleportToCheckpoint {
		public get() {
			return GOKZ_GetCanTeleportToCheckpoint(this.ID);
		}
	}
	
	public void PrevCheckpoint() {
		GOKZ_PrevCheckpoint(this.ID);
	}
	
	property bool CanPrevCheckpoint {
		public get() {
			return GOKZ_GetCanPrevCheckpoint(this.ID);
		}
	}
	
	public void NextCheckpoint() {
		GOKZ_NextCheckpoint(this.ID);
	}
	
	property bool CanNextCheckpoint {
		public get() {
			return GOKZ_GetCanNextCheckpoint(this.ID);
		}
	}
	
	public void UndoTeleport() {
		GOKZ_UndoTeleport(this.ID);
	}
	
	property bool CanUndoTeleport {
		public get() {
			return GOKZ_GetCanUndoTeleport(this.ID);
		}
	}
	
	public void Pause() {
		GOKZ_Pause(this.ID);
	}
	
	property bool CanPause {
		public get() {
			return GOKZ_GetCanPause(this.ID);
		}
	}
	
	public void Resume() {
		GOKZ_Resume(this.ID);
	}
	
	property bool CanResume {
		public get() {
			return GOKZ_GetCanResume(this.ID);
		}
	}
	
	public void TogglePause() {
		GOKZ_TogglePause(this.ID);
	}
	
	public void PlayErrorSound() {
		GOKZ_PlayErrorSound(this.ID);
	}
	
	property bool TimerRunning {
		public get() {
			return GOKZ_GetTimerRunning(this.ID);
		}
	}
	
	property int Course {
		public get() {
			return GOKZ_GetCourse(this.ID);
		}
	}
	
	property bool Paused {
		public get() {
			return GOKZ_GetPaused(this.ID);
		}
		public set(bool pause) {
			if (pause) {
				this.Pause();
			}
			else {
				this.Resume();
			}
		}
	}
	
	property bool CanTeleportToStart {
		public get() {
			return GOKZ_GetCanTeleportToStartOrEnd(this.ID);
		}
	}
	
	property float Time {
		public get() {
			return GOKZ_GetTime(this.ID);
		}
		public set(float value) {
			GOKZ_SetTime(this.ID, value);
		}
	}
	
	property int CheckpointCount {
		public get() {
			return GOKZ_GetCheckpointCount(this.ID);
		}
		public set(int cpCount) {
			GOKZ_SetCheckpointCount(this.ID, cpCount);
		}
	}
	
	property ArrayList CheckpointData {
		public get() {
			return GOKZ_GetCheckpointData(this.ID);
		}
		public set(ArrayList checkpoints) {
			GOKZ_SetCheckpointData(this.ID, checkpoints, GOKZ_CHECKPOINT_VERSION);
		}
	}
	
	property int TeleportCount {
		public get() {
			return GOKZ_GetTeleportCount(this.ID);
		}
		public set(int value) {
			GOKZ_SetTeleportCount(this.ID, value);
		}
	}
	
	property int TimeType {
		public get() {
			return GOKZ_GetTimeType(this.ID);
		}
	}
	
	property bool GOKZHitPerf {
		public get() {
			return GOKZ_GetHitPerf(this.ID);
		}
		public set(bool value) {
			GOKZ_SetHitPerf(this.ID, value);
		}
	}
	
	property float GOKZTakeoffSpeed {
		public get() {
			return GOKZ_GetTakeoffSpeed(this.ID);
		}
		public set(float value) {
			GOKZ_SetTakeoffSpeed(this.ID, value);
		}
	}
	
	property bool ValidJump {
		public get() {
			return GOKZ_GetValidJump(this.ID);
		}
	}
	
	public any GetOption(const char[] option) {
		return GOKZ_GetOption(this.ID, option);
	}
	
	public bool SetOption(const char[] option, any value) {
		return GOKZ_SetOption(this.ID, option, value);
	}
	
	public bool CycleOption(const char[] option) {
		return GOKZ_CycleOption(this.ID, option);
	}
	
	public any GetCoreOption(Option option) {
		return GOKZ_GetCoreOption(this.ID, option);
	}
	
	public bool SetCoreOption(Option option, int value) {
		return GOKZ_SetCoreOption(this.ID, option, value);
	}
	
	public bool CycleCoreOption(Option option) {
		return GOKZ_CycleCoreOption(this.ID, option);
	}
	
	property int Mode {
		public get() {
			return this.GetCoreOption(Option_Mode);
		}
		public set(int value) {
			this.SetCoreOption(Option_Mode, value);
		}
	}
	
	property int Style {
		public get() {
			return this.GetCoreOption(Option_Style);
		}
		public set(int value) {
			this.SetCoreOption(Option_Style, value);
		}
	}
	
	property int CheckpointMessages {
		public get() {
			return this.GetCoreOption(Option_CheckpointMessages);
		}
		public set(int value) {
			this.SetCoreOption(Option_CheckpointMessages, value);
		}
	}
	
	property int CheckpointSounds {
		public get() {
			return this.GetCoreOption(Option_CheckpointSounds);
		}
		public set(int value) {
			this.SetCoreOption(Option_CheckpointSounds, value);
		}
	}
	
	property int TeleportSounds {
		public get() {
			return this.GetCoreOption(Option_TeleportSounds);
		}
		public set(int value) {
			this.SetCoreOption(Option_TeleportSounds, value);
		}
	}
	
	property int ErrorSounds {
		public get() {
			return this.GetCoreOption(Option_ErrorSounds);
		}
		public set(int value) {
			this.SetCoreOption(Option_ErrorSounds, value);
		}
	}
	
	#endif
	// =====[ END CORE ]=====
	
	
	
	// =====[ HUD ]=====
	#if defined _gokz_hud_included_
	
	public any GetHUDOption(HUDOption option) {
		return GOKZ_HUD_GetOption(this.ID, option);
	}
	
	public bool SetHUDOption(HUDOption option, any value) {
		return GOKZ_HUD_SetOption(this.ID, option, value);
	}
	
	public bool CycleHUDOption(HUDOption option) {
		return GOKZ_HUD_CycleOption(this.ID, option);
	}
	
	property int TPMenu {
		public get() {
			return this.GetHUDOption(HUDOption_TPMenu);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_TPMenu, value);
		}
	}
	
	property int InfoPanel {
		public get() {
			return this.GetHUDOption(HUDOption_InfoPanel);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_InfoPanel, value);
		}
	}
	
	property int ShowKeys {
		public get() {
			return this.GetHUDOption(HUDOption_ShowKeys);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_ShowKeys, value);
		}
	}
	
	property int TimerText {
		public get() {
			return this.GetHUDOption(HUDOption_TimerText);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_TimerText, value);
		}
	}
	
	property int TimerStyle {
		public get() {
			return this.GetHUDOption(HUDOption_TimerStyle);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_TimerStyle, value);
		}
	}
	
	property int SpeedText {
		public get() {
			return this.GetHUDOption(HUDOption_SpeedText);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_SpeedText, value);
		}
	}
	
	property int ShowWeapon {
		public get() {
			return this.GetHUDOption(HUDOption_ShowWeapon);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_ShowWeapon, value);
		}
	}
	
	property int ReplayControls {
		public get() {
			return this.GetHUDOption(HUDOption_ShowControls);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_ShowControls, value);
		}
	}

	property int ShowSpectators {
		public get() {
			return this.GetHUDOption(HUDOption_ShowSpectators);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_ShowSpectators, value);
		}
	}

	property int SpecListPosition {
		public get() {
			return this.GetHUDOption(HUDOption_SpecListPosition);
		}
		public set(int value){
			this.SetHUDOption(HUDOption_SpecListPosition, value);
		}
	}

	property bool MenuShowing {
		public get() {
			return GOKZ_HUD_GetMenuShowing(this.ID);
		}
		public set(bool value) {
			GOKZ_HUD_SetMenuShowing(this.ID, value);
		}
	}
	property int DynamicMenu {
		public get() {
			return this.GetHUDOption(HUDOption_DynamicMenu);
		}
		public set(int value) {
			this.SetHUDOption(HUDOption_DynamicMenu, value);
		}
	}
	#endif
	// =====[ END HUD ]=====
	
	
	
	// =====[ PISTOL ]=====
	#if defined _gokz_pistol_included_
	
	property int Pistol {
		public get() {
			return this.GetOption(PISTOL_OPTION_NAME);
		}
		public set(int value) {
			this.SetOption(PISTOL_OPTION_NAME, value);
		}
	}
	
	#endif
	// =====[ END PISTOL ]=====
	
	
	
	// =====[ JUMP BEAM ]=====
	#if defined _gokz_jumpbeam_included_
	
	public any GetJBOption(JBOption option) {
		return GOKZ_JB_GetOption(this.ID, option);
	}
	
	public bool SetJBOption(JBOption option, any value) {
		return GOKZ_JB_SetOption(this.ID, option, value);
	}
	
	public bool CycleJBOption(JBOption option) {
		return GOKZ_JB_CycleOption(this.ID, option);
	}
	
	property int JBType {
		public get() {
			return this.GetJBOption(JBOption_Type);
		}
		public set(int value) {
			this.SetJBOption(JBOption_Type, value);
		}
	}
	
	#endif
	// =====[ END JUMP BEAM ]=====
	
	
	
	// =====[ TIPS ]=====
	#if defined _gokz_tips_included_
	
	property int Tips {
		public get() {
			return this.GetOption(TIPS_OPTION_NAME);
		}
		public set(int value) {
			this.SetOption(TIPS_OPTION_NAME, value);
		}
	}
	
	#endif
	// =====[ END TIPS ]=====
	
	
	
	// =====[ QUIET ]=====
	#if defined _gokz_quiet_included_
	
	property int ShowPlayers {
		public get() {
			return this.GetOption(gC_QTOptionNames[QTOption_ShowPlayers]);
		}
		public set(int value) {
			this.SetOption(gC_QTOptionNames[QTOption_ShowPlayers], value);
		}
	}
	
	#endif
	// =====[ END QUIET ]=====
	
	
	
	// =====[ SLAY ON END ]=====
	#if defined _gokz_slayonend_included_
	
	property int SlayOnEnd {
		public get() {
			return this.GetOption(SLAYONEND_OPTION_NAME);
		}
		public set(int value) {
			this.SetOption(SLAYONEND_OPTION_NAME, value);
		}
	}
	
	#endif
	// =====[ END SLAY ON END ]=====
}