Big Problem
#3

yes. you are first looping through the boxslots. i presume there are more than 1, so the check for being online is done twice.
due to the fact the player is checked twice, and his boxslot will match twice too, you only need to swap the first 2 conditions checked:
first "is player connected?", then "check all boxslots":
Код:
	if(IsPlayerConnected(i))
	{
		for(new i = 0;i < BOXSLOTS; i++)
		{
			if(PlayersInBoxRing[i] == 0)
			{
				PlayersInBoxRing[i]++;
				format(string,sizeof(string),"%s joined the Boxring!",name);
				SendClientMessageToAll(COLOR_GREEN,string);
				return 1;
			}
			else if(PlayersInBoxRing[i] == 1)
			{
				PlayersInBoxRing[i]++;
				format(string,sizeof(string),"%s joined the Boxring as Challenger!",name);
				SendClientMessageToAll(COLOR_GREEN,string);
				return 1;
			}
			else if(PlayersInBoxRing[i] <= 2)
			{
				SendClientMessage(playerid,COLOR_RED,"Their are already 2 Guys Boxing!");
				return 1;
			}
		}
	}
the variable "i" is assigned to IsPlayerConnected(i) and used in the loop (BOXSLOTS), so the "i" will be resetted to 0 anyways, and should cause a warning like:
warning 219: local variable "i" shadows a variable at a preceding level
...try another variable like "playerid" in IsPlayerConnected()...
Код:
	if(IsPlayerConnected(playerid))
	{
maybe this helps you fixing the problem too...
you also could print out a small string just for repeat-checking at each loopstart...
Reply


Messages In This Thread
Big Problem - by Bearfist - 25.12.2009, 09:50
Re: Big Problem - by DeathOnaStick - 25.12.2009, 11:22
Re: Big Problem - by Babul - 25.12.2009, 12:23
Re: Big Problem - by Bearfist - 25.12.2009, 17:06
Re: Big Problem - by Bearfist - 28.12.2009, 20:08
Re: Big Problem - by Babul - 28.12.2009, 21:55

Forum Jump:


Users browsing this thread: 1 Guest(s)