May i have some help
#1

it is leting more then 10 people enter the bike madness please help.

pawn Код:
{
                    {
                        if(IsBIKEMADNESSactive == 0)
                        {
                            SendClientMessage(playerid,RED,"You have join the bike madness");
                            IsPlayersInBikeMadness += 1;
                            SetPlayerPos(playerid,-1071.4938,-692.1391,368.5030);
                            return 1;
                        }
                        if(IsPlayersInBikeMadness == 10)
                        {
                            SendClientMessage(playerid,RED,"The bike madness is full");
                            IsBIKEMADNESSactive = 1;
                            return 1;
                        }
                        if(IsBIKEMADNESSactive == 1)
                        {
                            SendClientMessage(playerid,RED,"There is all redey a group in the bike madness");
                            return 1;
                        }
                    }
                }
Reply
#2

pawn Код:
if(IsPlayersInBikeMadness == 10)
By the code above you check if there is exactly 10 players in the bike madness. Which means it won't get called when there is 11, 12, 13 players... and so on.

You would simply change it to this:
pawn Код:
if(IsPlayersInBikeMadness >= 10)
This checks if there is 10 or more players in the bike madness. I assume that's the only part you got not to work correctly.
Reply
#3

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
pawn Код:
if(IsPlayersInBikeMadness == 10)
By the code above you check if there is exactly 10 players in the bike madness. Which means it won't get called when there is 11, 12, 13 players... and so on.

You would simply change it to this:
pawn Код:
if(IsPlayersInBikeMadness >= 10)
This checks if there is 10 or more players in the bike madness. I assume that's the only part you got not to work correctly.
Lol it shouldn't matter, since the 11th player shouldn't be able to enter and It should never have to check for the rest.
Reply
#4

The problem is basic flow of logic flaw. Your script is adding a player and then returning without even checking how many players are joined.
pawn Код:
if(IsBIKEMADNESSactive == 0)
{                            
   
    SendClientMessage(playerid,RED,"You have join the bike madness");
    IsPlayersInBikeMadness += 1;
    SetPlayerPos(playerid,-1071.4938,-692.1391,368.5030);
    if(IsPlayersInBikeMadness >= 10 )  
    {
            IsBIKEMADNESSactive = 1;
    }
    return 1;
} else {
    SendClientMessage(playerid,RED,"There is all redey a group in the bike madness");
    return 1;  
}
Reply
#5

Maybe a little offtopic but

pawn Код:
SendClientMessage(playerid,RED,"There is all redey a group in the bike madness");
"Redey" should be "Ready"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)