Help struct

forev

New Member
Joined
May 23, 2018
Messages
3
Likes
0
Points
1
#1
i have this snippet

Code:
:SendUnOccupiedVehicleSync
[email protected] = SAMP.GetSAMPVehicleIDByCarHandle([email protected])
Car.PutAt([email protected], [email protected], [email protected], [email protected])
alloc [email protected] 67 
0C0D: struct [email protected] offset 0 size 2 = [email protected] /////??????
0C0D: struct [email protected] offset 2 size 1 = 1 /////??????
0C0D: struct [email protected] offset 3 size 4 = -1.0 /////??????
0C0D: struct [email protected] offset 7 size 4 = -0.01 /////??????
0C0D: struct [email protected] offset 11 size 4 = 0.05 /////??????
0C0D: struct [email protected] offset 15 size 4 = 0.09 /////??????
0C0D: struct [email protected] offset 19 size 4 = -1.0 /////??????
0C0D: struct [email protected] offset 23 size 4 = 0.02 /////??????
0C0D: struct [email protected] offset 27 size 4 = [email protected] /////x position
0C0D: struct [email protected] offset 31 size 4 = [email protected] /////y position
0C0D: struct [email protected] offset 35 size 4 = [email protected] /////z position
0C0D: struct [email protected] offset 39 size 4 = 0.0 /////??????
0C0D: struct [email protected] offset 43 size 4 = 0.0 /////??????
0C0D: struct [email protected] offset 47 size 4 = 400.0 /////??????
0C0D: struct [email protected] offset 51 size 4 = 0.0 /////??????
0C0D: struct [email protected] offset 55 size 4 = 0.0 /////??????
0C0D: struct [email protected] offset 59 size 4 = 0.0 /////??????
0C0D: struct [email protected] offset 63 size 4 = 1000.0 // i guess this is health 
[email protected] = RakNet.NewBitStream()
BitStream.Write([email protected], 209, BS_TYPE_BYTE, 1)
BitStream.Write([email protected], [email protected], BS_TYPE_ARRAY, 67)
RakNet.LiteSend([email protected])
RakNet.DeleteBitStream([email protected])
free [email protected] 
ret 0
i want to learn, how can i find defines of these offsets?
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#3
idk where is this from and if it's accurate but check this out:
https://pastebin.com/0kfBm9tw


PACKET_UNOCCUPIED_SYNC = 209
//struct stUnoccupiedData ( size = 67 )
//int16_t sVehicleID; +0
//uint8_t byteSeatID; +2
//float fRoll[3]; +3
//float fDirection[3]; +15
//float fPosition[3]; +27
//float fMoveSpeed[3]; +39
//float fTurnSpeed[3]; +51
//float fHealth; +63
 
OP
OP
F

forev

New Member
Joined
May 23, 2018
Messages
3
Likes
0
Points
1
#4
monday said:
idk where is this from and if it's accurate but check this out:
https://pastebin.com/0kfBm9tw


PACKET_UNOCCUPIED_SYNC = 209
//struct stUnoccupiedData ( size = 67 )
//int16_t sVehicleID; +0
//uint8_t byteSeatID; +2
//float fRoll[3]; +3
//float fDirection[3]; +15
//float fPosition[3]; +27
//float fMoveSpeed[3]; +39
//float fTurnSpeed[3]; +51
//float fHealth; +63
you just saved my life, thank you.  :)

(is there a version with including [3] ones? ex; fmovespeedx fmovespeedy fmovespeedz?)
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#5
forev said:
(is there a version with including [3] ones? ex; fmovespeedx fmovespeedy fmovespeedz?)
I'm not sure what you mean to be honest, you could just rewrite it

instead of:
float fMoveSpeed[3];

you'd have:
float fMoveSpeed_x;
float fMoveSpeed_y;
float fMoveSpeed_z;

it creates the same variables and stands for the same data type within struct. Using [3] just makes it more concise to write and easier to access in c++
 
Top