SA-MP/bot/net/vehiclepool.h

61 lines
951 B
C
Raw Normal View History

2023-10-31 21:31:16 +08:00
2024-06-26 23:21:06 +08:00
#pragma once
2024-07-05 22:37:10 +08:00
#define INVALID_VEHICLE_ID 0xFFFF
2024-06-26 23:21:06 +08:00
#pragma pack(1)
typedef struct _NEW_VEHICLE {
VEHICLEID VehicleId;
int field_2;
int field_6;
char _gapA[8];
int field_12;
char field_16;
char field_17;
char _gap18[16];
} NEW_VEHICLE;
#pragma pack(1)
typedef struct _VEHICLE_SPAWN_INFO
{
int field_0;
int field_4;
int field_8;
int field_C;
int field_10;
int field_14;
int field_18;
char _gap1C[8];
} VEHICLE_SPAWN_INFO;
//----------------------------------------------------
2023-10-31 21:31:16 +08:00
class CVehiclePool // size: 114000
{
private:
char _gap0[34000];
BOOL m_bVehicleSlotState[MAX_VEHICLES];
2024-06-26 23:21:06 +08:00
VEHICLE_SPAWN_INFO m_SpawnInfo[MAX_VEHICLES];
2023-10-31 21:31:16 +08:00
public:
2024-06-26 23:21:06 +08:00
2023-10-31 21:31:16 +08:00
CVehiclePool();
~CVehiclePool();
2024-06-26 23:21:06 +08:00
BOOL New(NEW_VEHICLE *pNewVehicle);
BOOL Delete(VEHICLEID VehicleID);
// Find out if the slot is inuse.
BOOL GetSlotState(VEHICLEID VehicleID) {
if(VehicleID >= MAX_VEHICLES) { return FALSE; }
return m_bVehicleSlotState[VehicleID];
};
2023-10-31 21:31:16 +08:00
};