-
Notifications
You must be signed in to change notification settings - Fork 3
/
player.cpp
834 lines (665 loc) · 22.5 KB
/
player.cpp
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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
#include "include/gomp.h"
#include "include/player.h"
#ifdef __cplusplus
extern "C"
{
#endif
void* player_getByID(int id)
{
return call<void*>("player_getByID", id);
}
int player_getID(void* player)
{
return call<int>("player_getID", player);
}
void player_kick(void* player)
{
return call<void>("player_kick", player);
}
void player_ban(void* player, String reason)
{
return call<void>("player_ban", player, reason);
}
int player_isBot(void* player)
{
return call<int>("player_isBot", player);
}
unsigned player_getPing(void* player)
{
return call<unsigned>("player_getPing", player);
}
void player_spawn(void* player)
{
return call<void>("player_spawn", player);
}
int player_isSpawned(void* player)
{
return call<int>("player_isSpawned", player);
}
uint8_t player_getClientVersion(void* player)
{
return call<uint8_t>("player_getClientVersion", player);
}
String player_getClientVersionName(void* player)
{
return call<String>("player_getClientVersionName", player);
}
void player_setPositionFindZ(void* player, float x, float y, float z)
{
return call<void>("player_setPositionFindZ", player, x, y, z);
}
void player_setCameraPosition(void* player, float x, float y, float z)
{
return call<void>("player_setCameraPosition", player, x, y, z);
}
Vector3 player_getCameraPosition(void* player)
{
return call<Vector3>("player_getCameraPosition", player);
}
void player_setCameraLookAt(void* player, float x, float y, float z, int cutType)
{
return call<void>("player_setCameraLookAt", player, x, y, z, cutType);
}
Vector3 player_getCameraLookAt(void* player)
{
return call<Vector3>("player_getCameraLookAt", player);
}
void player_setCameraBehind(void* player)
{
return call<void>("player_setCameraBehind", player);
}
void player_interpolateCameraPosition(void* player, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int time, int cutType)
{
return call<void>("player_interpolateCameraPosition", player, fromX, fromY, fromZ, toX, toY, toZ, time, cutType);
}
void player_interpolateCameraLookAt(void* player, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int time, int cutType)
{
return call<void>("player_interpolateCameraLookAt", player, fromX, fromY, fromZ, toX, toY, toZ, time, cutType);
}
void player_attachCameraToObject(void* player, void* object)
{
return call<void>("player_attachCameraToObject", player, object);
}
int player_setName(void* player, String name)
{
return call<int>("player_setName", player, name);
}
String player_getName(void* player)
{
return call<String>("player_getName", player);
}
String player_getSerial(void* player)
{
return call<String>("player_getSerial", player);
}
void player_giveWeapon(void* player, WeaponSlotData weapon)
{
return call<void>("player_giveWeapon", player, weapon);
}
void player_removeWeapon(void* player, uint8_t weapon)
{
return call<void>("player_removeWeapon", player, weapon);
}
void player_setWeaponAmmo(void* player, WeaponSlotData data)
{
return call<void>("player_setWeaponAmmo", player, data);
}
Array* player_getWeapons(void* player)
{
return call<Array*>("player_getWeapons", player);
}
WeaponSlotData player_getWeaponSlot(void* player, int slot)
{
return call<WeaponSlotData>("player_getWeaponSlot", player, slot);
}
void player_resetWeapons(void* player)
{
return call<void>("player_resetWeapons", player);
}
void player_setArmedWeapon(void* player, uint32_t weapon)
{
return call<void>("player_setArmedWeapon", player, weapon);
}
uint32_t player_getArmedWeapon(void* player)
{
return call<uint32_t>("player_getArmedWeapon", player);
}
uint32_t player_getArmedWeaponAmmo(void* player)
{
return call<uint32_t>("player_getArmedWeaponAmmo", player);
}
void player_setShopName(void* player, String name)
{
return call<void>("player_setShopName", player, name);
}
String player_getShopName(void* player)
{
return call<String>("player_getShopName", player);
}
void player_setDrunkLevel(void* player, int level)
{
return call<void>("player_setDrunkLevel", player, level);
}
int player_getDrunkLevel(void* player)
{
return call<int>("player_getDrunkLevel", player);
}
void player_setColour(void* player, uint32_t colour)
{
return call<void>("player_setColour", player, colour);
}
uint32_t player_getColour(void* player)
{
return call<uint32_t>("player_getColour", player);
}
void player_setOtherColour(void* player, void* other, uint32_t colour)
{
return call<void>("player_setOtherColour", player, other, colour);
}
int player_getOtherColour(void* player, void* other, uint32_t* colour)
{
return call<int>("player_getOtherColour", player, other, colour);
}
void player_setControllable(void* player, int controllable)
{
return call<void>("player_setControllable", player, controllable);
}
int player_getControllable(void* player)
{
return call<int>("player_getControllable", player);
}
void player_setSpectating(void* player, int spectating)
{
return call<void>("player_setSpectating", player, spectating);
}
void player_setWantedLevel(void* player, unsigned level)
{
return call<void>("player_setWantedLevel", player, level);
}
unsigned player_getWantedLevel(void* player)
{
return call<unsigned>("player_getWantedLevel", player);
}
void player_playSound(void* player, uint32_t sound, float posX, float posY, float posZ)
{
return call<void>("player_playSound", player, sound, posX, posY, posZ);
}
uint32_t player_lastPlayedSound(void* player)
{
return call<uint32_t>("player_lastPlayedSound", player);
}
void player_playAudio(void* player, String url, int usePos, float posX, float posY, float posZ, float distance)
{
return call<void>("player_playAudio", player, url, usePos, posX, posY, posZ, distance);
}
int player_playerCrimeReport(void* player, void* suspect, int crime)
{
return call<int>("player_playerCrimeReport", player, suspect, crime);
}
void player_stopAudio(void* player)
{
return call<void>("player_stopAudio", player);
}
String player_lastPlayedAudio(void* player)
{
return call<String>("player_lastPlayedAudio", player);
}
void player_createExplosion(void* player, float vecX, float vecY, float vecZ, int type, float radius)
{
return call<void>("player_createExplosion", player, vecX, vecY, vecZ, type, radius);
}
void player_sendDeathMessage(void* player, void* plr, void* killer, int weapon)
{
return call<void>("player_sendDeathMessage", player, plr, killer, weapon);
}
void player_sendEmptyDeathMessage(void* player)
{
return call<void>("player_sendEmptyDeathMessage", player);
}
void player_removeDefaultObjects(void* player, unsigned model, float posX, float posY, float posZ, float radius)
{
return call<void>("player_removeDefaultObjects", player, model, posX, posY, posZ, radius);
}
void player_forceClassSelection(void* player)
{
return call<void>("player_forceClassSelection", player);
}
void player_setMoney(void* player, int money)
{
return call<void>("player_setMoney", player, money);
}
void player_giveMoney(void* player, int money)
{
return call<void>("player_giveMoney", player, money);
}
void player_resetMoney(void* player)
{
return call<void>("player_resetMoney", player);
}
int player_getMoney(void* player)
{
return call<int>("player_getMoney", player);
}
void player_setMapIcon(void* player, int id, float posX, float posY, float posZ, int type, uint32_t colour, int style)
{
return call<void>("player_setMapIcon", player, id, posX, posY, posZ, type, colour, style);
}
void player_unsetMapIcon(void* player, int id)
{
return call<void>("player_unsetMapIcon", player, id);
}
void player_useStuntBonuses(void* player, int enable)
{
return call<void>("player_useStuntBonuses", player, enable);
}
void player_toggleOtherNameTag(void* player, void* other, int toggle)
{
return call<void>("player_toggleOtherNameTag", player, other, toggle);
}
void player_setTime(void* player, int hr, int min)
{
return call<void>("player_setTime", player, hr, min);
}
Time player_getTime(void* player)
{
return call<Time>("player_getTime", player);
}
void player_useClock(void* player, int enable)
{
return call<void>("player_useClock", player, enable);
}
int player_hasClock(void* player)
{
return call<int>("player_hasClock", player);
}
void player_useWidescreen(void* player, int enable)
{
return call<void>("player_useWidescreen", player, enable);
}
int player_hasWidescreen(void* player)
{
return call<int>("player_hasWidescreen", player);
}
void player_setHealth(void* player, float health)
{
return call<void>("player_setHealth", player, health);
}
float player_getHealth(void* player)
{
return call<float>("player_getHealth", player);
}
void player_setScore(void* player, int score)
{
return call<void>("player_setScore", player, score);
}
int player_getScore(void* player)
{
return call<int>("player_getScore", player);
}
void player_setArmour(void* player, float armour)
{
return call<void>("player_setArmour", player, armour);
}
float player_getArmour(void* player)
{
return call<float>("player_getArmour", player);
}
void player_setGravity(void* player, float gravity)
{
return call<void>("player_setGravity", player, gravity);
}
float player_getGravity(void* player)
{
return call<float>("player_getGravity", player);
}
void player_setWorldTime(void* player, int time)
{
return call<void>("player_setWorldTime", player, time);
}
void player_applyAnimation(void* player, float delta, unsigned char loop, unsigned char lockX, unsigned char lockY, unsigned char freeze, uint32_t time, String lib, String name, int syncType)
{
return call<void>("player_applyAnimation", player, delta, loop, lockX, lockY, freeze, time, lib, name, syncType);
}
void player_clearAnimations(void* player, int syncType)
{
return call<void>("player_clearAnimations", player, syncType);
}
PlayerAnimationData player_getAnimationData(void* player)
{
return call<PlayerAnimationData>("player_getAnimationData", player);
}
int player_isStreamedInForPlayer(void* player, void* other)
{
return call<int>("player_isStreamedInForPlayer", player, other);
}
int player_getState(void* player)
{
return call<int>("player_getState", player);
}
void player_setTeam(void* player, int team)
{
return call<void>("player_setTeam", player, team);
}
int player_getTeam(void* player)
{
return call<int>("player_getTeam", player);
}
void player_setSkin(void* player, int skin, int send)
{
return call<void>("player_setSkin", player, skin, send);
}
int player_getSkin(void* player)
{
return call<int>("player_getSkin", player);
}
void player_setChatBubble(void* player, String text, uint32_t colour, float drawDist, int expire)
{
return call<void>("player_setChatBubble", player, text, colour, drawDist, expire);
}
void player_sendClientMessage(void* player, uint32_t colour, String message)
{
return call<void>("player_sendClientMessage", player, colour, message);
}
void player_sendChatMessage(void* player, void* sender, String message)
{
return call<void>("player_sendChatMessage", player, sender, message);
}
void player_sendGameText(void* player, String message, int time, int style)
{
return call<void>("player_sendGameText", player, message, time, style);
}
void player_hideGameText(void* player, int style)
{
return call<void>("player_hideGameText", player, style);
}
int player_hasGameText(void* player, int style)
{
return call<int>("player_hasGameText", player, style);
}
int player_getGameText(void* player, int style, String* message, int* time, int* remaining)
{
return call<int>("player_getGameText", player, style, message, time, remaining);
}
void player_setWeather(void* player, int weatherID)
{
return call<void>("player_setWeather", player, weatherID);
}
int player_getWeather(void* player)
{
return call<int>("player_getWeather", player);
}
void player_setWorldBounds(void* player, float x, float y, float z, float w)
{
return call<void>("player_setWorldBounds", player, x, y, z, w);
}
Vector4 player_getWorldBounds(void* player)
{
return call<Vector4>("player_getWorldBounds", player);
}
void player_setFightingStyle(void* player, int style)
{
return call<void>("player_setFightingStyle", player, style);
}
int player_getFightingStyle(void* player)
{
return call<int>("player_getFightingStyle", player);
}
void player_setSkillLevel(void* player, int skill, int level)
{
return call<void>("player_setSkillLevel", player, skill, level);
}
void player_setAction(void* player, int action)
{
return call<void>("player_setAction", player, action);
}
int player_getAction(void* player)
{
return call<int>("player_getAction", player);
}
void player_setVelocity(void* player, float velX, float velY, float velZ)
{
return call<void>("player_setVelocity", player, velX, velY, velZ);
}
Vector3 player_getVelocity(void* player)
{
return call<Vector3>("player_getVelocity", player);
}
void player_setInterior(void* player, unsigned interior)
{
return call<void>("player_setInterior", player, interior);
}
unsigned player_getInterior(void* player)
{
return call<unsigned>("player_getInterior", player);
}
PlayerKeyData player_getKeyData(void* player)
{
return call<PlayerKeyData>("player_getKeyData", player);
}
const PlayerAimData* player_getAimData(void* player)
{
return call<const PlayerAimData*>("player_getAimData", player);
}
const PlayerBulletData* player_getBulletData(void* player)
{
return call<const PlayerBulletData*>("player_getBulletData", player);
}
void player_useCameraTargetting(void* player, int enable)
{
return call<void>("player_useCameraTargetting", player, enable);
}
int player_hasCameraTargetting(void* player)
{
return call<int>("player_hasCameraTargetting", player);
}
void player_removeFromVehicle(void* player, int force)
{
return call<void>("player_removeFromVehicle", player, force);
}
void* player_getCameraTargetPlayer(void* player)
{
return call<void*>("player_getCameraTargetPlayer", player);
}
void* player_getCameraTargetVehicle(void* player)
{
return call<void*>("player_getCameraTargetVehicle", player);
}
void* player_getCameraTargetObject(void* player)
{
return call<void*>("player_getCameraTargetObject", player);
}
void* player_getCameraTargetActor(void* player)
{
return call<void*>("player_getCameraTargetActor", player);
}
void* player_getTargetPlayer(void* player)
{
return call<void*>("player_getTargetPlayer", player);
}
void* player_getTargetActor(void* player)
{
return call<void*>("player_getTargetActor", player);
}
void player_setRemoteVehicleCollisions(void* player, int collide)
{
return call<void>("player_setRemoteVehicleCollisions", player, collide);
}
void player_spectatePlayer(void* player, void* target, int mode)
{
return call<void>("player_spectatePlayer", player, target, mode);
}
void player_spectateVehicle(void* player, void* target, int mode)
{
return call<void>("player_spectateVehicle", player, target, mode);
}
const PlayerSpectateData* player_getSpectateData(void* player)
{
return call<const PlayerSpectateData*>("player_getSpectateData", player);
}
void player_sendClientCheck(void* player, int actionType, int address, int offset, int count)
{
return call<void>("player_sendClientCheck", player, actionType, address, offset, count);
}
void player_toggleGhostMode(void* player, int toggle)
{
return call<void>("player_toggleGhostMode", player, toggle);
}
int player_isGhostModeEnabled(void* player)
{
return call<int>("player_isGhostModeEnabled", player);
}
int player_getDefaultObjectsRemoved(void* player)
{
return call<int>("player_getDefaultObjectsRemoved", player);
}
void player_clearTasks(void* player, PlayerAnimationSyncType syncType)
{
return call<void>("player_clearTasks", player, syncType);
}
void player_allowWeapons(void* player, int allow)
{
return call<void>("player_allowWeapons", player, allow);
}
int player_areWeaponsAllowed(void* player)
{
return call<int>("player_areWeaponsAllowed", player);
}
void player_allowTeleport(void* player, int allow)
{
return call<void>("player_allowTeleport", player, allow);
}
int player_isTeleportAllowed(void* player)
{
return call<int>("player_isTeleportAllowed", player);
}
int player_isUsingOfficialClient(void* player)
{
return call<int>("player_isUsingOfficialClient", player);
}
// entity
void player_setPosition(void* player, float posX, float posY, float posZ)
{
return call<void>("player_setPosition", player, posX, posY, posZ);
}
Vector3 player_getPosition(void* player)
{
return call<Vector3>("player_getPosition", player);
}
Vector4 player_getRotation(void* player)
{
return call<Vector4>("player_getRotation", player);
}
void player_setVirtualWorld(void* player, int vw)
{
return call<void>("player_setVirtualWorld", player, vw);
}
int player_getVirtualWorld(void* player)
{
return call<int>("player_getVirtualWorld", player);
}
// checkpoint data
void* player_getCheckpoint(void* player)
{
return call<void*>("player_getCheckpoint", player);
}
void* player_getRaceCheckpoint(void* player)
{
return call<void*>("player_getRaceCheckpoint", player);
}
// console data
void player_setConsoleAccessibility(void* player, int set)
{
return call<void>("player_setConsoleAccessibility", player, set);
}
int player_hasConsoleAccess(void* player)
{
return call<int>("player_hasConsoleAccess", player);
}
// custom models data
int player_getCustomSkin(void* player)
{
return call<int>("player_getCustomSkin", player);
}
// network data
String player_getIp(void* player)
{
return call<String>("player_getIp", player);
}
uint32_t player_getRawIp(void* player)
{
return call<uint32_t>("player_getRawIp", player);
}
// vehicle data
void* player_getVehicle(void* player)
{
return call<void*>("player_getVehicle", player);
}
int player_getSeat(void* player)
{
return call<int>("player_getSeat", player);
}
int player_isInModShop(void* player)
{
return call<int>("player_isInModShop", player);
}
// object data
void player_beginObjectEditing(void* player, void* object)
{
return call<void>("player_beginObjectEditing", player, object);
}
void player_endObjectEditing(void* player)
{
return call<void>("player_endObjectEditing", player);
}
unsigned char player_isEditingObject(void* player)
{
return call<unsigned char>("player_isEditingObject", player);
}
void player_beginObjectSelecting(void* player)
{
return call<void>("player_beginObjectSelecting", player);
}
unsigned char player_isSelectingObject(void* player)
{
return call<unsigned char>("player_isSelectingObject", player);
}
void player_setAttachedObject(void* player, int index, int modelId, int bone, float offsetX, float offsetY, float offsetZ, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ, uint32_t colour1, uint32_t colour2)
{
return call<void>("player_setAttachedObject", player, index, modelId, bone, offsetX, offsetY, offsetZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, colour1, colour2);
}
PlayerAttachedObject player_getAttachedObject(void* player, int index)
{
return call<PlayerAttachedObject>("player_getAttachedObject", player, index);
}
void player_removeAttachedObject(void* player, int index)
{
return call<void>("player_removeAttachedObject", player, index);
}
void player_editAttachedObject(void* player, int index)
{
return call<void>("player_editAttachedObject", player, index);
}
unsigned char player_hasAttachedObject(void* player, int index)
{
return call<unsigned char>("player_hasAttachedObject", player, index);
}
// misc
float player_getDistanceFromPoint(void* player, float pX, float pY, float pZ)
{
return call<float>("player_getDistanceFromPoint", player, pX, pY, pZ);
}
void player_setFacingAngle(void* player, float angle)
{
return call<void>("player_setFacingAngle", player, angle);
}
float player_getFacingAngle(void* player)
{
return call<float>("player_getFacingAngle", player);
}
int player_isInRangeOfPoint(void* player, float range, float pX, float pY, float pZ)
{
return call<int>("player_isInRangeOfPoint", player, range, pX, pY, pZ);
}
#ifdef __cplusplus
}
#endif