[server] Implement and match n_GetVehiclePoolSize(...)

This commit is contained in:
RD42 2024-04-27 18:21:27 +08:00
parent 65ef695183
commit 026d199e61
4 changed files with 13 additions and 4 deletions

View File

@ -78,6 +78,7 @@ public:
CPlayerPool * GetPlayerPool() { return m_pPlayerPool; };
CVehiclePool * GetVehiclePool() { return m_pVehiclePool; };
RakServerInterface * GetRakServer() { return m_pRak; };
CGameMode * GetGameMode() { return m_pGameMode; };
CFilterScripts * GetFilterScripts() { return m_pFilterScripts; };

View File

@ -21,10 +21,16 @@ static cell AMX_NATIVE_CALL n_GetPlayerPoolSize(AMX *amx, cell *params)
return -1;
}
//----------------------------------------------------------------------------------
// native GetVehiclePoolSize()
static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params)
{
// TODO: GetVehiclePoolSize
return 0;
if(!pNetGame) return -1;
CVehiclePool *pVehiclePool = pNetGame->GetVehiclePool();
if(pVehiclePool) {
return pVehiclePool->GetPoolSize();
}
return -1;
}
static cell AMX_NATIVE_CALL n_GetActorPoolSize(AMX *amx, cell *params)

View File

@ -9,7 +9,7 @@ CVehiclePool::CVehiclePool()
field_D4[VehicleID] = 0;
}
memset(field_0,0,sizeof(field_0));
field_5E94 = 0;
m_iPoolSize = 0;
}
CVehiclePool::~CVehiclePool()

View File

@ -9,7 +9,7 @@ private:
int field_D4[2000];
int field_2014[2000];
int field_3F54[2000];
int field_5E94;
int m_iPoolSize;
public:
CVehiclePool();
@ -18,6 +18,8 @@ public:
BOOL Delete(VEHICLEID VehicleID);
int GetModelCount();
int GetPoolSize() { return m_iPoolSize; };
};
#endif