22.03.2013, 08:17
Quote:
Hey, this command should tell players how many admins online are there right? Why dend a query for it?
|
pawn Код:
bool:IsAdminOnline(adminid)
{
if( !IsPlayerAdmin( adminid )) // If the ID provided isn't an admin, this function should return false.
return false;
foreach( Player, i )
{
if( adminid == i ) // If the ID provided equals on of the online IDs (which foreach fetches for us) - then the player is online
return true;
}
return false; // All other cases: Return false.
}
pawn Код:
bool:IsAdminOnline(adminid)
{
for( new i = 0, j = GetMaxPlayers(); i < j; i ++ )
{
if( adminid == i && IsPlayerAdmin( adminid ) && IsPlayerConnected( adminid )) // If the ID provided equals on of the online IDs (which foreach fetches for us) - then the player is online
return true;
}
return false; // All other cases: Return false.
}