SA-MP Forums Archive
[QUESTION] Checking for if someone is offline - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [QUESTION] Checking for if someone is offline (/showthread.php?tid=139963)



[QUESTION] Checking for if someone is offline - CuervO - 07.04.2010

I'm trying to finish my Anticheat and i am making it so when there is no admins online, instead of warning the admins it will Kick the player; is there any way to detect if there aren't admins online?


Very Thankfully and sorry for wasting your time


Re: [QUESTION] Checking for if someone is offline - Carlton - 07.04.2010

pawn Код:
new adminson = 0;
for(new i = 0; i < MAX_PLAYERS; i ++ ) {
  if(IsPlayerConnected(i)) {
    if(IsPlayerAdmin(i)) {
      adminson ++;
    }
  }
}
if(adminson == 0 ) {
  print("Your code here if there's no admins on");
}



Re: [QUESTION] Checking for if someone is offline - CuervO - 07.04.2010

Very Thankfully

_________________________________________________


i only used the variables thingy, not the loop thru the players, Thank you; it works perfectly

(6/4/2010)[22:56:21] Anticheat Has Kicked CuervO for: Weapon Hacking [Chainsaw]
(6/4/2010)[23:1:56] Anticheat Has Kicked CuervO for: Weapon Hacking [Chainsaw]
(6/4/2010)[23:7:27] Anticheat Has Kicked CuervO for: Weapon Hacking [Chainsaw]
(6/4/2010)[23:12:14] Anticheat Has Kicked CuervO for: Weapon Hacking [Minigun]

That was when i wasn't an admin, so no admins online were atm