mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 20:26:14 +08:00
[server] Implement and match n_IsPlayerAdmin(...)
This commit is contained in:
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user