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

This commit is contained in:
RD42
2024-04-27 18:16:08 +08:00
parent c7992ab797
commit 8283f96357
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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;
}