Repository navigation
Expand file tree
/
Copy pathsynchronization.lua
More file actions
156 lines (143 loc) · 3.38 KB
/
Copy pathsynchronization.lua
File metadata and controls
156 lines (143 loc) · 3.38 KB
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
-- This file is part of the SAMP.Lua project.
-- Licensed under the MIT License.
-- Copyright (c) 2016, FYP @ BlastHack Team <blast.hk>
-- https://github.com/THE-FYP/SAMP.Lua
local MODULE =
{
MODULEINFO = {
name = 'samp.synchronization',
version = 1
}
}
local ffi = require 'ffi'
ffi.cdef[[
struct VectorXYZ
{
float x, y, z;
};
struct SampKeys {
uint8_t primaryFire : 1;
uint8_t horn_crouch : 1;
uint8_t secondaryFire_shoot : 1;
uint8_t accel_zoomOut : 1;
uint8_t enterExitCar : 1;
uint8_t decel_jump : 1;
uint8_t circleRight : 1;
uint8_t aim : 1;
uint8_t circleLeft : 1;
uint8_t landingGear_lookback : 1;
uint8_t unknown_walkSlow : 1;
uint8_t specialCtrlUp : 1;
uint8_t specialCtrlDown : 1;
uint8_t specialCtrlLeft : 1;
uint8_t specialCtrlRight : 1;
uint8_t _unknown : 1;
};
struct PlayerSyncData {
uint16_t leftRightKeys;
uint16_t upDownKeys;
union {
uint16_t keysData;
struct SampKeys keys;
};
struct VectorXYZ position;
float quaternion[4];
uint8_t health;
uint8_t armor;
uint8_t weapon;
uint8_t specialAction;
struct VectorXYZ moveSpeed;
struct VectorXYZ surfingOffsets;
uint16_t surfingVehicleId;
uint16_t animationId;
uint16_t animationFlags;
} __attribute__ ((packed));
struct VehicleSyncData {
uint16_t vehicleId;
uint16_t leftRightKeys;
uint16_t upDownKeys;
union {
uint16_t keysData;
struct SampKeys keys;
};
float quaternion[4];
struct VectorXYZ position;
struct VectorXYZ moveSpeed;
float vehicleHealth;
uint8_t playerHealth;
uint8_t armor;
uint8_t currentWeapon;
uint8_t siren;
uint8_t landingGearState;
uint16_t trailerId;
union {
float trainSpeed;
uint16_t hydraThrustAngle[2];
};
} __attribute__ ((packed));
struct PassengerSyncData
{
uint16_t vehicleId;
uint8_t seatId;
uint8_t currentWeapon;
uint8_t health;
uint8_t armor;
uint16_t leftRightKeys;
uint16_t upDownKeys;
union {
uint16_t keysData;
struct SampKeys keys;
};
struct VectorXYZ position;
} __attribute__ ((packed));
struct UnoccupiedSyncData
{
uint16_t vehicleId;
uint8_t seatId;
struct VectorXYZ roll;
struct VectorXYZ direction;
struct VectorXYZ position;
struct VectorXYZ moveSpeed;
struct VectorXYZ turnSpeed;
float vehicleHealth;
} __attribute__ ((packed));
struct TrailerSyncData
{
uint16_t trailerId;
struct VectorXYZ position;
struct VectorXYZ roll;
struct VectorXYZ direction;
struct VectorXYZ speed;
uint32_t unk;
} __attribute__ ((packed));
struct SpectatorSyncData
{
uint16_t leftRightKeys;
uint16_t upDownKeys;
union {
uint16_t keysData;
struct SampKeys keys;
};
struct VectorXYZ position;
} __attribute__ ((packed));
struct BulletSyncData
{
uint8_t targetType;
uint16_t targetId;
struct VectorXYZ origin;
struct VectorXYZ target;
struct VectorXYZ center;
uint8_t weaponId;
} __attribute__ ((packed));
struct AimSyncData
{
uint8_t camMode;
struct VectorXYZ camFront;
struct VectorXYZ camPos;
float aimZ;
uint8_t camExtZoom : 6;
uint8_t weaponState : 2;
uint8_t unknown;
} __attribute__ ((packed));
]]
return MODULE