Cops counting problem
#2

Do you dicrease it by 1 after the player (who is cop) disconnects?

Well, you can do it easier with foreach. It'll loop faster through the online cops, plus it counts too.

For example:
pawn Код:
// Global
new
    Iterator:Cop<MAX_PLAYERS>
;

// Where he gets cop status or loggin and being set as cop:
Iter_Add(Cop, playerid);

// When a player leaves the cop status or disconnects:
Iter_Remove(Cop, playerid);

// For bank robbery - count the cops
if( Iter_Count(Cop) >= 4 )
{
    // robber can rob!
}
else // send an error message that he cannot rob when there are not atleast 4 cops online.
Reply


Messages In This Thread
Cops counting problem - by Lidor124 - 25.09.2013, 09:06
Re: Cops counting problem - by Konstantinos - 25.09.2013, 09:18
Re: Cops counting problem - by =KempeR= - 25.09.2013, 09:25
Re: Cops counting problem - by Lidor124 - 25.09.2013, 09:25

Forum Jump:


Users browsing this thread: 1 Guest(s)