SA-MP Forums Archive
May i have some help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: May i have some help (/showthread.php?tid=218849)



May i have some help - yarrum3 - 31.01.2011

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;
                        }
                    }
                }



Re: May i have some help - Mikkel_Pedersen - 31.01.2011

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.


Re: May i have some help - Mike Garber - 31.01.2011

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.


Re: May i have some help - Rachael - 31.01.2011

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;  
}



Re: May i have some help - alpha500delta - 31.01.2011

Maybe a little offtopic but

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