diff --git a/server/playerpool.cpp b/server/playerpool.cpp index 36171f1..708601e 100644 --- a/server/playerpool.cpp +++ b/server/playerpool.cpp @@ -11,7 +11,7 @@ CPlayerPool::CPlayerPool() field_3E8C[playerId] = pNetGame->GetTime(); } field_30964 = 0; - field_30968 = 0; + m_iPoolSize = 0; field_FA0 = pNetGame->GetTime(); field_FA4 = 0; field_FA8 = 0; diff --git a/server/playerpool.h b/server/playerpool.h index c4042a6..d083223 100644 --- a/server/playerpool.h +++ b/server/playerpool.h @@ -32,7 +32,7 @@ private: char _gap2EA24[8000]; int field_30964; - int field_30968; + int m_iPoolSize; int field_3096C; public: @@ -64,6 +64,7 @@ public: BOOL IsNPC(PLAYERID playerId) { return m_bIsAnNPC[playerId]; }; + int GetPoolSize() { return m_iPoolSize; }; }; #endif diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index de08bdf..62beff7 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -9,10 +9,16 @@ static cell AMX_NATIVE_CALL n_gpci(AMX *amx, cell *params) return 0; } +//---------------------------------------------------------------------------------- +// native GetPlayerPoolSize() static cell AMX_NATIVE_CALL n_GetPlayerPoolSize(AMX *amx, cell *params) { - // TODO: GetPlayerPoolSize - return 0; + if(!pNetGame) return -1; + CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool(); + if(pPlayerPool) { + return pPlayerPool->GetPoolSize(); + } + return -1; } static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params)