diff --git a/server/playerpool.h b/server/playerpool.h index a40c3b0..5b368b2 100644 --- a/server/playerpool.h +++ b/server/playerpool.h @@ -29,7 +29,7 @@ private: BOOL m_bIsAnAdmin[MAX_PLAYERS]; BOOL m_bIsAnNPC[MAX_PLAYERS]; - char _gap2CAE4[8000]; + char _gap2EA24[8000]; int field_30964; int field_30968; @@ -58,7 +58,10 @@ public: memset(&m_iPlayerScore[0],0,sizeof(int) * MAX_PLAYERS); memset(&m_iPlayerMoney[0],0,sizeof(int) * MAX_PLAYERS); memset(&m_iVirtualWorld[0],0,sizeof(int) * MAX_PLAYERS); - } + }; + + BOOL IsAdmin(PLAYERID playerId) { return m_bIsAnAdmin[playerId]; }; + }; #endif diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index ea0f0b8..94e62d2 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -523,9 +523,16 @@ static cell AMX_NATIVE_CALL n_GangZoneStopFlashForAll(AMX *amx, cell *params) return 0; } +// native IsPlayerAdmin(playerid) static cell AMX_NATIVE_CALL n_IsPlayerAdmin(AMX *amx, cell *params) { - // TODO: IsPlayerAdmin + CHECK_PARAMS(1); + CPlayerPool* pPlayerPool = pNetGame->GetPlayerPool(); + + if (pPlayerPool->GetSlotState((PLAYERID)params[1])) + { + return pPlayerPool->IsAdmin((PLAYERID)params[1]); + } return 0; }