Detecting race start slots
#3

pawn Код:
enum info
{
     pRace
}
new PlayerInfo[MAX_PLAYERS][info];
CMD:joinrace(playerid)
{
  //Your IsPlayerInHisOwnVehicle
  //Other conditions
  new temp=0;
  for(new i;i<MAX_PLAYERS;i++)
  {
   if(PlayerInfo[i][pRace]==1
   if(temp==6) temp = -1;
   else temp++;
   
   }
   switch(temp)
   {
    case 1..5:
    {//Teleport him to race and watever
    PlayerInfo[playerid][pRace]=1;
    }
     case -1: //Sorry, race's full.
    }
    return 1;
}
Something like this, if you use an enum!
Reply


Messages In This Thread
Detecting race start slots - by jibileu - 08.02.2013, 01:00
Re: Detecting race start slots - by Vexus - 08.02.2013, 08:17
Re: Detecting race start slots - by RajatPawar - 08.02.2013, 08:25

Forum Jump:


Users browsing this thread: 2 Guest(s)