mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[bot] Match FUNC_3(...)
This commit is contained in:
parent
b7b0237ebd
commit
3384a89aa3
16
bot/main.h
16
bot/main.h
@ -108,16 +108,20 @@ typedef struct _INCAR_SYNC_DATA
|
|||||||
WORD wKeys;
|
WORD wKeys;
|
||||||
QUATERNION quatRotation;
|
QUATERNION quatRotation;
|
||||||
VECTOR vecPos;
|
VECTOR vecPos;
|
||||||
|
VECTOR vecMoveSpeed;
|
||||||
char _gap24[16];
|
float fCarHealth;
|
||||||
|
|
||||||
BYTE bytePlayerHealth;
|
BYTE bytePlayerHealth;
|
||||||
BYTE bytePlayerArmour;
|
BYTE bytePlayerArmour;
|
||||||
BYTE byteCurrentWeapon : 6;
|
BYTE byteCurrentWeapon : 6;
|
||||||
BYTE byteSpecialKey : 2;
|
BYTE byteSpecialKey : 2;
|
||||||
|
BYTE byteSirenOn;
|
||||||
char _gap37[8];
|
BYTE byteLandingGearState;
|
||||||
|
VEHICLEID TrailerID;
|
||||||
|
union {
|
||||||
|
FLOAT fTrainSpeed;
|
||||||
|
FLOAT fBikeBankingAngle;
|
||||||
|
DWORD dwHydraThrustAngle;
|
||||||
|
};
|
||||||
} INCAR_SYNC_DATA;
|
} INCAR_SYNC_DATA;
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
@ -4,23 +4,20 @@
|
|||||||
|
|
||||||
struct struc_72 {
|
struct struc_72 {
|
||||||
//char _gap0[71];
|
//char _gap0[71];
|
||||||
WORD field_0;
|
VEHICLEID VehicleID;
|
||||||
WORD field_2;
|
WORD lrAnalog;
|
||||||
WORD field_4;
|
WORD udAnalog;
|
||||||
WORD field_6;
|
WORD wKeys;
|
||||||
VECTOR field_8;
|
VECTOR field_8; // vecRoll?
|
||||||
VECTOR field_14;
|
VECTOR field_14; // vecDirection?
|
||||||
DWORD field_20;
|
VECTOR vecPos;
|
||||||
DWORD field_24;
|
VECTOR vecMoveSpeed;
|
||||||
DWORD field_28;
|
float fCarHealth;
|
||||||
DWORD field_2C;
|
BYTE bytePlayerHealth;
|
||||||
DWORD field_30;
|
BYTE bytePlayerArmour;
|
||||||
DWORD field_34;
|
BYTE byteCurrentWeapon : 6;
|
||||||
DWORD field_38;
|
BYTE byteSpecialKey : 2;
|
||||||
BYTE field_3C;
|
BYTE byteSirenOn;
|
||||||
BYTE field_3D;
|
|
||||||
BYTE field_3E;
|
|
||||||
BYTE field_3F;
|
|
||||||
|
|
||||||
char _gap40[3];
|
char _gap40[3];
|
||||||
|
|
||||||
@ -31,29 +28,6 @@ struct struc_73 {
|
|||||||
char _gap0[52];
|
char _gap0[52];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct struc_74 {
|
|
||||||
//char _gap0[63];
|
|
||||||
WORD field_0;
|
|
||||||
WORD field_2;
|
|
||||||
WORD field_4;
|
|
||||||
WORD field_6;
|
|
||||||
QUATERNION field_8;
|
|
||||||
DWORD field_18;
|
|
||||||
DWORD field_1C;
|
|
||||||
DWORD field_20;
|
|
||||||
DWORD field_24;
|
|
||||||
DWORD field_28;
|
|
||||||
DWORD field_2C;
|
|
||||||
DWORD field_30;
|
|
||||||
BYTE field_34;
|
|
||||||
BYTE field_35;
|
|
||||||
BYTE field_36;
|
|
||||||
BYTE field_37;
|
|
||||||
BYTE field_38;
|
|
||||||
WORD field_39;
|
|
||||||
DWORD field_3B;
|
|
||||||
};
|
|
||||||
|
|
||||||
DWORD *GLOBAL_3 = NULL;
|
DWORD *GLOBAL_3 = NULL;
|
||||||
struc_73 *GLOBAL_4 = NULL;
|
struc_73 *GLOBAL_4 = NULL;
|
||||||
struc_72 *GLOBAL_2 = NULL;
|
struc_72 *GLOBAL_2 = NULL;
|
||||||
@ -112,81 +86,59 @@ int FUNC_2(FILE *a1, DWORD a2)
|
|||||||
int FUNC_3(char *a1)
|
int FUNC_3(char *a1)
|
||||||
{
|
{
|
||||||
FILE *fp = fopen(a1, "wb");
|
FILE *fp = fopen(a1, "wb");
|
||||||
if ( fp )
|
if(!fp) return 0;
|
||||||
|
|
||||||
|
DWORD v1 = 1000;
|
||||||
|
DWORD v2 = 1;
|
||||||
|
fwrite(&v1, 1, sizeof(DWORD), fp);
|
||||||
|
fwrite(&v2, 1, sizeof(DWORD), fp);
|
||||||
|
|
||||||
|
INCAR_SYNC_DATA icSync;
|
||||||
|
VECTOR v, vec1, vec2;
|
||||||
|
MATRIX4X4 m;
|
||||||
|
QUATERNION q;
|
||||||
|
|
||||||
|
memset(&icSync, 0, sizeof(INCAR_SYNC_DATA));
|
||||||
|
|
||||||
|
for(int i = 0; i != GLOBAL_1; i++)
|
||||||
{
|
{
|
||||||
DWORD v1 = 1000;
|
icSync.VehicleID = GLOBAL_2[i].VehicleID;
|
||||||
DWORD v2 = 1;
|
icSync.lrAnalog = GLOBAL_2[i].lrAnalog;
|
||||||
fwrite(&v1, 1, sizeof(DWORD), fp);
|
icSync.udAnalog = GLOBAL_2[i].udAnalog;
|
||||||
fwrite(&v2, 1, sizeof(DWORD), fp);
|
icSync.wKeys = GLOBAL_2[i].wKeys;
|
||||||
|
icSync.byteCurrentWeapon = GLOBAL_2[i].byteCurrentWeapon;
|
||||||
|
icSync.byteLandingGearState = 0;
|
||||||
|
icSync.bytePlayerHealth = GLOBAL_2[i].bytePlayerHealth;
|
||||||
|
icSync.bytePlayerArmour = GLOBAL_2[i].bytePlayerArmour;
|
||||||
|
icSync.byteSirenOn = GLOBAL_2[i].byteSirenOn;
|
||||||
|
icSync.fCarHealth = GLOBAL_2[i].fCarHealth;
|
||||||
|
icSync.dwHydraThrustAngle = GLOBAL_2[i].field_43;
|
||||||
|
icSync.vecPos = GLOBAL_2[i].vecPos;
|
||||||
|
icSync.vecMoveSpeed = GLOBAL_2[i].vecMoveSpeed;
|
||||||
|
icSync.TrailerID = 0;
|
||||||
|
|
||||||
struc_74 s;
|
vec2 = GLOBAL_2[i].field_8;
|
||||||
VECTOR v, vec1, vec2;
|
vec1 = GLOBAL_2[i].field_14;
|
||||||
MATRIX4X4 m;
|
|
||||||
QUATERNION q;
|
|
||||||
|
|
||||||
memset(&s, 0, sizeof(struc_74));
|
CrossProduct(&v, &vec1, &vec2);
|
||||||
|
|
||||||
for(int i = 0; i != GLOBAL_1; i++)
|
v.X *= -1.0f;
|
||||||
{
|
v.Y *= -1.0f;
|
||||||
s.field_0 = GLOBAL_2[i].field_0;
|
v.Z *= -1.0f;
|
||||||
s.field_2 = GLOBAL_2[i].field_2;
|
|
||||||
s.field_4 = GLOBAL_2[i].field_4;
|
|
||||||
s.field_6 = GLOBAL_2[i].field_6;
|
|
||||||
s.field_36 = GLOBAL_2[i].field_3E & 0x3F | s.field_36 & 0xC0;
|
|
||||||
s.field_38 = 0;
|
|
||||||
s.field_34 = GLOBAL_2[i].field_3C;
|
|
||||||
s.field_35 = GLOBAL_2[i].field_3D;
|
|
||||||
s.field_37 = GLOBAL_2[i].field_3F;
|
|
||||||
s.field_30 = GLOBAL_2[i].field_38;
|
|
||||||
s.field_3B = GLOBAL_2[i].field_43;
|
|
||||||
s.field_18 = GLOBAL_2[i].field_20;
|
|
||||||
s.field_1C = GLOBAL_2[i].field_24;
|
|
||||||
s.field_20 = GLOBAL_2[i].field_28;
|
|
||||||
s.field_24 = GLOBAL_2[i].field_2C;
|
|
||||||
s.field_28 = GLOBAL_2[i].field_30;
|
|
||||||
s.field_2C = GLOBAL_2[i].field_34;
|
|
||||||
s.field_39 = 0;
|
|
||||||
|
|
||||||
vec2.X = GLOBAL_2[i].field_8.X;
|
m.right = vec2;
|
||||||
vec2.Y = GLOBAL_2[i].field_8.Y;
|
m.up = vec1;
|
||||||
vec2.Z = GLOBAL_2[i].field_8.Z;
|
m.at = v;
|
||||||
vec1.X = GLOBAL_2[i].field_14.X;
|
|
||||||
vec1.Y = GLOBAL_2[i].field_14.Y;
|
|
||||||
vec1.Z = GLOBAL_2[i].field_14.Z;
|
|
||||||
CrossProduct(&v, &vec1, &vec2);
|
|
||||||
|
|
||||||
v.X *= -1.0f;
|
MatrixToQuaternion(&m, &q);
|
||||||
v.Y *= -1.0f;
|
|
||||||
v.Z *= -1.0f;
|
|
||||||
|
|
||||||
m.right.X = vec2.X;
|
icSync.quatRotation = q;
|
||||||
m.right.Y = vec2.Y;
|
|
||||||
m.right.Z = vec2.Z;
|
|
||||||
m.up.X = vec1.X;
|
|
||||||
m.up.Y = vec1.Y;
|
|
||||||
m.up.Z = vec1.Z;
|
|
||||||
m.at.X = v.X;
|
|
||||||
m.at.Y = v.Y;
|
|
||||||
m.at.Z = v.Z;
|
|
||||||
|
|
||||||
MatrixToQuaternion(&m, &q);
|
fwrite(&GLOBAL_3[i], 1, sizeof(DWORD), fp);
|
||||||
|
fwrite(&icSync, 1, sizeof(INCAR_SYNC_DATA), fp);
|
||||||
s.field_8.X = q.X;
|
|
||||||
s.field_8.Y = q.Y;
|
|
||||||
s.field_8.Z = q.Z;
|
|
||||||
s.field_8.W = q.W;
|
|
||||||
|
|
||||||
fwrite(&GLOBAL_3[i], 1, sizeof(DWORD), fp);
|
|
||||||
fwrite(&s, 1, sizeof(struc_74), fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
fclose(fp);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FUNC_4(char *a1)
|
int FUNC_4(char *a1)
|
||||||
|
Loading…
Reference in New Issue
Block a user