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

This commit is contained in:
RD42 2024-04-27 18:18:23 +08:00
parent fdd891098b
commit 65ef695183
3 changed files with 11 additions and 4 deletions

View File

@ -11,7 +11,7 @@ CPlayerPool::CPlayerPool()
field_3E8C[playerId] = pNetGame->GetTime(); field_3E8C[playerId] = pNetGame->GetTime();
} }
field_30964 = 0; field_30964 = 0;
field_30968 = 0; m_iPoolSize = 0;
field_FA0 = pNetGame->GetTime(); field_FA0 = pNetGame->GetTime();
field_FA4 = 0; field_FA4 = 0;
field_FA8 = 0; field_FA8 = 0;

View File

@ -32,7 +32,7 @@ private:
char _gap2EA24[8000]; char _gap2EA24[8000];
int field_30964; int field_30964;
int field_30968; int m_iPoolSize;
int field_3096C; int field_3096C;
public: public:
@ -64,6 +64,7 @@ public:
BOOL IsNPC(PLAYERID playerId) { return m_bIsAnNPC[playerId]; }; BOOL IsNPC(PLAYERID playerId) { return m_bIsAnNPC[playerId]; };
int GetPoolSize() { return m_iPoolSize; };
}; };
#endif #endif

View File

@ -9,10 +9,16 @@ static cell AMX_NATIVE_CALL n_gpci(AMX *amx, cell *params)
return 0; return 0;
} }
//----------------------------------------------------------------------------------
// native GetPlayerPoolSize()
static cell AMX_NATIVE_CALL n_GetPlayerPoolSize(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_GetPlayerPoolSize(AMX *amx, cell *params)
{ {
// TODO: GetPlayerPoolSize if(!pNetGame) return -1;
return 0; CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
if(pPlayerPool) {
return pPlayerPool->GetPoolSize();
}
return -1;
} }
static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params)