Race Create
#8

pawn Код:
//Wherever you want to start the race
SetPlayerRaceCheckpoint(i, 0, 0.0, 0.0, 0.0, 5.0, 5.0, 5.0, 20.0);
SetPVarInt(playerid, "Race", 1);
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  switch(GetPVarInt(playerid, "Race"))
  {
    case 1:
    {
      DisablePlayerRaceCheckpoint(playerid);
      switch(GetPVarInt(playerid, "Status"))
      { //Sure you could do that with an array as well but I dont like to waste memory
        case 0: SetPlayerRaceCheckpoint(playerid, 0,    5.0,    5.0,    5.0,    10.0,   10.0,   10.0,   20.0);
        case 1: SetPlayerRaceCheckpoint(playerid, 0,    10.0,   10.0,   10.0,   -3.0,   -3.0,   -3.0,   20.0);
        case 2: SetPlayerRaceCheckpoint(playerid, 0,    -3.0,   -3.0,   -3.0,   2.0,    2.0,    2.0,    20.0);
        case 3: SetPlayerRaceCheckpoint(playerid, 1,    2.0,    2.0,    2.0,    0.0,    0.0,    0.0,    20.0);
        case 4:
        {
          new string[64];
          static Ranks;
          GetPlayerName(playerid, string, MAX_PLAYER_NAME);
          switch(++Rank)
          {
            case 1: format(string, sizeof string, "~r~%s ~b~won the race (race1)", string);
            case 2: format(string, sizeof string, "~r~%s ~b~is second (race1)", string);
            case 3: format(string, sizeof string, "~r~%s ~b~is third (race1)", string);
          }
          DeletePVar(playerid, "Race");
          DeletePVar(playerid, "Status");
          SendClientMessageToAll(0xFF0000AA, string);
          return GivePlayerMoney(playerid, Rank * 5000);
        }
      }
      return SetPVarInt(playerid, "Status", GetPVarInt(playerid, "Status") + 1);
    }
  }
}
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)