File size: 2,096 Bytes
7e9dc27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
--[[
	Project: SA Memory (Available from https://blast.hk/)
	Developers: LUCHARE, FYP

	Special thanks:
		plugin-sdk (https://github.com/DK22Pac/plugin-sdk) for the structures and addresses.

	Copyright (c) 2018 BlastHack.
]]

local shared = require 'SAMemory.shared'

shared.require 'vector3d'
shared.require 'CVehicle'
shared.require 'CEntity'

shared.ffi.cdef[[
	typedef struct CNodeAddress
	{
		short wAreaId;
		short wNodeId;
	} CNodeAddress;

	typedef struct CCarPathLinkAddress
	{
		short wCarPathLinkId : 10;
		short wAreaId : 6;
	} CCarPathLinkAddress;

	typedef struct CAutoPilot
	{
		CNodeAddress         currentAddress;
		CNodeAddress         startingRouteNode;
		CNodeAddress field_8;
		int field_C;
		unsigned int         nSpeedScaleFactor;
		CCarPathLinkAddress  nCurrentPathNodeInfo;
		CCarPathLinkAddress  nNextPathNodeInfo;
		CCarPathLinkAddress  nPreviousPathNodeInfo;
		char field_1A[2];
		unsigned int         nTimeToStartMission;
		unsigned int         nTimeSwitchedToRealPhysics;
		char field_24;
		char _smthCurr;
		char _smthNext;
		char                 nCurrentLane;
		char                 nNextLane;
		char                 nCarDrivingStyle;
		char                 nCarMission;
		char                 nTempAction;
		unsigned int         nTempActionTime;
		unsigned int _someStartTime;
		char field_34;
		char field_35;
		char field_36[2];
		float field_38;
		float                fMaxTrafficSpeed;
		char nCruiseSpeed;
		char field_41;
		char field_42[2];
		float field_44;
		char field_48[1];
		char field_49;
		char field_4A;
		unsigned char        nCarCtrlFlags;
		char field_4C;
		char                 nStraightLineDistance;
		char field_4E;
		char field_4F;
		char field_50;
		char field_51;
		char field_52[10];
		vector3d              vecDestinationCoors;
		CNodeAddress         aPathFindNodesInfo[8];
		unsigned short       nPathFindNodesCount;
		char field_8A[2];
		struct CVehicle      *pTargetCar;
		struct CEntity       *pCarWeMakingSlowDownFor;
		char field_94;
		char field_95;
		short field_96;
	} CAutoPilot;
]]

shared.validate_size('CAutoPilot', 0x98)