Cops counting problem
#1

Hey all!
I made a bank robbery system and i made in it count of the cops in the server - each cop logins to the server so counting +1, the problem is when the cop disconnect its still +1 and not -1, what's wrong?
For bank robbery the robber needs at least 4 cops online.... 4 connected and one leave - he still can rob... :/
there is the code of cop counting online:

Код:
#pragma unused params
		if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < MAX_PLAYERS; i ++)
			{
				if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
				{
				LEOOnline++;
				}
			}
				if(LEOOnline < 4)
	    		{
	    		    SendClientMessage(playerid, COLOR_GRAD3, "You need at least 4 Law Enforcement officers!");
	 	        	return 1;
				}
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)