count cops online
#1

PlayerInfo[playerid][profession] == COP


Im making a command that should give money depeending on how many cops are in server! :P
How can I count COPS in an efficient way?
Reply
#2

pawn Код:
new count;
for(new i; i<MAX_PLAYERS; i++)
{
    if(!IsPlayerConnected(i)) continue;
    if(PlayerInfo[i][profession] == COP) count ++;
}
printf("%d", count); //Will return the # of cops.
Reply
#3

Thanks a lot Killer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)