mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement n_IsPlayerConnected(...)
This commit is contained in:
parent
0e726e656e
commit
e4770acd44
@ -70,6 +70,7 @@ public:
|
||||
|
||||
int GetGameState() { return m_iGameState; };
|
||||
|
||||
CPlayerPool * GetPlayerPool() { return m_pPlayerPool; };
|
||||
RakClientInterface * GetRakClient() { return m_pRakClient; };
|
||||
|
||||
void Init(PCHAR szHostOrIp,int iPort,PCHAR szPlayerName,PCHAR szPass,PCHAR szNpcMode);
|
||||
|
@ -25,4 +25,10 @@ public:
|
||||
|
||||
BOOL Delete(PLAYERID playerId, BYTE byteReason);
|
||||
|
||||
// Find out if the slot is inuse.
|
||||
BOOL GetSlotState(PLAYERID playerId) {
|
||||
if(playerId >= MAX_PLAYERS) { return FALSE; }
|
||||
return m_bPlayerSlotState[playerId];
|
||||
};
|
||||
|
||||
};
|
@ -248,8 +248,9 @@ static cell AMX_NATIVE_CALL n_GetPlayerName(AMX *amx, cell *params)
|
||||
// native IsPlayerConnected(playerid)
|
||||
static cell AMX_NATIVE_CALL n_IsPlayerConnected(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_IsPlayerConnected
|
||||
return 0;
|
||||
PLAYERID playerId = (PLAYERID)params[1];
|
||||
if (playerId >= MAX_PLAYERS || pNetGame->GetPlayerPool()->GetSlotState(playerId)) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user