Race Create
#5

I don't know how i can do, but i can think logically:

like.. Create an Array with the co-ordinates the CP's gonna be:
pawn Код:
new Status[MAX_PLAYERS];
new CheckPoints[4][3] = //4 = 4 slots | 3 = 3 "values" (X,Y,Z)
{
     {X,Y,Z},
     {X,Y,Z},
     {X,Y,Z},
     {X,Y,Z}
};
Then start the race..
pawn Код:
if(strcmp(cmdtext, "/start", true) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
         for(new i = 0; i < GetMaxPlayers(); i++)
         {
              if(IsPlayerConnected(i)) //to every1 in teh server
              {            //0 = normal-------1 = slot 1 | 1 = X---
                  SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);//10 maybe??
                  Statur[i] = 1;
                  return 1;
              }
         }
     }
     else
     {
         SendClientMessage(playerid, COLOR_RED, "Only for admin's");
     }
}
Then when entering CP:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
     switch(Status[playerid])
     {
         case 1:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
              Status[i] = 2;
              return 1;
         }
         case 2:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
              Status[i] = 3;
              return 1;
         }
         case 3:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10); //so it looks down
              Status[i] = 4;
              return 1;
         }
         case 4:
         {
              DisablePlayerRaceCheckpoint(playerid);
              GameTextForPlayer(playerid, "You have won the race!!", 3000, 1);
              GivePlayerMoney(playerid, 10000);
              return 1;
         }
     }
}
Sorry if this is noobish but i try as hard as i can
hope this helps
Reply


Messages In This Thread
Race Create - by Warriors_Tornado - 07.02.2008, 19:46
Re: Race Create - by cmg4life - 09.03.2008, 09:46
Re: Race Create - by Jim_Johny - 09.03.2008, 10:36
Re: Race Create - by [IB]Scorcher - 09.03.2008, 10:41
Re: Race Create - by pspleo - 09.03.2008, 11:14
Re: Race Create - by Rodrigo_Vilhena - 12.06.2010, 23:17
Re: Race Create - by Flashy - 12.06.2010, 23:27
Re: Race Create - by Nero_3D - 13.06.2010, 00:08
Re: Race Create - by [HiC]TheKiller - 13.06.2010, 00:35
Re: Race Create - by LeBron141 - 18.06.2011, 18:37

Forum Jump:


Users browsing this thread: 1 Guest(s)