mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[server] Implement and match n_IsPlayerNPC(...)
This commit is contained in:
parent
8283f96357
commit
fdd891098b
@ -62,6 +62,8 @@ public:
|
||||
|
||||
BOOL IsAdmin(PLAYERID playerId) { return m_bIsAnAdmin[playerId]; };
|
||||
|
||||
BOOL IsNPC(PLAYERID playerId) { return m_bIsAnNPC[playerId]; };
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -397,10 +397,24 @@ static cell AMX_NATIVE_CALL n_ConnectNPC(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// native IsPlayerNPC(playerid)
|
||||
static cell AMX_NATIVE_CALL n_IsPlayerNPC(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: IsPlayerNPC
|
||||
return 0;
|
||||
BOOL bResult = FALSE;
|
||||
|
||||
if(pNetGame)
|
||||
{
|
||||
CPlayerPool* pPlayerPool = pNetGame->GetPlayerPool();
|
||||
|
||||
if(pPlayerPool && pPlayerPool->GetSlotState((PLAYERID)params[1]))
|
||||
{
|
||||
if(pPlayerPool->IsNPC((PLAYERID)params[1]))
|
||||
{
|
||||
bResult = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL n_Create3DTextLabel(AMX *amx, cell *params)
|
||||
|
Loading…
Reference in New Issue
Block a user