This repository has been archived by the owner on Aug 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructs.h
1272 lines (1177 loc) · 39.4 KB
/
Structs.h
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
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the YSI 2.0 SA:MP plugin.
*
* The Initial Developer of the Original Code is Alex "Y_Less" Cole.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Peter Beverloo
* Marcus Bauer
* MaVe;
* Sammy91
* Incognito
*
* Special Thanks to:
*
* SA:MP Team past, present and future
*/
#ifndef YSF_STRUCTS_H
#define YSF_STRUCTS_H
#include <map>
#include "CVector.h"
typedef char CHAR;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short USHORT;
typedef unsigned short WORD;
typedef unsigned long DWORD;
class CGangZonePool;
#define MAX_ATTACHED_OBJECTS 10
#define MAX_FILTER_SCRIPTS 16
#define AFK_ACCURACY 1500
#define MAX_PLAYER_NAME (24)
#define MAX_CLIENT_MESSAGE (144)
#define MAX_PLAYERS (1000)
#define MAX_VEHICLES (2000)
#define MAX_ACTORS (1000)
#define INVALID_PLAYER_ID (0xFFFF)
#define INVALID_VEHICLE_ID (0xFFFF)
#define INVALID_ACTOR_ID (0xFFFF)
#define NO_TEAM (255)
#define MAX_OBJECTS (1000)
#define INVALID_OBJECT_ID (0xFFFF)
#define MAX_GANG_ZONES (1024)
#define MAX_TEXT_DRAWS (2048)
#define MAX_PLAYER_TEXT_DRAWS (256)
#define MAX_MENUS (128)
#define MAX_3DTEXT_GLOBAL (1024)
#define MAX_3DTEXT_PLAYER (1024)
#define MAX_PICKUPS (4096)
#define INVALID_MENU (0xFF)
#define INVALID_TEXT_DRAW (0xFFFF)
#define INVALID_GANG_ZONE (-1)
#define INVALID_3DTEXT_ID (0xFFFF)
#define SERVER_VARTYPE_NONE (0)
#define SERVER_VARTYPE_INT (1)
#define SERVER_VARTYPE_STRING (2)
#define SERVER_VARTYPE_FLOAT (3)
#define TEXT_DRAW_FONT_SPRITE_DRAW (4)
#define TEXT_DRAW_FONT_MODEL_PREVIEW (5)
#define DIALOG_STYLE_MSGBOX (0)
#define DIALOG_STYLE_INPUT (1)
#define DIALOG_STYLE_LIST (2)
#define DIALOG_STYLE_PASSWORD (3)
#define DIALOG_STYLE_TABLIST (4)
#define DIALOG_STYLE_TABLIST_HEADERS (5)
#define PLAYER_STATE_NONE (0)
#define PLAYER_STATE_ONFOOT (1)
#define PLAYER_STATE_DRIVER (2)
#define PLAYER_STATE_PASSENGER (3)
#define PLAYER_STATE_EXIT_VEHICLE (4)
#define PLAYER_STATE_ENTER_VEHICLE_DRIVER (5)
#define PLAYER_STATE_ENTER_VEHICLE_PASSENGER (6)
#define PLAYER_STATE_WASTED (7)
#define PLAYER_STATE_SPAWNED (8)
#define PLAYER_STATE_SPECTATING (9)
#define PLAYER_MARKERS_MODE_OFF (0)
#define PLAYER_MARKERS_MODE_GLOBAL (1)
#define PLAYER_MARKERS_MODE_STREAMED (2)
#define WEAPON_BRASSKNUCKLE (1)
#define WEAPON_GOLFCLUB (2)
#define WEAPON_NITESTICK (3)
#define WEAPON_KNIFE (4)
#define WEAPON_BAT (5)
#define WEAPON_SHOVEL (6)
#define WEAPON_POOLSTICK (7)
#define WEAPON_KATANA (8)
#define WEAPON_CHAINSAW (9)
#define WEAPON_DILDO (10)
#define WEAPON_DILDO2 (11)
#define WEAPON_VIBRATOR (12)
#define WEAPON_VIBRATOR2 (13)
#define WEAPON_FLOWER (14)
#define WEAPON_CANE (15)
#define WEAPON_GRENADE (16)
#define WEAPON_TEARGAS (17)
#define WEAPON_MOLTOV (18)
#define WEAPON_COLT45 (22)
#define WEAPON_SILENCED (23)
#define WEAPON_DEAGLE (24)
#define WEAPON_SHOTGUN (25)
#define WEAPON_SAWEDOFF (26)
#define WEAPON_SHOTGSPA (27)
#define WEAPON_UZI (28)
#define WEAPON_MP5 (29)
#define WEAPON_AK47 (30)
#define WEAPON_M4 (31)
#define WEAPON_TEC9 (32)
#define WEAPON_RIFLE (33)
#define WEAPON_SNIPER (34)
#define WEAPON_ROCKETLAUNCHER (35)
#define WEAPON_HEATSEEKER (36)
#define WEAPON_FLAMETHROWER (37)
#define WEAPON_MINIGUN (38)
#define WEAPON_SATCHEL (39)
#define WEAPON_BOMB (40)
#define WEAPON_SPRAYCAN (41)
#define WEAPON_FIREEXTINGUISHER (42)
#define WEAPON_CAMERA (43)
#define WEAPON_NIGHTVISION (44)
#define WEAPON_INFRARED (45)
#define WEAPON_PARACHUTE (46)
#define WEAPON_VEHICLE (49)
#define WEAPON_DROWN (53)
#define WEAPON_COLLISION (54)
#define KEY_ACTION (1)
#define KEY_CROUCH (2)
#define KEY_FIRE (4)
#define KEY_SPRINT (8)
#define KEY_SECONDARY_ATTACK (16)
#define KEY_JUMP (32)
#define KEY_LOOK_RIGHT (64)
#define KEY_HANDBRAKE (128)
#define KEY_LOOK_LEFT (256)
#define KEY_SUBMISSION (512)
#define KEY_LOOK_BEHIND (512)
#define KEY_WALK (1024)
#define KEY_ANALOG_UP (2048)
#define KEY_ANALOG_DOWN (4096)
#define KEY_ANALOG_LEFT (8192)
#define KEY_ANALOG_RIGHT (16384)
#define KEY_YES (65536)
#define KEY_NO (131072)
#define KEY_CTRL_BACK (262144)
#define KEY_UP (-128)
#define KEY_DOWN (128)
#define KEY_LEFT (-128)
#define KEY_RIGHT (128)
#define BODY_PART_TORSO (3)
#define BODY_PART_GROIN (4)
#define BODY_PART_LEFT_ARM (5)
#define BODY_PART_RIGHT_ARM (6)
#define BODY_PART_LEFT_LEG (7)
#define BODY_PART_RIGHT_LEG (8)
#define BODY_PART_HEAD (9)
#define CLICK_SOURCE_SCOREBOARD (0)
#define EDIT_RESPONSE_CANCEL (0)
#define EDIT_RESPONSE_FINAL (1)
#define EDIT_RESPONSE_UPDATE (2)
#define SELECT_OBJECT_GLOBAL_OBJECT (1)
#define SELECT_OBJECT_PLAYER_OBJECT (2)
#define BULLET_HIT_TYPE_NONE (0)
#define BULLET_HIT_TYPE_PLAYER (1)
#define BULLET_HIT_TYPE_VEHICLE (2)
#define BULLET_HIT_TYPE_OBJECT (3)
#define BULLET_HIT_TYPE_PLAYER_OBJECT (4)
typedef int INT;
typedef unsigned int UINT;
enum CON_VARTYPE { CON_VARTYPE_FLOAT, CON_VARTYPE_INT, CON_VARTYPE_BOOL, CON_VARTYPE_STRING };
#define CON_VARFLAG_DEBUG 1
#define CON_VARFLAG_READONLY 2
#define CON_VARFLAG_RULE 4 // Gets sent with a RULES query responce
#define PAD(a, b) char a[b]
typedef void(*VARCHANGEFUNC)();
struct ConsoleVariable_s
{
CON_VARTYPE VarType;
DWORD VarFlags;
void* VarPtr;
VARCHANGEFUNC VarChangeFunc;
};
class C3DText // size 0x21
{
public:
char* text; // + 0x00
unsigned int color; // + 0x04
float posX; // + 0x08
float posY; // + 0x0C
float posZ; // + 0x10
float drawDistance; // + 0x14
bool useLineOfSight; // + 0x18
int virtualWorld; // + 0x19
WORD attachedToPlayerID; // + 0x1D
WORD attachedToVehicleID; // + 0x1F
};
class C3DTextPool
{
public:
BOOL m_bIsCreated[MAX_3DTEXT_GLOBAL];
C3DText m_TextLabels[MAX_3DTEXT_GLOBAL];
};
class CPlayerText3DLabels // size 0x9802
{
public:
C3DText TextLabels[ MAX_3DTEXT_PLAYER ]; // + 0x0000
BOOL isCreated[ MAX_3DTEXT_PLAYER ]; // + 0x8400
BYTE unknown9800[MAX_3DTEXT_PLAYER]; // + 0x9400
WORD ownerID;
};
// Big thanks to OrMisicL
class CAimSyncData
{
public:
BYTE byteCameraMode; // 0
CVector vecFront; // 1 - 13
CVector vecPosition; // 13 - 25
float fZAim; // 25 - 29
BYTE byteWeaponState : 6; // 29
BYTE byteCameraZoom : 2; // 29
BYTE unk; // 30 - 31
WORD wCameraObject; // 31 - 33
WORD wCameraVehicle; // 33 - 35
WORD wCameraPlayer; // 35 - 37
WORD wCameraActor; // 37 - 39
// Size = 39
};
class CVehicleSyncData
{
public:
WORD wVehicleId; // 0x001F - 0x0021
WORD wUDAnalog; // 0x0021 - 0x0023
WORD wLRAnalog; // 0x0023 - 0x0025
WORD wKeys; // 0x0025 - 0x0027
float fQuaternionAngle; // 0x0027 - 0x002B
CVector vecQuaternion; // 0x002B - 0x0037
CVector vecPosition; // 0x0037 - 0x0043
CVector vecVelocity; // 0x0043 - 0x004F
float fHealth; // 0x004F - 0x0053
BYTE bytePlayerHealth; // 0x0053 - 0x0054
BYTE bytePlayerArmour; // 0x0054 - 0x0055
BYTE bytePlayerWeapon; // 0x0055 - 0x0056
BYTE byteSirenState; // 0x0056 - 0x0057
BYTE byteGearState; // 0x0057 - 0x0058
WORD wTrailerID; // 0x0058 - 0x005A
union //
{
WORD wHydraReactorAngle[2];
float fTrainSpeed;
};
// Size = 63
};
class CPassengerSyncData
{
public:
WORD wVehicleId; // 0x005E - 0x0060
BYTE byteSeatFlags : 7;
BYTE byteDriveBy : 1;
BYTE bytePlayerWeapon; // 0x0061 - 0x0062
BYTE bytePlayerHealth; // 0x0062 - 0x0063
BYTE bytePlayerArmour; // 0x0063 - 0x0064
WORD wUDAnalog; // 0x0064 - 0x0066
WORD wLRAnalog; // 0x0066 - 0x0068
WORD wKeys; // 0x0068 - 0x006A
CVector vecPosition; // 0x006A - 0x0076
// Size = 24
};
class CSyncData
{
public:
WORD wUDAnalog; // 0x0076 - 0x0078
WORD wLRAnalog; // 0x0078 - 0x007A
WORD wKeys; // 0x007A - 0x007C
CVector vecPosition; // 0x007C - 0x0088
float fQuaternion[4]; // 0x0088 - 0x008C
BYTE byteHealth; // 0x0098 - 0x0099
BYTE byteArmour; // 0x0099 - 0x009A
BYTE byteWeapon; // 0x009A - 0x009B
BYTE byteSpecialAction; // 0x009B - 0x009C
CVector vecVelocity; // 0x009C - 0x00A8
CVector vecSurfing; // 0x00A8 - 0x00B4
WORD wSurfingInfo; // 0x00B4 - 0x00B6
union
{
DWORD dwAnimationData; // 0x00B6 - 0x00BA
struct
{
WORD wAnimIndex;
WORD wAnimFlags;
};
};
// Size = 68
};
class CUnoccupiedSyncData // size 0x43
{
public:
WORD wVehicleID; // + 0x0000
BYTE bytePassengerSlot; // + 0x0002
CVector vecRool; // + 0x0003
CVector vecDirection; // + 0x000F
CVector vecPosition; // + 0x001B
CVector vecVelocity; // + 0x0027
CVector vecTurnVelocity; // + 0x0033
float fHealth; // + 0x003F
};
class CSpectatingSyncData // size 0x12
{
public:
WORD wLeftRightKeysOnSpectating; // + 0x0000
WORD wUpDownKeysOnSpectating; // + 0x0002
WORD wKeysOnSpectating; // + 0x0004
CVector vecPosition; // + 0x0006
};
class CTrailerSyncData // size 0x36 = 54
{
public:
WORD wTrailerID; // + 0x0000
CVector vecRoll; // + 0x0002
CVector vecDirection; // + 0x000E
CVector vecPosition; // + 0x001A
CVector vecVelocity; // + 0x0026
DWORD pad;
};
class CAttachedObject // sizeof = 52 - 0x34
{
public:
int iModelID;
int iBoneiD;
CVector vecPos;
CVector vecRot;
CVector vecScale;
DWORD dwMaterialColor1;
DWORD dwMaterialColor2;
};
typedef struct CTextdraw
{
union
{
BYTE byteFlags; // 25
struct
{
BYTE byteBox : 1;
BYTE byteLeft : 1;
BYTE byteRight : 1;
BYTE byteCenter : 1;
BYTE byteProportional : 1;
BYTE bytePadding : 3;
};
};
float fLetterWidth; // 1
float fLetterHeight; // 5
DWORD dwLetterColor; // 9
float fLineWidth; // 13
float fLineHeight; // 17
DWORD dwBoxColor; // 21
BYTE byteShadow; // 26
BYTE byteOutline; // 27
DWORD dwBackgroundColor; // 31
BYTE byteStyle; // 32
BYTE byteSelectable; // 32
float fX; // 33
float fY; // 37
WORD dwModelIndex; // 41 - 43
CVector vecRot; // 43 - 55
float fZoom; // 55 - 59
WORD color1; // 59 - 61
WORD color2; // 61 - 63
} _CTextdraw;
class CPlayerTextDraw
{
public:
BOOL bSlotState[MAX_PLAYER_TEXT_DRAWS];
CTextdraw *TextDraw[MAX_PLAYER_TEXT_DRAWS];
char *szFontText[MAX_PLAYER_TEXT_DRAWS];
bool bHasText[MAX_PLAYER_TEXT_DRAWS];
};
#define MAX_PVARS 800
#define MAX_PVAR_NAME 40
/*
// PVar enumeration
#define PLAYER_VARTYPE_NONE 0
#define PLAYER_VARTYPE_INT 1
#define PLAYER_VARTYPE_STRING 2
#define PLAYER_VARTYPE_FLOAT 3
*/
typedef struct PVAR_DATA_t
{
char pVarName[MAX_PVAR_NAME + 1];
BOOL isReadOnly;
int pVarType;
int intValue;
float floatValue;
char* stringValue;
} PVAR_DATA;
class CPlayerVar
{
public:
PVAR_DATA pVars[MAX_PVARS];
BOOL isPVarActive[MAX_PVARS];
int upperIndex;
};
class CPlayerSpawnInfo // size 46
{
public:
BYTE byteTeam; // 0 - 1
int iSkin; // 1 - 5
BYTE unk; // 5 - 6
CVector vecPos; // 6 - 18
float fRotation; // 18 - 22
int iSpawnWeapons[3]; // 22 - 34
int iSpawnWeaponsAmmo[3]; // 34 - 46
};
class CBulletSyncData // sizeof = 40
{
public:
BYTE byteHitType;
WORD wHitID;
CVector vecHitOrigin;
CVector vecHitTarget;
CVector vecCenterOfHit;
BYTE byteWeaponID;
};
// 10505 - camera target
class CPlayer
{
public:
CAimSyncData aimSyncData; // 0 - 39
CVehicleSyncData vehicleSyncData; // 39 -
CPassengerSyncData passengerSyncData; //
CSyncData syncData; // 126 - 194
CUnoccupiedSyncData unoccupiedSyncData; // 194 - 261
CSpectatingSyncData spectatingSyncData; // 261 - 279
CTrailerSyncData trailerSyncData; // 279 - 333
DWORD dwPlayerSyncUnused; // 333 - 337
DWORD dwVehicleSyncUnused; // 337 - 341
BYTE byteStreamedIn[MAX_PLAYERS]; // 341 - 1341
BYTE byteVehicleStreamedIn[MAX_VEHICLES]; // 1341 - 3341
BYTE byteSomethingUnused[1000]; // 3341 - 4341
BYTE byte3DTextLabelStreamedIn[1024]; // 4341 - 5365
BYTE bPickupStreamedIn[MAX_PICKUPS]; // 5365 - 9461
BYTE byteActorStreamedIn[MAX_PLAYERS]; // 9461 - 10461
DWORD dwStreamedInPlayers; // 10461 - 10465
DWORD dwStreamedInVehicles; // 10465 - 10469
DWORD dwStreamedInSomethingUnused; // 10469 - 10473
DWORD dwStreamedIn3DTextLabels; // 10479 - 10477
DWORD dwStreamedInPickups; // 10477 - 10481
DWORD dwStreamedInActors; // 10481 - 10485
DWORD bHasSetVehiclePos; // 10485 - 10489
DWORD dwSetVehiclePosTick;// 10489 - 10493
CVector vecVehicleNewPos; // 10493 - 10505
BOOL bCameraTarget; // 10505
DWORD bHasSpawnInfo; // 10509
BOOL bUpdateKeys; // 50513
CVector vecPosition; // 10517
float fHealth; // 10529 - 10533
float fArmour; // 10533 - 10537
float fQuaternion[4]; // 10537 - 10553
float fAngle; // 10553 - 10557
CVector vecVelocity; // 10557 - 10569
WORD wUDAnalog; // 10569
WORD wLRAnalog; // 10571
DWORD dwKeys; // 10573 - 10577
DWORD dwOldKeys; // 10577 - 10581
BOOL bEditObject; // 10581 - 10585
BOOL bEditAttachedObject;// 10585 - 10589
WORD wDialogID; // 10589 - 10591
CPlayerTextDraw* pTextdraw; // 10591 - 10595
CPlayerText3DLabels* p3DText; // 10595 - 10599
WORD wPlayerId; // 10599 - 10601
int iUpdateState; // 10601 - 10605
//DWORD dwLastSyncTick; // 10605 - 10609
CAttachedObject attachedObject[MAX_ATTACHED_OBJECTS]; // 10605 - 11125
BOOL attachedObjectSlot[MAX_ATTACHED_OBJECTS]; // 11125 - 11165
BOOL bHasAimSync; // 11165 - 11169
BOOL bHasTrailerSync; // 11169 - 11173
BOOL bHasUnoccupiedSync; // 11173 - 11177
BYTE byteState; // 11177 - 11178
CVector vecCPPos; // 11178 - 11190
float fCPSize; // 11190 - 11194
BOOL bIsInCP; // 11194 - 11198
CVector vecRaceCPPos; // 11198 - 11210
CVector vecRaceCPNextPos; // 11210 - 11222
BYTE byteRaceCPType; // 11222 - 11223 // TODO -> replace
float fRaceCPSize; // 11223 - 11227
BOOL bIsInRaceCP; // 11227 - 11231
BOOL bIsInModShop; // 11231 - 11235
WORD wSkillLevel[11]; // 11235 - 11257
int iLastMarkerUpdate; // 11257 - 11261
CPlayerSpawnInfo spawn; // 11261 - 11307
BOOL bReadyToSpawn; // 11307 - 11311
BYTE byteWantedLevel; // 11311 - 11312
BYTE byteFightingStyle; // 11312 - 11313
BYTE byteSeatId; // 11313 - 11314
WORD wVehicleId; // 11314 - 11316
DWORD dwNickNameColor; // 11316 - 11320
BOOL bShowCheckpoint; // 11320 - 11324
BOOL bShowRaceCheckpoint;// 11324 - 11328
int iInteriorId; // 11328 - 11332
WORD wWeaponAmmo[12]; // 11332 - 11356
PAD(pad10, 28); // 11356 - 11384
BYTE byteWeaponId[12]; // 11384 - 11396
BYTE byteWeaponID_unknown;// 11396 - 11397
BYTE byteCurrentWeapon; // 11397 - 11398
WORD wTargetId; // 11398 - 11400
WORD wTargetActorId; // 11400 - 11402
DWORD dwLastShotTick; // 11402 - 11406
BYTE dwLastShotWeapon; // 11406 - 11407
CBulletSyncData bulletSyncData; // 11407 - 11447
BYTE m_byteTime; // 11447 - 11448
float m_fGameTime; // 11448 - 11452
BYTE byteSpectateType; // 11452 - 11453
DWORD wSpectateID; // 11453 - 11457
DWORD dwLastStreaming; // 11457 - 11461
DWORD dwNPCRecordingType; // 11461 - 11465
void *pRecordingFile; // 11465 - 11469
DWORD dwFirstNPCWritingTime; // 11469 - 11473
PAD(unused, 9); // 11473 - 11482
CPlayerVar* pPlayerVars; // 11482 - 11486
// Size = 9963
};
class CPlayerPool // sizeof = 99520
{
public:
DWORD dwVirtualWorld[MAX_PLAYERS]; // 0 - 4000
DWORD dwPlayersCount; // 4000 - 4004
DWORD dwlastMarkerUpdate; // 4004 - 4008
float fUpdatePlayerGameTimers; // 4008 - 4012
DWORD dwScore[MAX_PLAYERS]; // 4012 - 8012
DWORD dwMoney[MAX_PLAYERS]; // 8012 - 12012
DWORD dwDrunkLevel[MAX_PLAYERS]; // 12012 - 16012
DWORD dwLastScoreUpdate[MAX_PLAYERS]; // 16012 - 20012
char szSerial[MAX_PLAYERS][101]; // 20012 - 121012
char szVersion[MAX_PLAYERS][29]; // 121012 - 150012
BOOL bIsPlayerConnectedEx[MAX_PLAYERS]; // 150012 - 154012
CPlayer *pPlayer[MAX_PLAYERS]; // 154012 - 158012
char szName[MAX_PLAYERS][25]; // 158012 - 183012
BOOL bIsAnAdmin[MAX_PLAYERS]; // 183012 - 187012
BOOL bIsNPC[MAX_PLAYERS]; // 187012 - 191012
PAD(pad0, 8004); // 191012 - 199016
DWORD dwPlayerPoolSize; // 199016 - 199020
};
class CGameMode
{
public:
AMX m_amx;
bool m_bInitialised;
bool m_bSleeping;
float m_fSleepTime;
};
class CFilterScripts
{
public:
void* m_pFilterScripts[MAX_FILTER_SCRIPTS];
char m_szFilterScriptName[MAX_FILTER_SCRIPTS][255];
int m_iFilterScriptCount;
};
typedef struct _MATRIX4X4
{
CVector right;
DWORD flags;
CVector up;
float pad_u;
CVector at;
float pad_a;
CVector pos;
float pad_p;
} MATRIX4X4, *PMATRIX4X4;
class CVehicleSpawn // size 36
{
public:
int iModelID;
CVector vecPos;
float fRot;
int iColor1;
int iColor2;
int iRespawnTime;
int iInterior;
};
class CVehicleModInfo // sizeof = 26
{
public:
BYTE byteModSlots[14]; // + 0x0000
BYTE bytePaintJob; // + 0x000E
int iColor1; // + 0x000F
int iColor2; // + 0x0010
};
class CVehicleParams // sizeof = 16
{
public:
BYTE engine;
BYTE lights;
BYTE alarm;
BYTE doors;
BYTE bonnet;
BYTE boot;
BYTE objective; // 6
BYTE siren; // 7
BYTE door_driver; // 8
BYTE door_passenger;
BYTE door_backleft;
BYTE door_backright; // 11
BYTE windows_driver; // 12
BYTE windows_passenger;
BYTE windows_backleft;
BYTE windows_backright; // 15 - 16
};
class CVehicle
{
public:
CVector vecPosition; // 0 - 12
MATRIX4X4 vehMatrix; // 12 - 76
CVector vecVelocity; // 76 - 88
CVector vecTurnSpeed; // 88 - 100
WORD wVehicleID; // 100 - 102
WORD wTrailerID; // 102 - 104
WORD wCabID; // 104 - 106
WORD wLastDriverID; // 106 - 108
WORD vehPassengers[7]; // 108 - 122
DWORD vehActive; // 122 - 126
DWORD vehWasted; // 126 - 130
CVehicleSpawn customSpawn; // 130 - 166
float fHealth; // 166 - 170
DWORD vehDoorStatus; // 170 - 174
DWORD vehPanelStatus; // 174 - 178
BYTE vehLightStatus; // 178 - 179
BYTE vehTireStatus; // 179 - 180
bool bDead; // 180 - 181
WORD wKillerID; // 181 - 183
CVehicleModInfo vehModInfo; // 183 - 206
char szNumberplate[32 + 1]; // 206 - 239
CVehicleParams vehParamEx; // 239 - 255
BYTE bDeathNotification; // 255 - 256
BYTE bOccupied; // 256 - 257
DWORD vehOccupiedTick; // 257 - 261
DWORD vehRespawnTick; // 261 -265
};
class CVehiclePool
{
public:
BYTE byteVehicleModelsUsed[212]; // 0 - 212
int iVirtualWorld[MAX_VEHICLES]; // 212 - 8212
BOOL bVehicleSlotState[MAX_VEHICLES]; // 8212 - 16212
CVehicle *pVehicle[MAX_VEHICLES]; // 16212 - 24212
DWORD dwVehiclePoolSize; // 24212
};
class CObjectMaterial // sizeof = 212
{
public:
BYTE byteUsed; // 197 - 198
BYTE byteSlot; // 198 - 199
WORD wModelID; // 199 - 201
DWORD dwMaterialColor; // 201 - 205
char szMaterialTXD[64 + 1]; // 205 - 270
char szMaterialTexture[64 + 1]; // 270 - 335
BYTE byteMaterialSize; // 335 - 336
char szFont[64 + 1]; // 336 - 401
BYTE byteFontSize; // 401 - 402
BYTE byteBold; // 402 - 403
DWORD dwFontColor; // 403 - 407
DWORD dwBackgroundColor; // 407 - 411
BYTE byteAlignment; // 411 - 412
};
class CObject // sizeof = 3700
{
public:
WORD wObjectID; // 0 - 2
int iModel; // 2 - 6
BOOL bActive; // 6 - 10
MATRIX4X4 matWorld; // 10 - 74 - pos - Object position
CVector vecRot; // 74 - 86 - Object rotation
MATRIX4X4 matTarget; // 86 - 150 -
BYTE bIsMoving; // 150 - 151
BYTE bNoCameraCol; // 151 - 152
float fMoveSpeed; // 152 - 156
DWORD unk_4; // 156 -160
float fDrawDistance; // 160 - 164
WORD wAttachedVehicleID; // 164 - 166
WORD wAttachedObjectID; // 166 - 168
CVector vecAttachedOffset; // 168 - 180
CVector vecAttachedRotation;// 180 - 192
BYTE byteSyncRot; // 192 - 193
DWORD dwMaterialCount; // 193 - 197
CObjectMaterial Material[16]; // 197 - 3637
char *szMaterialText[16];// 3637 - 3653
};
class CObjectPool
{
public:
BOOL m_bPlayerObjectSlotState[MAX_PLAYERS][MAX_OBJECTS]; // 0
BOOL m_bPlayersObject[MAX_OBJECTS]; // 4.000.000
CObject *m_pPlayerObjects[MAX_PLAYERS][MAX_OBJECTS]; // 4.004.000
BOOL m_bObjectSlotState[MAX_OBJECTS]; // 8.004.000
CObject *m_pObjects[MAX_OBJECTS]; // 8.008.000
};
class CTextDrawPool
{
public:
BOOL bSlotState[MAX_TEXT_DRAWS];
CTextdraw *TextDraw[MAX_TEXT_DRAWS];
char *szFontText[MAX_TEXT_DRAWS];
bool bHasText[MAX_TEXT_DRAWS][MAX_PLAYERS];
};
class CSAMPGangZonePool
{
public:
float fGangZone[MAX_GANG_ZONES][4];
BOOL bSlotState[MAX_GANG_ZONES];
};
#define MAX_MENU_TEXT_SIZE 32
#define MAX_ITEMS 12
#define MAX_COLUMNS 2
struct t_MenuInteraction
{
BOOL Menu;
BOOL Row[MAX_ITEMS];
char unknown[12];
};
class CMenu // size 0xB84
{
public:
BYTE menuID; // + 0x0000
char title[ MAX_MENU_TEXT_SIZE ]; // + 0x0001
char items[ MAX_ITEMS ][ MAX_COLUMNS ][ MAX_MENU_TEXT_SIZE ]; // + 0x0021
char headers[MAX_COLUMNS][MAX_MENU_TEXT_SIZE]; // + 0x0321
BOOL isInitiedForPlayer[MAX_PLAYERS]; // + 0x0361
t_MenuInteraction interaction; // + 0x0B31
float posX; // + 0x0B71
float posY; // + 0x0B75
float column1Width; // + 0x0B79
float column2Width; // + 0x0B7D
BYTE columnsNumber; // + 0x0B81
BYTE itemsCount[ MAX_COLUMNS ]; // + 0x0B82
};
class CMenuPool
{
public:
CMenu* menu[ MAX_MENUS ]; // + 0x0000
BOOL isCreated[ MAX_MENUS ]; // + 0x0200
BOOL playerMenu[MAX_PLAYERS]; // + 0x0400
};
struct ScriptTimer_s // sizeof = 0x11B (283)
{
char szScriptFunc[255];
int iTotalTime;
int iRemainingTime;
BOOL bRepeating;
BOOL bKilled;
AMX* pAMX;
int iParamCount;
void* cellParams;
};
typedef std::map<DWORD, ScriptTimer_s*> DwordTimerMap;
class CScriptTimers
{
public:
DwordTimerMap m_Timers;
DWORD m_dwTimerCount;
};
typedef struct Pickup_t // size 0x14
{
int iModel;
int iType;
CVector vecPos;
} tPickup;
class CPickupPool_
{
public:
tPickup m_Pickup[MAX_PICKUPS]; // + 0x0000
BOOL m_bActive[MAX_PICKUPS]; // + 0xA000
int m_iWorld[MAX_PICKUPS]; // + 0xC000
int m_iPickupCount;
};
#define GAMESTATE_STOPPED 0
#define GAMESTATE_RUNNING 1
#define GAMESTATE_RESTARTING 2
class CActor
{
public:
BYTE pad0; // 0
int iSkinID; // 1 - 5
CVector vecSpawnPos; // 5 - 17
float fSpawnAngle; // 17 - 21
DWORD pad4; // 21 - 25
DWORD pad5; // 25 - 29
BYTE pad6; // 29 - 30
char animation[140]; // 30 - 170
WORD pad7; // 170 - 171
float fHealth; // 172 - 176
DWORD pad; // 176 - 180
float fAngle; // 180 - 184
CVector vecPos; // 184 - 196
DWORD pad8[3]; // 196 - 208
BYTE byteInvulnerable; // 208 - 209
WORD wActorID; // 209 - 211
};
class CActorPool
{
public:
int iActorVirtualWorld[1000];
BOOL bValidActor[1000];
CActor* pActor[1000];
DWORD dwActorPoolSize;
};
class CNetGame
{
public:
CGameMode *pGameModePool; // 0
CFilterScripts *pFilterScriptPool; // 4
CPlayerPool *pPlayerPool; // 8
CVehiclePool *pVehiclePool; // 12
#ifndef NEW_PICKUP_SYSTEM
CPickupPool_ *pPickupPool; // 16
#else
CPickupPool *pPickupPool; // 16
#endif
CObjectPool *pObjectPool; // 20
CMenuPool *pMenuPool; // 24
CTextDrawPool *pTextDrawPool; // 28
C3DTextPool *p3DTextPool; // 32
CGangZonePool *pGangZonePool; // 36
CActorPool *pActorPool; // 40
int iCurrentGameModeIndex; // 44
int iCurrentGameModeRepeat; // 48
BOOL bFirstGameModeLoaded; // 52
BOOL unkasdasd; // 56
CScriptTimers *pScriptTimers; // 60
void *pRak; // 64
DWORD dwSomethingTick;
DWORD dwUnk;
DWORD dwUnk1;
BOOL bLanMode; //
BOOL bShowPlayerMarkers; // 84
BYTE byteShowNameTags; //
BYTE bTirePopping; //
BYTE byteAllowWeapons; //
BYTE byteStuntBonus; // 91 - 92
BYTE byteDefaultCameraCollision; // 92 - 93
BYTE byteWeather; // 93 - 94
int iGameState; // 94 - 98
float fGravity; // 98 - 102
int iDeathDropMoney; // 102 - 106
BYTE unklofasz; // 106 - 107
BYTE byteMode; // 107 - 108
BYTE bLimitGlobalChatRadius; // 108 - 109
BYTE bUseCJWalk; // 109 - 110
float fGlobalChatRadius; // 110 - 114
float fNameTagDrawDistance; // 114 - 118
BYTE byteDisableEnterExits; // 118 - 119
BYTE byteNameTagLOS; // 119 - 120
BYTE bManulVehicleEngineAndLights; // 120 - 121
BYTE bLimitPlayerMarkers; // 121 - 122
float fPlayerMarkesLimit; // 122 - 126
BOOL bVehicleFriendlyFire; // 126 - 130
#ifndef _WIN32
double dElapsedTime; // size = 8
#endif
int iSpawnsAvailable; // 130 - 134
CPlayerSpawnInfo AvailableSpawns[300]; // 129 - 13929
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct PlayerID
{
unsigned int binaryAddress;
unsigned short port;
};
const PlayerID UNASSIGNED_PLAYER_ID =
{
0xFFFFFFFF, 0xFFFF
};
/// All RPC functions have the same parameter list - this structure.
struct RPCParameters
{
/// The data from the remote system
unsigned char *input;
/// How many bits long \a input is
unsigned int numberOfBitsOfData;
/// Which system called this RPC
PlayerID sender;
/// Which instance of RakPeer (or a derived RakServer or RakClient) got this call
void *recipient;
/// You can return values from RPC calls by writing them to this BitStream.
/// This is only sent back if the RPC call originally passed a BitStream to receive the reply.
/// If you do so and your send is reliable, it will block until you get a reply or you get disconnected from the system you are sending to, whichever is first.
/// If your send is not reliable, it will block for triple the ping time, or until you are disconnected, or you get a reply, whichever is first.
RakNet::BitStream *replyToSender;
};
/// These enumerations are used to describe when packets are delivered.
enum PacketPriority
{
SYSTEM_PRIORITY, /// \internal Used by RakNet to send above-high priority messages.
HIGH_PRIORITY, /// High priority messages are send before medium priority messages.
MEDIUM_PRIORITY, /// Medium priority messages are send before low priority messages.
LOW_PRIORITY, /// Low priority messages are only sent when no other messages are waiting.
NUMBER_OF_PRIORITIES
};
/// These enumerations are used to describe how packets are delivered.
/// \note Note to self: I write this with 3 bits in the stream. If I add more remember to change that
enum PacketReliability
{
UNRELIABLE = 6, /// Same as regular UDP, except that it will also discard duplicate datagrams. RakNet adds (6 to 17) + 21 bits of overhead, 16 of which is used to detect duplicate packets and 6 to 17 of which is used for message length.
UNRELIABLE_SEQUENCED, /// Regular UDP with a sequence counter. Out of order messages will be discarded. This adds an additional 13 bits on top what is used for UNRELIABLE.
RELIABLE, /// The message is sent reliably, but not necessarily in any order. Same overhead as UNRELIABLE.
RELIABLE_ORDERED, /// This message is reliable and will arrive in the order you sent it. Messages will be delayed while waiting for out of order messages. Same overhead as UNRELIABLE_SEQUENCED.
RELIABLE_SEQUENCED /// This message is reliable and will arrive in the sequence you sent it. Out or order messages will be dropped. Same overhead as UNRELIABLE_SEQUENCED.
};
/// \sa NetworkIDGenerator.h
typedef unsigned char UniqueIDType;
typedef unsigned short PlayerIndex;
typedef unsigned char RPCIndex;
const int MAX_RPC_MAP_SIZE=((RPCIndex)-1)-1;
const int UNDEFINED_RPC_INDEX=((RPCIndex)-1);
/// First byte of a network message
typedef unsigned char MessageID;