mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement/match n_IsVehicleStreamedIn(...)
* Rename `field_84D0` to `m_bVehicleSlotState` * Implement/match `CNetGame::IsVehicleAdded(...)`
This commit is contained in:
parent
86473c8272
commit
71204c1c49
@ -197,6 +197,14 @@ BOOL CNetGame::IsPlayerAdded(PLAYERID playerId)
|
||||
return bPlayerSlotState[playerId] != FALSE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
BOOL CNetGame::IsVehicleAdded(VEHICLEID VehicleID)
|
||||
{
|
||||
if(VehicleID >= MAX_VEHICLES) return FALSE;
|
||||
|
||||
return bVehicleSlotState[VehicleID] != FALSE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
// MATCH
|
||||
void CNetGame::SetMyZAngle(float fAngle)
|
||||
|
@ -113,6 +113,7 @@ public:
|
||||
BYTE GetPlayerArmedWeapon(PLAYERID playerId);
|
||||
BYTE GetPlayerHealth(PLAYERID playerId);
|
||||
BYTE GetPlayerArmour(PLAYERID playerId);
|
||||
BOOL IsVehicleAdded(VEHICLEID VehicleID);
|
||||
|
||||
void StopRecordingPlayback();
|
||||
void PauseRecordingPlayback();
|
||||
|
@ -8,7 +8,7 @@ CVehiclePool::CVehiclePool()
|
||||
{
|
||||
// loop through and initialize all net players to null and slot states to false
|
||||
for(VEHICLEID VehicleID = 0; VehicleID < MAX_VEHICLES; VehicleID++) {
|
||||
field_84D0[VehicleID] = 0;
|
||||
m_bVehicleSlotState[VehicleID] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class CVehiclePool // size: 114000
|
||||
{
|
||||
private:
|
||||
char _gap0[34000];
|
||||
int field_84D0[2000];
|
||||
BOOL m_bVehicleSlotState[MAX_VEHICLES];
|
||||
VEHICLE_SPAWN_INFO m_SpawnInfo[MAX_VEHICLES];
|
||||
|
||||
public:
|
||||
@ -51,4 +51,10 @@ public:
|
||||
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];
|
||||
};
|
||||
};
|
||||
|
@ -221,7 +221,10 @@ static cell AMX_NATIVE_CALL n_IsPlayerStreamedIn(AMX *amx, cell *params)
|
||||
// native IsVehicleStreamedIn(vehicleid)
|
||||
static cell AMX_NATIVE_CALL n_IsVehicleStreamedIn(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_IsVehicleStreamedIn
|
||||
if(pNetGame->GetVehiclePool()->GetSlotState((VEHICLEID)params[1]))
|
||||
{
|
||||
return pNetGame->IsVehicleAdded((VEHICLEID)params[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user