Advertisement
tuzn13

FS Race

Jan 29th, 2020
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 73.63 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf>
  4. #include <DOF2>
  5. #include <string>
  6. #include <cpstream>
  7. #include <streamer>
  8.  
  9. #define Red                                                                     0xFF0000FF
  10. #define Pink                                                                    0xFF44AAFF
  11.  
  12. #define pasta_race          "/Races/%02d.ini"
  13. #define pasta_veiculos      "/Veiculos/%02d.ini"
  14. #undef MAX_PLAYERS
  15. #define MAX_PLAYERS 50
  16.  
  17. new bool:EventoIniciou;
  18. new Anuncio;
  19. new TimerCountCP[MAX_PLAYERS];
  20. new bool:AutoRepararX[MAX_PLAYERS];
  21. new Text:TextdrawAnuncio;
  22. new PlayerText:TextContar[MAX_PLAYERS+1];
  23. new PlayerText:InicioRace0[MAX_PLAYERS];
  24. new PlayerText:InicioRace1[MAX_PLAYERS];
  25. new PlayerText:InicioRace2[MAX_PLAYERS];
  26. new PlayerText:InicioRace3[MAX_PLAYERS];
  27. new PlayerText:InicioRace4[MAX_PLAYERS];
  28. new PlayerText:InicioRace5[MAX_PLAYERS];
  29. new PlayerText:InicioRace6[MAX_PLAYERS];
  30. new PlayerText:InicioRace7[MAX_PLAYERS];
  31. new PlayerText:Textdraw0[MAX_PLAYERS];
  32. new PlayerText:Textdraw1[MAX_PLAYERS];
  33. new PlayerText:Textdraw2[MAX_PLAYERS];
  34. new PlayerText:Textdraw5[MAX_PLAYERS];
  35. new PlayerText:Textdraw6[MAX_PLAYERS];
  36. new PlayerText:Textdraw7[MAX_PLAYERS];
  37. new PlayerText:Textdraw8[MAX_PLAYERS];
  38. new PlayerText:Textdraw9[MAX_PLAYERS];
  39. new PlayerText:Textdraw10[MAX_PLAYERS];
  40. new PlayerText:CPConquistado[MAX_PLAYERS];
  41. /*new Colocados[MAX_PLAYERS];
  42. new AtualizarText[MAX_PLAYERS];*/
  43. new String[128],
  44.     String2[128],
  45.     String3[128],
  46.     String4[128],
  47.     String5[128],
  48.     String6[128],
  49.     Primeiro[50],
  50.     Segundo[50],
  51.     Terceiro[50],
  52.     Quarto[50],
  53.     Quinto[50];
  54. new bool:Colision = false;
  55. new bool:AlguemGanhou[MAX_PLAYERS] = false;
  56. new Terminou = 0;
  57. new Lugar[MAX_PLAYERS];
  58. new PlayersEvento;
  59. new PlayerText:TempoCorrida[MAX_PLAYERS];
  60. new AutoReparar[MAX_PLAYERS];
  61. new bool:Congelado = true;
  62. new bool:Status = false; // DEFINE SE O EVENTO ESTÁ FECHADO OU ABERTO. FALSE SE ESTIVER ABERTO
  63. new Float:PosEvento[3];
  64. new Vagas = 0;
  65. new IRVeiculos;
  66. new bool:Evento[MAX_PLAYERS] = false;
  67. new bool:EventoCriado = false;
  68. new Count[MAX_PLAYERS];
  69. new TimerCount[MAX_PLAYERS];
  70. new TempoMinimo[3];
  71. new Tempo[MAX_PLAYERS][4];
  72. new TempoRecorde[MAX_PLAYERS];
  73. new TamanhoCPS = 15;
  74. new Float:CP[3];
  75. new CPCountX[MAX_PLAYERS];
  76. new CPCountY[MAX_PLAYERS];
  77. new CPCountZ[MAX_PLAYERS];
  78. new str[128];
  79. new CPCount;
  80. new AddCP[MAX_PLAYERS] = 0; // Checkpoints conquistados pelo jogador(a)
  81. new TotalCPS;
  82. new RaceName;
  83. new bool:CriacaoAndamento = false;
  84. new bool:CPAtivado = false;
  85. new CPCarregado;
  86. new CPID;
  87. new Float:Position[4];
  88. new PosV = 0;
  89. new DistanciaV = 4;
  90. new Veiculo[MAX_VEHICLES];
  91. new TotalVeiculos;
  92. new Float:Pos[4];
  93. new Cor[2] = 1;
  94. new Modelo;
  95. new Str[128];
  96. new IDVeiculos;
  97. new bool:Salvando = false;
  98. public OnFilterScriptInit()
  99. {
  100.     print("\n--------------------------------------");
  101.     print(" Race filterscript by Gami");
  102.     print("--------------------------------------\n");
  103.     CriacaoAndamento = false;
  104.     CPAtivado = false;
  105.     RaceName = CPID;
  106.     IRVeiculos = 0;
  107.    
  108.     TextdrawAnuncio = TextDrawCreate(306.399871, 153.315612, "");
  109.     TextDrawLetterSize(TextdrawAnuncio, 0.322797, 1.943465);
  110.     TextDrawAlignment(TextdrawAnuncio, 2);
  111.     TextDrawSetShadow(TextdrawAnuncio, 0);
  112.     TextDrawSetOutline(TextdrawAnuncio, -1);
  113.     TextDrawBackgroundColor(TextdrawAnuncio, 51);
  114.     TextDrawFont(TextdrawAnuncio, 1);
  115.     TextDrawSetProportional(TextdrawAnuncio, 1);
  116.  
  117.     for(new I = 0; I < MAX_PLAYERS+1; I++){
  118.    
  119.  
  120.         CPConquistado[I] = CreatePlayerTextDraw(I, 321.199920, 359.893463, "");
  121.         PlayerTextDrawLetterSize(I, CPConquistado[I], 0.449999, 1.600000);
  122.         PlayerTextDrawAlignment(I, CPConquistado[I], 2);
  123.         PlayerTextDrawColor(I, CPConquistado[I], -1);
  124.         PlayerTextDrawSetShadow(I, CPConquistado[I], 0);
  125.         PlayerTextDrawSetOutline(I, CPConquistado[I], -1);
  126.         PlayerTextDrawBackgroundColor(I, CPConquistado[I], 51);
  127.         PlayerTextDrawFont(I, CPConquistado[I], 2);
  128.         PlayerTextDrawSetProportional(I, CPConquistado[I], 1);
  129.  
  130.  
  131.  
  132.         Textdraw10[I] = CreatePlayerTextDraw(I, 530.399963, 212.551101, "9|:");
  133.         PlayerTextDrawLetterSize(I, Textdraw10[I], 0.203997, 2.172444);
  134.         PlayerTextDrawAlignment(I, Textdraw10[I], 1);
  135.         PlayerTextDrawColor(I, Textdraw10[I], -1);
  136.         PlayerTextDrawSetShadow(I, Textdraw10[I], 0);
  137.         PlayerTextDrawSetOutline(I, Textdraw10[I], 1);
  138.         PlayerTextDrawBackgroundColor(I, Textdraw10[I], 51);
  139.         PlayerTextDrawFont(I, Textdraw10[I], 1);
  140.         PlayerTextDrawSetProportional(I, Textdraw10[I], 1);
  141.  
  142.         Textdraw0[I] = CreatePlayerTextDraw(I, 530.799987, 104.540000, "usebox");
  143.         PlayerTextDrawLetterSize(I, Textdraw0[I], 0.000000, 20.589998);
  144.         PlayerTextDrawTextSize(I, Textdraw0[I], 632.000000, 0.000000);
  145.         PlayerTextDrawAlignment(I, Textdraw0[I], 1);
  146.         PlayerTextDrawColor(I, Textdraw0[I], 0);
  147.         PlayerTextDrawUseBox(I, Textdraw0[I], true);
  148.         PlayerTextDrawBoxColor(I, Textdraw0[I], 102);
  149.         PlayerTextDrawSetShadow(I, Textdraw0[I], 0);
  150.         PlayerTextDrawSetOutline(I, Textdraw0[I], 0);
  151.         PlayerTextDrawFont(I, Textdraw0[I], 0);
  152.  
  153.         Textdraw1[I] = CreatePlayerTextDraw(I, 581.200683, 105.031028, "Race Info");
  154.         PlayerTextDrawLetterSize(I, Textdraw1[I], 0.179600, 0.942933);
  155.         PlayerTextDrawTextSize(I, Textdraw1[I], 381.199920, 101.546730);
  156.         PlayerTextDrawAlignment(I, Textdraw1[I], 2);
  157.         PlayerTextDrawColor(I, Textdraw1[I], 255);
  158.         PlayerTextDrawUseBox(I, Textdraw1[I], true);
  159.         PlayerTextDrawBoxColor(I, Textdraw1[I], -5963521);
  160.         PlayerTextDrawSetShadow(I, Textdraw1[I], 0);
  161.         PlayerTextDrawSetOutline(I, Textdraw1[I], 0);
  162.         PlayerTextDrawBackgroundColor(I, Textdraw1[I], 51);
  163.         PlayerTextDrawFont(I, Textdraw1[I], 2);
  164.         PlayerTextDrawSetProportional(I, Textdraw1[I], 1);
  165.  
  166.         Textdraw2[I] = CreatePlayerTextDraw(I, 530.000000, 117.973381, "~y~~h~1|:  ~r~Ninguem");
  167.         PlayerTextDrawLetterSize(I, Textdraw2[I], 0.157999, 1.077331);
  168.         PlayerTextDrawAlignment(I, Textdraw2[I], 1);
  169.         PlayerTextDrawColor(I, Textdraw2[I], -1);
  170.         PlayerTextDrawSetShadow(I, Textdraw2[I], 0);
  171.         PlayerTextDrawSetOutline(I, Textdraw2[I], 1);
  172.         PlayerTextDrawBackgroundColor(I, Textdraw2[I], 51);
  173.         PlayerTextDrawFont(I, Textdraw2[I], 1);
  174.         PlayerTextDrawSetProportional(I, Textdraw2[I], 1);
  175.     /*
  176.         Textdraw3[I] = CreatePlayerTextDraw(I, 557.599975, 271.288970, "/10");
  177.         PlayerTextDrawLetterSize(I, Textdraw3[I], 0.409999, 2.072885);
  178.         PlayerTextDrawAlignment(I, Textdraw3[I], 1);
  179.         PlayerTextDrawColor(I, Textdraw3[I], -1378294017);
  180.         PlayerTextDrawSetShadow(I, Textdraw3[I], 0);
  181.         PlayerTextDrawSetOutline(I, Textdraw3[I], 1);
  182.         PlayerTextDrawBackgroundColor(I, Textdraw3[I], 51);
  183.         PlayerTextDrawFont(I, Textdraw3[I], 3);
  184.         PlayerTextDrawSetProportional(I, Textdraw3[I], 1);
  185.  
  186.         Textdraw4[I] = CreatePlayerTextDraw(I, 532.800048, 250.880004, "2|");
  187.         PlayerTextDrawLetterSize(I, Textdraw4[I], 0.607999, 3.964443);
  188.         PlayerTextDrawAlignment(I, Textdraw4[I], 1);
  189.         PlayerTextDrawColor(I, Textdraw4[I], -1378294017);
  190.         PlayerTextDrawSetShadow(I, Textdraw4[I], 0);
  191.         PlayerTextDrawSetOutline(I, Textdraw4[I], 1);
  192.         PlayerTextDrawBackgroundColor(I, Textdraw4[I], 51);
  193.         PlayerTextDrawFont(I, Textdraw4[I], 3);
  194.         PlayerTextDrawSetProportional(I, Textdraw4[I], 1)
  195.     */
  196.         Textdraw5[I] = CreatePlayerTextDraw(I, 603.599792, 272.782257, "x/x");
  197.         PlayerTextDrawLetterSize(I, Textdraw5[I], 0.275999, 1.600000);
  198.         PlayerTextDrawAlignment(I, Textdraw5[I], 1);
  199.         PlayerTextDrawColor(I, Textdraw5[I], -2147483393);
  200.         PlayerTextDrawSetShadow(I, Textdraw5[I], 0);
  201.         PlayerTextDrawSetOutline(I, Textdraw5[I], 1);
  202.         PlayerTextDrawBackgroundColor(I, Textdraw5[I], 51);
  203.         PlayerTextDrawFont(I, Textdraw5[I], 1);
  204.         PlayerTextDrawSetProportional(I, Textdraw5[I], 1);
  205.  
  206.         Textdraw6[I] = CreatePlayerTextDraw(I, 530.000000, 134.897872, "~y~~h~2|:  ~r~Ninguem");
  207.         PlayerTextDrawLetterSize(I, Textdraw6[I], 0.157999, 1.077331);
  208.         PlayerTextDrawAlignment(I, Textdraw6[I], 1);
  209.         PlayerTextDrawColor(I, Textdraw6[I], -1);
  210.         PlayerTextDrawSetShadow(I, Textdraw6[I], 0);
  211.         PlayerTextDrawSetOutline(I, Textdraw6[I], 1);
  212.         PlayerTextDrawBackgroundColor(I, Textdraw6[I], 51);
  213.         PlayerTextDrawFont(I, Textdraw6[I], 1);
  214.         PlayerTextDrawSetProportional(I, Textdraw6[I], 1);
  215.  
  216.         Textdraw7[I] = CreatePlayerTextDraw(I, 530.000000, 152.817825, "~y~~h~3|:  ~r~Ninguem");
  217.         PlayerTextDrawLetterSize(I, Textdraw7[I], 0.157999, 1.077331);
  218.         PlayerTextDrawAlignment(I, Textdraw7[I], 1);
  219.         PlayerTextDrawColor(I, Textdraw7[I], -1);
  220.         PlayerTextDrawSetShadow(I, Textdraw7[I], 0);
  221.         PlayerTextDrawSetOutline(I, Textdraw7[I], 1);
  222.         PlayerTextDrawBackgroundColor(I, Textdraw7[I], 51);
  223.         PlayerTextDrawFont(I, Textdraw7[I], 1);
  224.         PlayerTextDrawSetProportional(I, Textdraw7[I], 1);
  225.  
  226.         Textdraw8[I] = CreatePlayerTextDraw(I, 529.599975, 172.231155, "~y~~h~4|:  ~r~Ninguem");
  227.         PlayerTextDrawLetterSize(I, Textdraw8[I], 0.157999, 1.077331);
  228.         PlayerTextDrawAlignment(I, Textdraw8[I], 1);
  229.         PlayerTextDrawColor(I, Textdraw8[I], -1);
  230.         PlayerTextDrawSetShadow(I, Textdraw8[I], 0);
  231.         PlayerTextDrawSetOutline(I, Textdraw8[I], 1);
  232.         PlayerTextDrawBackgroundColor(I, Textdraw8[I], 51);
  233.         PlayerTextDrawFont(I, Textdraw8[I], 1);
  234.         PlayerTextDrawSetProportional(I, Textdraw8[I], 1);
  235.  
  236.         Textdraw9[I] = CreatePlayerTextDraw(I, 530.000000, 189.653366, "~y~~h~5|:  ~r~Ninguem");
  237.         PlayerTextDrawLetterSize(I, Textdraw9[I], 0.157999, 1.077331);
  238.         PlayerTextDrawAlignment(I, Textdraw9[I], 1);
  239.         PlayerTextDrawColor(I, Textdraw9[I], -1);
  240.         PlayerTextDrawSetShadow(I, Textdraw9[I], 0);
  241.         PlayerTextDrawSetOutline(I, Textdraw9[I], 1);
  242.         PlayerTextDrawBackgroundColor(I, Textdraw9[I], 51);
  243.         PlayerTextDrawFont(I, Textdraw9[I], 1);
  244.         PlayerTextDrawSetProportional(I, Textdraw9[I], 1);
  245.    
  246.    
  247.    
  248.  
  249.         TempoCorrida[I] = CreatePlayerTextDraw(I, 14.400009, 238.933471, "00:00:00");
  250.         PlayerTextDrawFont(I, TempoCorrida[I], 1);
  251.         PlayerTextDrawLetterSize(I, TempoCorrida[I], 0.225000, 1.251000);
  252.         PlayerTextDrawColor(I, TempoCorrida[I], -1);
  253.         PlayerTextDrawSetOutline(I, TempoCorrida[I], 1);
  254.         PlayerTextDrawSetProportional(I, TempoCorrida[I], 1);
  255.  
  256.         TextContar[I] = CreatePlayerTextDraw(I, 229.200103, 361.386688, "");
  257.         PlayerTextDrawLetterSize(I, TextContar[I], 0.449999, 1.600000);
  258.         PlayerTextDrawAlignment(I, TextContar[I], 1);
  259.         PlayerTextDrawColor(I, TextContar[I], -1);
  260.         PlayerTextDrawSetShadow(I, TextContar[I], 0);
  261.         PlayerTextDrawSetOutline(I, TextContar[I], 1);
  262.         PlayerTextDrawBackgroundColor(I, TextContar[I], 51);
  263.         PlayerTextDrawFont(I, TextContar[I], 1);
  264.         PlayerTextDrawSetProportional(I, TextContar[I], 1);
  265.  
  266.  
  267.         InicioRace0[I] = CreatePlayerTextDraw(I, 150.800003, 255.366668, "usebox"); // BOX
  268.         PlayerTextDrawLetterSize(I, InicioRace0[I], 0.000000, 6.430986);
  269.         PlayerTextDrawTextSize(I, InicioRace0[I], 12.400000, 0.000000);
  270.         PlayerTextDrawAlignment(I, InicioRace0[I], 1);
  271.         PlayerTextDrawColor(I, InicioRace0[I], 0);
  272.         PlayerTextDrawUseBox(I, InicioRace0[I], true);
  273.         PlayerTextDrawBoxColor(I, InicioRace0[I], 102);
  274.         PlayerTextDrawSetShadow(I, InicioRace0[I], 0);
  275.         PlayerTextDrawSetOutline(I, InicioRace0[I], 0);
  276.         PlayerTextDrawFont(I, InicioRace0[I], 0);
  277.  
  278.         InicioRace7[I] = CreatePlayerTextDraw(I, 81.431015, 255.857666, "Race Info");
  279.         PlayerTextDrawLetterSize(I, InicioRace7[I], 0.169600, 1.375999);
  280.         PlayerTextDrawTextSize(I, InicioRace7[I], 3814.800292, 130.915496);
  281.         PlayerTextDrawAlignment(I, InicioRace7[I], 2);
  282.         PlayerTextDrawColor(I, InicioRace7[I], 255);
  283.         PlayerTextDrawUseBox(I, InicioRace7[I], true);
  284.         PlayerTextDrawBoxColor(I, InicioRace7[I], -1523963137);
  285.         PlayerTextDrawSetShadow(I, InicioRace7[I], 0);
  286.         PlayerTextDrawSetOutline(I, InicioRace7[I], 0);
  287.         PlayerTextDrawBackgroundColor(I, InicioRace7[I], 51);
  288.         PlayerTextDrawFont(I, InicioRace7[I], 2);
  289.         PlayerTextDrawSetProportional(I, InicioRace7[I], 1);
  290.  
  291.         InicioRace1[I] = CreatePlayerTextDraw(I, 16.400007, 270.791229, "~b~~h~Checkpoints ID:");
  292.         PlayerTextDrawLetterSize(I, InicioRace1[I], 0.262000, 1.127111);
  293.         PlayerTextDrawAlignment(I, InicioRace1[I], 1);
  294.         PlayerTextDrawColor(I, InicioRace1[I], -1);
  295.         PlayerTextDrawSetShadow(I, InicioRace1[I], 0);
  296.         PlayerTextDrawSetOutline(I, InicioRace1[I], 1);
  297.         PlayerTextDrawBackgroundColor(I, InicioRace1[I], 51);
  298.         PlayerTextDrawFont(I, InicioRace1[I], 1);
  299.         PlayerTextDrawSetProportional(I, InicioRace1[I], 1);
  300.  
  301.  
  302.         InicioRace2[I] = CreatePlayerTextDraw(I, 91.199966, 270.791137, "");
  303.         PlayerTextDrawLetterSize(I, InicioRace2[I], 0.261999, 1.127110);
  304.         PlayerTextDrawAlignment(I, InicioRace2[I], 1);
  305.         PlayerTextDrawColor(I, InicioRace2[I], -1);
  306.         PlayerTextDrawSetShadow(I, InicioRace2[I], 0);
  307.         PlayerTextDrawSetOutline(I, InicioRace2[I], 1);
  308.         PlayerTextDrawBackgroundColor(I, InicioRace2[I], 51);
  309.         PlayerTextDrawFont(I, InicioRace2[I], 1);
  310.         PlayerTextDrawSetProportional(I, InicioRace2[I], 1);
  311.  
  312.         InicioRace3[I] = CreatePlayerTextDraw(I, 16.728918, 282.737854, "~p~~h~Recordista:");
  313.         PlayerTextDrawLetterSize(I, InicioRace3[I], 0.261999, 1.127110);
  314.         PlayerTextDrawAlignment(I, InicioRace3[I], 1);
  315.         PlayerTextDrawColor(I, InicioRace3[I], -1);
  316.         PlayerTextDrawSetShadow(I, InicioRace3[I], 0);
  317.         PlayerTextDrawSetOutline(I, InicioRace3[I], 1);
  318.         PlayerTextDrawBackgroundColor(I, InicioRace3[I], 51);
  319.         PlayerTextDrawFont(I, InicioRace3[I], 1);
  320.         PlayerTextDrawSetProportional(I, InicioRace3[I], 1);
  321.  
  322.  
  323.         InicioRace4[I] = CreatePlayerTextDraw(I, 70.533325, 283.235687, "");
  324.         PlayerTextDrawLetterSize(I, InicioRace4[I], 0.261999, 1.127110);
  325.         PlayerTextDrawAlignment(I, InicioRace4[I], 1);
  326.         PlayerTextDrawColor(I, InicioRace4[I], -1);
  327.         PlayerTextDrawSetShadow(I, InicioRace4[I], 0);
  328.         PlayerTextDrawSetOutline(I, InicioRace4[I], -1);
  329.         PlayerTextDrawBackgroundColor(I, InicioRace4[I], 51);
  330.         PlayerTextDrawFont(I, InicioRace4[I], 1);
  331.         PlayerTextDrawSetProportional(I, InicioRace4[I], 1);
  332.  
  333.         InicioRace5[I] = CreatePlayerTextDraw(I, 16.800001, 296.177886, "~y~~h~Tempo:");
  334.         PlayerTextDrawLetterSize(I, InicioRace5[I], 0.261999, 1.127110);
  335.         PlayerTextDrawAlignment(I, InicioRace5[I], 1);
  336.         PlayerTextDrawColor(I, InicioRace5[I], -1);
  337.         PlayerTextDrawSetShadow(I, InicioRace5[I], 0);
  338.         PlayerTextDrawSetOutline(I, InicioRace5[I], 1);
  339.         PlayerTextDrawBackgroundColor(I, InicioRace5[I], 51);
  340.         PlayerTextDrawFont(I, InicioRace5[I], 1);
  341.         PlayerTextDrawSetProportional(I, InicioRace5[I], 1);
  342.  
  343.         InicioRace6[I] = CreatePlayerTextDraw(I, 54.799991, 296.675811, "");
  344.         PlayerTextDrawLetterSize(I, InicioRace6[I], 0.261999, 1.127110);
  345.         PlayerTextDrawAlignment(I, InicioRace6[I], 1);
  346.         PlayerTextDrawColor(I,InicioRace6[I], -1);
  347.         PlayerTextDrawSetShadow(I, InicioRace6[I], 0);
  348.         PlayerTextDrawSetOutline(I, InicioRace6[I], -1);
  349.         PlayerTextDrawBackgroundColor(I, InicioRace6[I], 51);
  350.         PlayerTextDrawFont(I, InicioRace6[I], 1);
  351.         PlayerTextDrawSetProportional(I, InicioRace6[I], 1);
  352.     }
  353.     return 1;
  354. }
  355.  
  356. public OnFilterScriptExit()
  357. {
  358.     TextDrawHideForAll(TextdrawAnuncio);
  359.     TextDrawDestroy(TextdrawAnuncio);
  360.     for(new i = 0; i < MAX_PLAYERS; i++){
  361.         DisablePlayerRaceCheckpoint(i);
  362.         RemovePlayerMapIcon(i, 0);
  363.         PlayerTextDrawDestroy(i, InicioRace0[i]);
  364.         PlayerTextDrawDestroy(i, InicioRace1[i]);
  365.         PlayerTextDrawDestroy(i, InicioRace2[i]);
  366.         PlayerTextDrawDestroy(i, InicioRace3[i]);
  367.         PlayerTextDrawDestroy(i, InicioRace4[i]);
  368.         PlayerTextDrawDestroy(i, InicioRace5[i]);
  369.         PlayerTextDrawDestroy(i, InicioRace6[i]);
  370.         PlayerTextDrawDestroy(i, InicioRace7[i]);
  371.         PlayerTextDrawDestroy(i, TempoCorrida[i]);
  372.         PlayerTextDrawHide(i, TextContar[i]);
  373.         PlayerTextDrawHide(i, Textdraw10[i]);
  374.        
  375.         PlayerTextDrawHide(i, Textdraw0[i]);
  376.         PlayerTextDrawHide(i, Textdraw1[i]);
  377.         PlayerTextDrawHide(i, Textdraw2[i]);
  378.         PlayerTextDrawHide(i, Textdraw5[i]);
  379.         PlayerTextDrawHide(i, Textdraw6[i]);
  380.         PlayerTextDrawHide(i, Textdraw7[i]);
  381.         PlayerTextDrawHide(i, Textdraw8[i]);
  382.         PlayerTextDrawHide(i, Textdraw9[i]);
  383.        
  384.         PlayerTextDrawDestroy(i, Textdraw0[i]);
  385.         PlayerTextDrawDestroy(i, Textdraw1[i]);
  386.         PlayerTextDrawDestroy(i, Textdraw2[i]);
  387.         PlayerTextDrawDestroy(i, Textdraw5[i]);
  388.         PlayerTextDrawDestroy(i, Textdraw6[i]);
  389.         PlayerTextDrawDestroy(i, Textdraw7[i]);
  390.         PlayerTextDrawDestroy(i, Textdraw8[i]);
  391.         PlayerTextDrawDestroy(i, Textdraw9[i]);
  392.         PlayerTextDrawDestroy(i, Textdraw10[i]);
  393.         PlayerTextDrawDestroy(i, TextContar[i]);
  394.  
  395.     }
  396.  
  397.     for(new X; X < MAX_VEHICLES; X++){
  398.         DestroyVehicle(Veiculo[X]);
  399.     }
  400.  
  401.     DOF2_Exit();
  402.     return 1;
  403. }
  404.  
  405. public OnPlayerConnect(playerid)
  406. {
  407.  
  408.     CPConquistado[playerid] = CreatePlayerTextDraw(playerid, 321.199920, 359.893463, "");
  409.     PlayerTextDrawLetterSize(playerid, CPConquistado[playerid], 0.449999, 1.600000);
  410.     PlayerTextDrawAlignment(playerid, CPConquistado[playerid], 2);
  411.     PlayerTextDrawColor(playerid, CPConquistado[playerid], -1);
  412.     PlayerTextDrawSetShadow(playerid, CPConquistado[playerid], 0);
  413.     PlayerTextDrawSetOutline(playerid, CPConquistado[playerid], -1);
  414.     PlayerTextDrawBackgroundColor(playerid, CPConquistado[playerid], 51);
  415.     PlayerTextDrawFont(playerid, CPConquistado[playerid], 2);
  416.     PlayerTextDrawSetProportional(playerid, CPConquistado[playerid], 1);
  417.  
  418.  
  419.     TextdrawAnuncio = TextDrawCreate(306.399871, 153.315612, "");
  420.     TextDrawLetterSize(TextdrawAnuncio, 0.322797, 1.943465);
  421.     TextDrawAlignment(TextdrawAnuncio, 2);
  422.     TextDrawColor(TextdrawAnuncio, -1);
  423.     TextDrawSetShadow(TextdrawAnuncio, 0);
  424.     TextDrawSetOutline(TextdrawAnuncio, -1);
  425.     TextDrawBackgroundColor(TextdrawAnuncio, 51);
  426.     TextDrawFont(TextdrawAnuncio, 1);
  427.     TextDrawSetProportional(TextdrawAnuncio, 1);
  428.  
  429.     Textdraw10[playerid] = CreatePlayerTextDraw(playerid, 530.399963, 212.551101, "9|:");
  430.     PlayerTextDrawLetterSize(playerid, Textdraw10[playerid], 0.203997, 2.172444);
  431.     PlayerTextDrawAlignment(playerid, Textdraw10[playerid], 1);
  432.     PlayerTextDrawColor(playerid, Textdraw10[playerid], -1);
  433.     PlayerTextDrawSetShadow(playerid, Textdraw10[playerid], 0);
  434.     PlayerTextDrawSetOutline(playerid, Textdraw10[playerid], 1);
  435.     PlayerTextDrawBackgroundColor(playerid, Textdraw10[playerid], 51);
  436.     PlayerTextDrawFont(playerid, Textdraw10[playerid], 1);
  437.     PlayerTextDrawSetProportional(playerid, Textdraw10[playerid], 1);
  438.  
  439.     Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 530.799987, 104.540000, "usebox");
  440.     PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 20.589998);
  441.     PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 632.000000, 0.000000);
  442.     PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
  443.     PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
  444.     PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
  445.     PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
  446.     PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
  447.     PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
  448.     PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
  449.  
  450.     Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 581.200683, 105.031028, "Race Info");
  451.     PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.179600, 0.942933);
  452.     PlayerTextDrawTextSize(playerid, Textdraw1[playerid], 381.199920, 101.546730);
  453.     PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 2);
  454.     PlayerTextDrawColor(playerid, Textdraw1[playerid], 255);
  455.     PlayerTextDrawUseBox(playerid, Textdraw1[playerid], true);
  456.     PlayerTextDrawBoxColor(playerid, Textdraw1[playerid], -5963521);
  457.     PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
  458.     PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 0);
  459.     PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
  460.     PlayerTextDrawFont(playerid, Textdraw1[playerid], 2);
  461.     PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
  462.  
  463.     Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 530.000000, 117.973381, "~y~~h~1|:  ~r~Ninguem");
  464.     PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.249999, 1.475553);
  465.     PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
  466.     PlayerTextDrawColor(playerid, Textdraw2[playerid], -1);
  467.     PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
  468.     PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
  469.     PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
  470.     PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
  471.     PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
  472. /*
  473.         Textdraw3[playerid] = CreatePlayerTextDraw(playerid, 557.599975, 271.288970, "/10");
  474.         PlayerTextDrawLetterSize(playerid, Textdraw3[playerid], 0.409999, 2.072885);
  475.         PlayerTextDrawAlignment(playerid, Textdraw3[playerid], 1);
  476.         PlayerTextDrawColor(playerid, Textdraw3[playerid], -1378294017);
  477.         PlayerTextDrawSetShadow(playerid, Textdraw3[playerid], 0);
  478.         PlayerTextDrawSetOutline(playerid, Textdraw3[playerid], 1);
  479.         PlayerTextDrawBackgroundColor(playerid, Textdraw3[playerid], 51);
  480.         PlayerTextDrawFont(playerid, Textdraw3[playerid], 3);
  481.         PlayerTextDrawSetProportional(playerid, Textdraw3[playerid], 1);
  482.  
  483.         Textdraw4[playerid] = CreatePlayerTextDraw(playerid, 532.800048, 250.880004, "2|");
  484.         PlayerTextDrawLetterSize(playerid, Textdraw4[playerid], 0.607999, 3.964443);
  485.         PlayerTextDrawAlignment(playerid, Textdraw4[playerid], 1);
  486.         PlayerTextDrawColor(playerid, Textdraw4[playerid], -1378294017);
  487.         PlayerTextDrawSetShadow(playerid, Textdraw4[playerid], 0);
  488.         PlayerTextDrawSetOutline(playerid, Textdraw4[playerid], 1);
  489.         PlayerTextDrawBackgroundColor(playerid, Textdraw4[playerid], 51);
  490.         PlayerTextDrawFont(playerid, Textdraw4[playerid], 3);
  491.         PlayerTextDrawSetProportional(playerid, Textdraw4[playerid], 1)
  492. */
  493.     Textdraw5[playerid] = CreatePlayerTextDraw(playerid, 603.599792, 272.782257, "x/x");
  494.     PlayerTextDrawLetterSize(playerid, Textdraw5[playerid], 0.275999, 1.600000);
  495.     PlayerTextDrawAlignment(playerid, Textdraw5[playerid], 1);
  496.     PlayerTextDrawColor(playerid, Textdraw5[playerid], -2147483393);
  497.     PlayerTextDrawSetShadow(playerid, Textdraw5[playerid], 0);
  498.     PlayerTextDrawSetOutline(playerid, Textdraw5[playerid], 1);
  499.     PlayerTextDrawBackgroundColor(playerid, Textdraw5[playerid], 51);
  500.     PlayerTextDrawFont(playerid, Textdraw5[playerid], 1);
  501.     PlayerTextDrawSetProportional(playerid, Textdraw5[playerid], 1);
  502.  
  503.     Textdraw6[playerid] = CreatePlayerTextDraw(playerid, 530.000000, 134.897872, "~y~~h~2|:  ~r~Ninguem");
  504.     PlayerTextDrawLetterSize(playerid, Textdraw6[playerid], 0.249999, 1.475553);
  505.     PlayerTextDrawAlignment(playerid, Textdraw6[playerid], 1);
  506.     PlayerTextDrawColor(playerid, Textdraw6[playerid], -1);
  507.     PlayerTextDrawSetShadow(playerid, Textdraw6[playerid], 0);
  508.     PlayerTextDrawSetOutline(playerid, Textdraw6[playerid], 1);
  509.     PlayerTextDrawBackgroundColor(playerid, Textdraw6[playerid], 51);
  510.     PlayerTextDrawFont(playerid, Textdraw6[playerid], 1);
  511.     PlayerTextDrawSetProportional(playerid, Textdraw6[playerid], 1);
  512.  
  513.     Textdraw7[playerid] = CreatePlayerTextDraw(playerid, 530.000000, 152.817825, "~y~~h~3|:  ~r~Ninguem");
  514.     PlayerTextDrawLetterSize(playerid, Textdraw7[playerid], 0.249999, 1.475553);
  515.     PlayerTextDrawAlignment(playerid, Textdraw7[playerid], 1);
  516.     PlayerTextDrawColor(playerid, Textdraw7[playerid], -1);
  517.     PlayerTextDrawSetShadow(playerid, Textdraw7[playerid], 0);
  518.     PlayerTextDrawSetOutline(playerid, Textdraw7[playerid], 1);
  519.     PlayerTextDrawBackgroundColor(playerid, Textdraw7[playerid], 51);
  520.     PlayerTextDrawFont(playerid, Textdraw7[playerid], 1);
  521.     PlayerTextDrawSetProportional(playerid, Textdraw7[playerid], 1);
  522.  
  523.     Textdraw8[playerid] = CreatePlayerTextDraw(playerid, 529.599975, 172.231155, "~y~~h~4|:  ~r~Ninguem");
  524.     PlayerTextDrawLetterSize(playerid, Textdraw8[playerid], 0.249999, 1.475553);
  525.     PlayerTextDrawAlignment(playerid, Textdraw8[playerid], 1);
  526.     PlayerTextDrawColor(playerid, Textdraw8[playerid], -1);
  527.     PlayerTextDrawSetShadow(playerid, Textdraw8[playerid], 0);
  528.     PlayerTextDrawSetOutline(playerid, Textdraw8[playerid], 1);
  529.     PlayerTextDrawBackgroundColor(playerid, Textdraw8[playerid], 51);
  530.     PlayerTextDrawFont(playerid, Textdraw8[playerid], 1);
  531.     PlayerTextDrawSetProportional(playerid, Textdraw8[playerid], 1);
  532.  
  533.     Textdraw9[playerid] = CreatePlayerTextDraw(playerid, 530.000000, 189.653366, "~y~~h~5|:  ~r~Ninguem");
  534.     PlayerTextDrawLetterSize(playerid, Textdraw9[playerid], 0.249999, 1.475553);
  535.     PlayerTextDrawAlignment(playerid, Textdraw9[playerid], 1);
  536.     PlayerTextDrawColor(playerid, Textdraw9[playerid], -1);
  537.     PlayerTextDrawSetShadow(playerid, Textdraw9[playerid], 0);
  538.     PlayerTextDrawSetOutline(playerid, Textdraw9[playerid], 1);
  539.     PlayerTextDrawBackgroundColor(playerid, Textdraw9[playerid], 51);
  540.     PlayerTextDrawFont(playerid, Textdraw9[playerid], 1);
  541.     PlayerTextDrawSetProportional(playerid, Textdraw9[playerid], 1);
  542.  
  543.  
  544.  
  545.  
  546.     TempoCorrida[playerid] = CreatePlayerTextDraw(playerid, 14.400009, 238.933471, "00:00:00");
  547.     PlayerTextDrawFont(playerid, TempoCorrida[playerid], 1);
  548.     PlayerTextDrawLetterSize(playerid, TempoCorrida[playerid], 0.225000, 1.251000);
  549.     PlayerTextDrawColor(playerid, TempoCorrida[playerid], -1);
  550.     PlayerTextDrawSetOutline(playerid, TempoCorrida[playerid], 1);
  551.     PlayerTextDrawSetProportional(playerid, TempoCorrida[playerid], 1);
  552.  
  553.     TextContar[playerid] = CreatePlayerTextDraw(playerid, 229.200103, 361.386688, "");
  554.     PlayerTextDrawLetterSize(playerid, TextContar[playerid], 0.449999, 1.600000);
  555.     PlayerTextDrawAlignment(playerid, TextContar[playerid], 1);
  556.     PlayerTextDrawColor(playerid, TextContar[playerid], -1);
  557.     PlayerTextDrawSetShadow(playerid, TextContar[playerid], 0);
  558.     PlayerTextDrawSetOutline(playerid, TextContar[playerid], 1);
  559.     PlayerTextDrawBackgroundColor(playerid, TextContar[playerid], 51);
  560.     PlayerTextDrawFont(playerid, TextContar[playerid], 1);
  561.     PlayerTextDrawSetProportional(playerid, TextContar[playerid], 1);
  562.  
  563.  
  564.     InicioRace0[playerid] = CreatePlayerTextDraw(playerid, 150.800003, 255.366668, "usebox"); // BOX
  565.     PlayerTextDrawLetterSize(playerid, InicioRace0[playerid], 0.000000, 6.430986);
  566.     PlayerTextDrawTextSize(playerid, InicioRace0[playerid], 12.400000, 0.000000);
  567.     PlayerTextDrawAlignment(playerid, InicioRace0[playerid], 1);
  568.     PlayerTextDrawColor(playerid, InicioRace0[playerid], 0);
  569.     PlayerTextDrawUseBox(playerid, InicioRace0[playerid], true);
  570.     PlayerTextDrawBoxColor(playerid, InicioRace0[playerid], 102);
  571.     PlayerTextDrawSetShadow(playerid, InicioRace0[playerid], 0);
  572.     PlayerTextDrawSetOutline(playerid, InicioRace0[playerid], 0);
  573.     PlayerTextDrawFont(playerid, InicioRace0[playerid], 0);
  574.  
  575.     InicioRace7[playerid] = CreatePlayerTextDraw(playerid, 81.431015, 255.857666, "Race Info");
  576.     PlayerTextDrawLetterSize(playerid, InicioRace7[playerid], 0.169600, 1.375999);
  577.     PlayerTextDrawTextSize(playerid, InicioRace7[playerid], 3814.800292, 130.915496);
  578.     PlayerTextDrawAlignment(playerid, InicioRace7[playerid], 2);
  579.     PlayerTextDrawColor(playerid, InicioRace7[playerid], 255);
  580.     PlayerTextDrawUseBox(playerid, InicioRace7[playerid], true);
  581.     PlayerTextDrawBoxColor(playerid, InicioRace7[playerid], -1523963137);
  582.     PlayerTextDrawSetShadow(playerid, InicioRace7[playerid], 0);
  583.     PlayerTextDrawSetOutline(playerid, InicioRace7[playerid], 0);
  584.     PlayerTextDrawBackgroundColor(playerid, InicioRace7[playerid], 51);
  585.     PlayerTextDrawFont(playerid, InicioRace7[playerid], 2);
  586.     PlayerTextDrawSetProportional(playerid, InicioRace7[playerid], 1);
  587.  
  588.     InicioRace1[playerid] = CreatePlayerTextDraw(playerid, 16.400007, 270.791229, "~b~~h~Checkpoints ID:");
  589.     PlayerTextDrawLetterSize(playerid, InicioRace1[playerid], 0.262000, 1.127111);
  590.     PlayerTextDrawAlignment(playerid, InicioRace1[playerid], 1);
  591.     PlayerTextDrawColor(playerid, InicioRace1[playerid], -1);
  592.     PlayerTextDrawSetShadow(playerid, InicioRace1[playerid], 0);
  593.     PlayerTextDrawSetOutline(playerid, InicioRace1[playerid], 1);
  594.     PlayerTextDrawBackgroundColor(playerid, InicioRace1[playerid], 51);
  595.     PlayerTextDrawFont(playerid, InicioRace1[playerid], 1);
  596.     PlayerTextDrawSetProportional(playerid, InicioRace1[playerid], 1);
  597.  
  598.  
  599.     InicioRace2[playerid] = CreatePlayerTextDraw(playerid, 91.199966, 270.791137, "");
  600.     PlayerTextDrawLetterSize(playerid, InicioRace2[playerid], 0.261999, 1.127110);
  601.     PlayerTextDrawAlignment(playerid, InicioRace2[playerid], 1);
  602.     PlayerTextDrawColor(playerid, InicioRace2[playerid], -1);
  603.     PlayerTextDrawSetShadow(playerid, InicioRace2[playerid], 0);
  604.     PlayerTextDrawSetOutline(playerid, InicioRace2[playerid], 1);
  605.     PlayerTextDrawBackgroundColor(playerid, InicioRace2[playerid], 51);
  606.     PlayerTextDrawFont(playerid, InicioRace2[playerid], 1);
  607.     PlayerTextDrawSetProportional(playerid, InicioRace2[playerid], 1);
  608.  
  609.     InicioRace3[playerid] = CreatePlayerTextDraw(playerid, 16.728918, 282.737854, "~p~~h~Recordista:");
  610.     PlayerTextDrawLetterSize(playerid, InicioRace3[playerid], 0.261999, 1.127110);
  611.     PlayerTextDrawAlignment(playerid, InicioRace3[playerid], 1);
  612.     PlayerTextDrawColor(playerid, InicioRace3[playerid], -1);
  613.     PlayerTextDrawSetShadow(playerid, InicioRace3[playerid], 0);
  614.     PlayerTextDrawSetOutline(playerid, InicioRace3[playerid], 1);
  615.     PlayerTextDrawBackgroundColor(playerid, InicioRace3[playerid], 51);
  616.     PlayerTextDrawFont(playerid, InicioRace3[playerid], 1);
  617.     PlayerTextDrawSetProportional(playerid, InicioRace3[playerid], 1);
  618.  
  619.  
  620.     InicioRace4[playerid] = CreatePlayerTextDraw(playerid, 70.533325, 283.235687, "");
  621.     PlayerTextDrawLetterSize(playerid, InicioRace4[playerid], 0.261999, 1.127110);
  622.     PlayerTextDrawAlignment(playerid, InicioRace4[playerid], 1);
  623.     PlayerTextDrawColor(playerid, InicioRace4[playerid], -1);
  624.     PlayerTextDrawSetShadow(playerid, InicioRace4[playerid], 0);
  625.     PlayerTextDrawSetOutline(playerid, InicioRace4[playerid], -1);
  626.     PlayerTextDrawBackgroundColor(playerid, InicioRace4[playerid], 51);
  627.     PlayerTextDrawFont(playerid, InicioRace4[playerid], 1);
  628.     PlayerTextDrawSetProportional(playerid, InicioRace4[playerid], 1);
  629.  
  630.     InicioRace5[playerid] = CreatePlayerTextDraw(playerid, 16.800001, 296.177886, "~y~~h~Tempo:");
  631.     PlayerTextDrawLetterSize(playerid, InicioRace5[playerid], 0.261999, 1.127110);
  632.     PlayerTextDrawAlignment(playerid, InicioRace5[playerid], 1);
  633.     PlayerTextDrawColor(playerid, InicioRace5[playerid], -1);
  634.     PlayerTextDrawSetShadow(playerid, InicioRace5[playerid], 0);
  635.     PlayerTextDrawSetOutline(playerid, InicioRace5[playerid], 1);
  636.     PlayerTextDrawBackgroundColor(playerid, InicioRace5[playerid], 51);
  637.     PlayerTextDrawFont(playerid, InicioRace5[playerid], 1);
  638.     PlayerTextDrawSetProportional(playerid, InicioRace5[playerid], 1);
  639.  
  640.     InicioRace6[playerid] = CreatePlayerTextDraw(playerid, 54.799991, 296.675811, "");
  641.     PlayerTextDrawLetterSize(playerid, InicioRace6[playerid], 0.261999, 1.127110);
  642.     PlayerTextDrawAlignment(playerid, InicioRace6[playerid], 1);
  643.     PlayerTextDrawColor(playerid, InicioRace6[playerid], -1);
  644.     PlayerTextDrawSetShadow(playerid, InicioRace6[playerid], 0);
  645.     PlayerTextDrawSetOutline(playerid, InicioRace6[playerid], -1);
  646.     PlayerTextDrawBackgroundColor(playerid, InicioRace6[playerid], 51);
  647.     PlayerTextDrawFont(playerid, InicioRace6[playerid], 1);
  648.     PlayerTextDrawSetProportional(playerid, InicioRace6[playerid], 1);
  649.  
  650.     return 1;
  651. }
  652.  
  653. public OnPlayerDisconnect(playerid, reason)
  654. {
  655.     return 1;
  656. }
  657.  
  658. public OnPlayerSpawn(playerid)
  659. {
  660.     return 1;
  661. }
  662.  
  663. public OnPlayerDeath(playerid, killerid, reason)
  664. {
  665.     return 1;
  666. }
  667.  
  668. public OnVehicleSpawn(vehicleid)
  669. {
  670.     return 1;
  671. }
  672.  
  673. public OnVehicleDeath(vehicleid, killerid)
  674. {
  675.     return 1;
  676. }
  677.  
  678. public OnPlayerText(playerid, text[])
  679. {
  680.     return 1;
  681. }
  682.  
  683. public OnPlayerCommandText(playerid, cmdtext[])
  684. {
  685.  
  686.     return 0;
  687. }
  688.  
  689. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  690. {
  691.     return 1;
  692. }
  693.  
  694. public OnPlayerExitVehicle(playerid, vehicleid)
  695. {
  696.     return 1;
  697. }
  698.  
  699. public OnPlayerStateChange(playerid, newstate, oldstate)
  700. {
  701.     return 1;
  702. }
  703.  
  704. public OnPlayerEnterCheckpoint(playerid)
  705. {
  706.     return 1;
  707. }
  708.  
  709. public OnPlayerLeaveCheckpoint(playerid)
  710. {
  711.     return 1;
  712. }
  713.  
  714. public OnPlayerEnterRaceCheckpoint(playerid)
  715. {
  716.     new file[128];
  717.     format(file, sizeof(file), pasta_race, CPCarregado);
  718.     if (CPAtivado == false) return SendClientMessage(playerid, Red, "** [ERRO] Os CPs estão desativados!");
  719.     DisablePlayerRaceCheckpoint(playerid);
  720.     CPCountX[playerid]++;
  721.     CPCountY[playerid]++;
  722.     CPCountZ[playerid]++;
  723.     format(String, sizeof(String), "%02d CPX", CPCountX[playerid]);
  724.     format(String2, sizeof(String2), "%02d CPY", CPCountY[playerid]);
  725.     format(String3, sizeof(String3), "%02d CPZ", CPCountZ[playerid]);
  726.     format(String4, sizeof(String4), "%02d CPX", CPCountX[playerid] + 1);
  727.     format(String5, sizeof(String5), "%02d CPY", CPCountY[playerid] + 1);
  728.     format(String6, sizeof(String6), "%02d CPZ", CPCountZ[playerid] + 1);
  729.  
  730.     if (AddCP[playerid] < TotalCPS)
  731.     { // VERIFICA SE OS CPS ADQUIRIDOS SÃO MENOR DO QUE O TOTAL DE CPS
  732.         SetPlayerRaceCheckpoint(playerid, 0, DOF2_GetFloat(file, String), DOF2_GetFloat(file, String2), DOF2_GetFloat(file, String3), DOF2_GetFloat(file, String4), DOF2_GetFloat(file, String5), DOF2_GetFloat(file, String6), TamanhoCPS);
  733.         SetPlayerMapIcon(playerid, 0, DOF2_GetFloat(file, String4), DOF2_GetFloat(file, String5), DOF2_GetFloat(file, String6), 53, -1, MAPICON_LOCAL);
  734.         AddCP[playerid]++;
  735.         format(Str, sizeof(Str), "~g~~h~%d/%d", AddCP[playerid], DOF2_GetInt(file, "Total CPS"));
  736.         PlayerTextDrawSetString(playerid, Textdraw5[playerid], Str);
  737.         if (AddCP[playerid] == TotalCPS - 1)
  738.         { // VERIFICA SE O PLAYER ESTÁ NO PENÚLTIMO CP PARA SETAR O CP FINAL
  739.             SetPlayerRaceCheckpoint(playerid, 1, DOF2_GetFloat(file, String), DOF2_GetFloat(file, String2), DOF2_GetFloat(file, String3), DOF2_GetFloat(file, String4), DOF2_GetFloat(file, String5), DOF2_GetFloat(file, String6), TamanhoCPS);
  740.             RemovePlayerMapIcon(playerid, 0);
  741.         }
  742.         if (AddCP[playerid] == TotalCPS)
  743.         {
  744.             AlguemGanhou[playerid] = true;
  745.             KillTimer(TempoRecorde[playerid]);
  746.             DisablePlayerRaceCheckpoint(playerid);
  747.             TempoMinimo[1] = DOF2_GetInt(file, "Recorde Minutos");
  748.             TempoMinimo[0] = DOF2_GetInt(file, "Recorde Segundos");
  749.             Terminou++;
  750.             Lugar[Terminou] = playerid;
  751.             format(str, sizeof(str), "** [CORRIDA]{FFFFFF} %s terminou a corrida em %d° lugar, em um tempo de %02d:%02d!", GetName(playerid), Terminou, Tempo[playerid][1], Tempo[playerid][0]);
  752.             SendClientMessageToAll(Red, str);
  753.             for (new i; i < MAX_PLAYERS; i++)
  754.             {
  755.                 SetTimerEx("AtualizarTextdraws", 500, false, "i", i);
  756.             }
  757.             if (Tempo[playerid][1] <= TempoMinimo[1] && Tempo[playerid][0] < TempoMinimo[0] || Tempo[playerid][1] < TempoMinimo[1])
  758.             {
  759.                 format(str, sizeof(str), "** [CORRIDA] %s é o novo recordista do CPs ID %02d com um tempo de %02d:%02d!", GetName(playerid), CPCarregado, Tempo[playerid][1], Tempo[playerid][0]);
  760.                 SendClientMessageToAll(Pink, str);
  761.                 DOF2_SetString(file, "Recordista", GetName(playerid));
  762.                 DOF2_SetInt(file, "Recorde Minutos", Tempo[playerid][1]);
  763.                 DOF2_SetInt(file, "Recorde Segundos", Tempo[playerid][0]);
  764.                 DOF2_SaveFile();
  765.                 format(Str, sizeof(Str), "%s", DOF2_GetString(file, "Recordista"));
  766.                 PlayerTextDrawSetString(playerid, InicioRace4[playerid], Str);
  767.                 format(Str, sizeof(Str), "00:%02d:%02d", DOF2_GetInt(file, "Recorde Minutos"), DOF2_GetInt(file, "Recorde Segundos"));
  768.                 PlayerTextDrawSetString(playerid, InicioRace6[playerid], Str);
  769.             }
  770.         }
  771.         KillTimer(TimerCountCP[playerid]);
  772.         format(str, sizeof(str), "~r~~h~CHECKPOINT~b~CONQUISTADO~n~~w~%d/%d", AddCP[playerid], TotalCPS);
  773.         PlayerTextDrawSetString(playerid, CPConquistado[playerid], str);
  774.         PlayerTextDrawShow(playerid, CPConquistado[playerid]);
  775.         TimerCountCP[playerid] = SetTimerEx("CountCP", 3000, true, "i", playerid);
  776.     }
  777.    
  778. /*
  779.    
  780.     new j, aPID, I;
  781.     for (I = 1; I < MAX_PLAYERS; I++) //Loop todos jogadores para ordenar começando pelo 2º numero = 1
  782.     {
  783.         if (!IsPlayerConnected(I)) continue;
  784.         Colocados[I] = I; // Colocados[1] = 1;
  785.         aPID = Colocados[I]; // AtualPD = 1;
  786.         j = I - 1; // j = 0;
  787.         while (j > -1 && AddCP[Colocados[j + 1]] < AddCP[Colocados[j]])
  788.         {
  789.             Colocados[j + 1] = Colocados[j]; // Colocados[1] = Colocados[0]
  790.             AddCP[Colocados[j + 1]] = AddCP[Colocados[j]]; // AddCP[Colocados[1]] = AddCP[Colocados[0]]
  791.             j--; // j = -1;
  792.         }
  793.         Colocados[j + 1] = aPID; // Colocados[0] = 1; Se for feito o while Colocados[0] = Colocados[1];
  794.         AddCP[Colocados[j + 1]] = AddCP[aPID]; // AddCP[Colocados[0]] = AddCP[Colocados[1]];
  795.  
  796.         AtualizarText[I - 1] = SetTimerEx("AtualizarTextdraws", 100, false, "d", I - 1);
  797.         AtualizarText[I] = SetTimerEx("AtualizarTextdraws", 100, false, "d", I);
  798.     }
  799.  
  800. */
  801.     return 1;
  802. }
  803.  
  804. public OnPlayerLeaveRaceCheckpoint(playerid)
  805. {
  806.     return 1;
  807. }
  808.  
  809. public OnRconCommand(cmd[])
  810. {
  811.     return 1;
  812. }
  813.  
  814. public OnPlayerRequestSpawn(playerid)
  815. {
  816.     return 1;
  817. }
  818.  
  819. public OnObjectMoved(objectid)
  820. {
  821.     return 1;
  822. }
  823.  
  824. public OnPlayerObjectMoved(playerid, objectid)
  825. {
  826.     return 1;
  827. }
  828.  
  829. public OnPlayerPickUpPickup(playerid, pickupid)
  830. {
  831.     return 1;
  832. }
  833.  
  834. public OnVehicleMod(playerid, vehicleid, componentid)
  835. {
  836.     return 1;
  837. }
  838.  
  839. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  840. {
  841.     return 1;
  842. }
  843.  
  844. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  845. {
  846.     return 1;
  847. }
  848.  
  849. public OnPlayerSelectedMenuRow(playerid, row)
  850. {
  851.     return 1;
  852. }
  853.  
  854. public OnPlayerExitedMenu(playerid)
  855. {
  856.     return 1;
  857. }
  858.  
  859. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  860. {
  861.     return 1;
  862. }
  863.  
  864. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  865. {
  866.     return 1;
  867. }
  868.  
  869. public OnRconLoginAttempt(ip[], password[], success)
  870. {
  871.     return 1;
  872. }
  873.  
  874. public OnPlayerUpdate(playerid)
  875. {
  876.     return 1;
  877. }
  878.  
  879. public OnPlayerStreamIn(playerid, forplayerid)
  880. {
  881.     return 1;
  882. }
  883.  
  884. public OnPlayerStreamOut(playerid, forplayerid)
  885. {
  886.     return 1;
  887. }
  888.  
  889. public OnVehicleStreamIn(vehicleid, forplayerid)
  890. {
  891.     return 1;
  892. }
  893.  
  894. public OnVehicleStreamOut(vehicleid, forplayerid)
  895. {
  896.     return 1;
  897. }
  898.  
  899. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  900. {
  901.     return 1;
  902. }
  903.  
  904. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  905. {
  906.     return 1;
  907. }
  908.  
  909. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ){
  910.     new vID = GetPlayerVehicleID(playerid);
  911.     SetVehiclePos(vID, fX, fY, fZ);
  912.     SetPlayerPos(playerid, fX, fY, fZ);
  913.     PutPlayerInVehicle(playerid, vID, 0);
  914.     return 1;
  915. }
  916. /*
  917. CMD:xb(playerid){
  918.     new CPs[5], i, Atual, j;
  919.     for (i = 1; i < MAX_PLAYERS; i++)
  920.     {
  921.         if (!IsPlayerConnected(i)) continue;
  922.         printf("%i", i);
  923.         CPs[i] = AddCP[i];
  924.         Atual = CPs[i];
  925.         j = i - 1; // j = 0;
  926.         while (j > -1 && AddCP[j+1] < AddCP[j])
  927.         {
  928.             CPs[j+1] = CPs[j];
  929.             j--;
  930.         }
  931.         CPs[j+1] = Atual;
  932.     }
  933.  
  934.     format(Str, 128, "Quantidade dos CPs dos ids foram organizados em ordem crescente: %d, %d, %d", CPs[0], CPs[1], CPs[2]);
  935.     SendClientMessageToAll(-1, Str);
  936.     return 1;
  937. }
  938. */
  939. CMD:pintar(playerid, params[])
  940. {
  941.     new CorP[2];
  942.     if (sscanf(params, "dd", CorP[0], CorP[1])) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /Pintar [Cor 1] [Cor 2]");
  943.     SendClientMessage(playerid, -1, "** Cores alteradas com sucesso!");
  944.     ChangeVehicleColor(GetPlayerVehicleID(playerid), CorP[0], CorP[1]);
  945.     return 1;
  946. }
  947.  
  948. CMD:novocp(playerid, params[]){
  949.     new file[128], pasta[128], id;
  950.     if(sscanf(params, "d", id)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /NovoCP [ID dos veículos salvos]");
  951.     format(pasta, sizeof(pasta), pasta_veiculos, id);
  952.     if(!DOF2_FileExists(pasta)) return SendClientMessage(playerid, Red, "** [ERRO] O ID de veículos que você colocou não existe! Salve usando /SalvarVeiculos");
  953.     if(CriacaoAndamento == true) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] Alguém já está criando CPs!");
  954.     for(new X; X < 500; X++){
  955.         format(file, sizeof(file), pasta_race, X);
  956.         if(DOF2_FileExists(file)) continue;
  957.         if(!DOF2_FileExists(file)){
  958.             DOF2_CreateFile(file);
  959.             DOF2_SetString(file, "Criador", GetName(playerid));
  960.             DOF2_SetInt(file, "ID Veiculos", id);
  961.             DOF2_SaveFile();
  962.             CriacaoAndamento = true;
  963.             RaceName = X;
  964.             format(str, sizeof(str), "** [INFO]{FFFFFF} Você começou a criar o CP ID: %02d! Para criar os checkpoints use /SalvarCP", X);
  965.             SendClientMessage(playerid, Red, str);
  966.         } break;
  967.     }
  968.     return 1;
  969. }
  970.  
  971. CMD:salvarcp(playerid){
  972.     new file[500];
  973.     format(file, sizeof(file), pasta_race, RaceName);
  974.     if(CriacaoAndamento == false) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] Primeiro use /NovoCP para criar os arquivos!");
  975.     if(CPCount > 800) return SendClientMessage(playerid, Red, "** [ERRO] Você já salvou 800 CPS que são o máximo");
  976.     GetPlayerPos(playerid, CP[0], CP[1], CP[2]);
  977.     CPCount++;
  978.     format(str, sizeof(str), "%02d CPX", CPCountX[playerid]);
  979.     DOF2_SetFloat(file, str, CP[0]);
  980.     CPCountX[playerid]++;
  981.     format(str, sizeof(str), "%02d CPY", CPCountY[playerid]);
  982.     DOF2_SetFloat(file, str, CP[1]);
  983.     CPCountY[playerid]++;
  984.     format(str, sizeof(str), "%02d CPZ", CPCountZ[playerid]);
  985.     DOF2_SetFloat(file, str, CP[2]);
  986.     CPCountZ[playerid]++;
  987.     TotalCPS++;
  988.     DOF2_SaveFile();
  989.  
  990.     SetPlayerRaceCheckpoint(playerid, 1, CP[0], CP[1], CP[2], 0.0, 0.0, 0.0, 7);
  991.     format(str, sizeof(str), "** [INFO] {FFFFFF}CP salvo com sucesso [%d / 800]!", CPCount);
  992.     SendClientMessage(playerid, Red, str);
  993.     return 1;
  994. }
  995.  
  996. CMD:arquivarcps(playerid){
  997.     new file[128];
  998.     format(file, sizeof(file), pasta_race, RaceName);
  999.     if(CriacaoAndamento == false) return SendClientMessage(playerid, Red, "** [ERRO] Não há um CP em criação! (Use: /NovoCP)");
  1000.     DOF2_SetString(file, "Recordista", "Ninguem");
  1001.     DOF2_SetInt(file, "Total CPS", TotalCPS);
  1002.     DOF2_SetInt(file, "Recorde Minutos", 90);
  1003.     DOF2_SetInt(file, "Recorde Segundos", 00);
  1004.     DOF2_SaveFile();
  1005.     CriacaoAndamento = false;
  1006.     CPCountX[playerid] = 0;
  1007.     CPCountY[playerid] = 0;
  1008.     CPCountZ[playerid] = 0;
  1009.     SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Seus CPs foram arquivados com sucesso!");
  1010.     for(new i; i < MAX_PLAYERS; i++){
  1011.         if(!IsPlayerConnected(i)) continue;
  1012.         DisablePlayerRaceCheckpoint(i);
  1013.     }
  1014.     return 1;
  1015. }
  1016.  
  1017. CMD:carregarcps(playerid, params[]){
  1018.     new file[128], string[128];
  1019.     if(CriacaoAndamento == true || CPAtivado == true) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] Está havendo uma criação de CPs");
  1020.     if(sscanf(params, "d", CPCarregado)) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] {AAAAAA}Utilize: /CarregarCP [ID dos CPs salvos]");
  1021.     format(file, sizeof(file), pasta_race, CPCarregado);
  1022.     if(!DOF2_FileExists(file)) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] Não existe nenhum CP salvo com esse nome.");
  1023.     TotalCPS = DOF2_GetInt(file, "Total CPS");
  1024.     format(string, sizeof(string), "** [ATENÇÃO] {AAAAAA}Você carregou o CPs ID {FF44AA}\"%02d\" {AAAAAA}criados pelo jogador(a) {FF44AA}%s ", CPCarregado, DOF2_GetString(file, "Criador"));
  1025.     SendClientMessage(playerid, Red, string);
  1026.     if(DOF2_GetInt(file, "Recorde Minutos") == 90 && DOF2_GetInt(file, "Recorde Segundos") == 0){
  1027.         format(string, sizeof(string), "** [ATENÇÃO] {AAAAAA}Recorde no tempo de {FF44AA}\"Sem recorde\"{AAAAAA} por {FF44AA}\"%s\"", DOF2_GetString(file, "Recordista"));
  1028.         SendClientMessage(playerid, Red, string);
  1029.     }else{
  1030.         format(string, sizeof(string), "** [ATENÇÃO] {AAAAAA}Recorde no tempo de {FF44AA}\"%02d:%02d\"{AAAAAA} por {FF44AA}\"%s\"", DOF2_GetInt(file, "Recorde Minutos"), DOF2_GetInt(file, "Recorde Segundos"), DOF2_GetString(file, "Recordista"));
  1031.         SendClientMessage(playerid, Red, string);
  1032.     }
  1033.     format(string, sizeof(string), "** [ATENÇÃO] {AAAAAA}ID Veículos: {FF44AA}%d", DOF2_GetInt(file, "ID Veiculos"));
  1034.     SendClientMessage(playerid, Red, string);
  1035.     format(string, sizeof(string), "** [ATENÇÃO] {AAAAAA}Total de CPs: {FF44AA}%d", TotalCPS);
  1036.     SendClientMessage(playerid, Red, string);
  1037.     SendClientMessage(playerid, -1, "");
  1038.     SetPlayerPos(playerid, DOF2_GetFloat(file, "00 CPX"), DOF2_GetFloat(file, "00 CPY"), DOF2_GetFloat(file, "00 CPZ"));
  1039.     SetPlayerMapIcon(playerid, 0, DOF2_GetFloat(file, "00 CPX"), DOF2_GetFloat(file, "00 CPY"), DOF2_GetFloat(file, "00 CPZ"), 53, -1, MAPICON_LOCAL);
  1040.     return 1;
  1041. }
  1042.  
  1043. CMD:cps(playerid){
  1044.     new file[128];
  1045.     format(file, sizeof(file), pasta_race, CPCarregado);
  1046.     if(CPAtivado == true){
  1047.         for(new i; i < MAX_PLAYERS; i++){
  1048.             if(!IsPlayerConnected(i)) continue;
  1049.             DisablePlayerRaceCheckpoint(i);
  1050.             CPCountX[playerid] = 0;
  1051.             CPCountY[playerid] = 0;
  1052.             CPCountZ[playerid] = 0;
  1053.             KillTimer(TempoRecorde[i]);
  1054.             Tempo[i][0] = 0;
  1055.             Tempo[i][1] = 0;
  1056.             Tempo[i][3] = 0;
  1057.             Terminou = 0;
  1058.             AlguemGanhou[i] = false;
  1059.         }
  1060.         SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Os CPs foram desativados!");
  1061.         CPAtivado = false;
  1062.     }else{
  1063.         SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Os CPs foram ativados!");
  1064.         CPAtivado = true;
  1065.         for(new i; i < MAX_PLAYERS; i++){
  1066.             if(!IsPlayerConnected(i)) continue;
  1067.             RemovePlayerMapIcon(i, 0);
  1068.             SetPlayerRaceCheckpoint(i, 0, DOF2_GetFloat(file, "00 CPX"), DOF2_GetFloat(file, "00 CPY"), DOF2_GetFloat(file, "00 CPZ"), DOF2_GetFloat(file, "01 CPX"), DOF2_GetFloat(file, "01 CPY"), DOF2_GetFloat(file, "01 CPZ"), TamanhoCPS);
  1069.             SetPlayerMapIcon(i, 0, DOF2_GetFloat(file, "01 CPX"), DOF2_GetFloat(file, "01 CPY"), DOF2_GetFloat(file, "01 CPZ"), 53, -1, MAPICON_LOCAL);
  1070.         }
  1071.     }
  1072.     return 1;
  1073. }
  1074. CMD:tamanhocps(playerid, params[]){
  1075.     if(sscanf(params, "d", TamanhoCPS)) return SendClientMessage(playerid, 0xFF0000FF, "** [ERRO] {AAAAAA}Utilize: /TamanhoCps [Tamanho dos CPS(padrão 15)]");
  1076.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Você alterou o tamanho dos CPS.");
  1077.     return 1;
  1078. }
  1079.  
  1080. CMD:destruircps(playerid){
  1081.     if(CPAtivado == true) return SendClientMessage(playerid, Red, "** [ERRO] Os CPS estão ativados!");
  1082.     SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Todos os CPs foram destruídos com sucesso!");
  1083.     for(new i; i < MAX_PLAYERS; i++){
  1084.         CPCountX[i] = 0;
  1085.         CPCountY[i] = 0;
  1086.         CPCountZ[i] = 0;
  1087.         AddCP[i] = 0;
  1088.     }
  1089.     CPCount = 0;
  1090.     TotalCPS = 0;
  1091.     return 1;
  1092. }
  1093.  
  1094. CMD:raceemandamento(playerid){
  1095.     if(CriacaoAndamento == false){
  1096.         SendClientMessage(playerid, 0xFF0000FF, "** [INFO] {FFFFFF}Você ativou o Race em Andamento!");
  1097.         CriacaoAndamento = true;
  1098.     }else{
  1099.         SendClientMessage(playerid, 0xFF0000FF, "** [INFO]{FFFFFF} Você desativou o Race em Andamento!");
  1100.         CriacaoAndamento = false;
  1101.     }
  1102.     return 1;
  1103. }
  1104.  
  1105. CMD:deletarcps(playerid, params[]){
  1106.     new file[128], id;
  1107.     if(sscanf(params, "d", id)) return SendClientMessage(playerid, Red, "** [ERRO] {aaaaaa}Utilize: /DeletarCPs [ID do CP]");
  1108.     format(file, sizeof(file), pasta_race, id);
  1109.     if(!DOF2_FileExists(file)) return SendClientMessage(playerid, Red, "** [ERRO] Esse CP não existe");
  1110.     DOF2_RemoveFile(file);
  1111.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}CP deletado com sucesso!");
  1112.     return 1;
  1113. }
  1114.  
  1115.  
  1116.  
  1117. CMD:distanciav(playerid, params[]){
  1118.     new x;
  1119.     if(sscanf(params, "d", x)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /DistanciaV [Distância 0-5]");
  1120.     if(x < 1 || x > 20) return SendClientMessage(playerid, Red, "** [ERRO] A distância entre os veículos deve ser entre 1 e 15!");
  1121.     format(Str, sizeof(Str), "** [INFO] {FFFFFF}Distância dos veículos alterada para %d!", x);
  1122.     SendClientMessage(playerid, Red, Str);
  1123.     DistanciaV = x;
  1124.     return 1;
  1125. }
  1126.  
  1127.  
  1128. CMD:c(playerid, params[]){
  1129.     new Quantidade, file[128];
  1130.     format(file, sizeof(file), pasta_veiculos, IDVeiculos);
  1131.     if(!sscanf(params, "dd", Modelo, Quantidade)){
  1132.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1133.         GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  1134.         GetPlayerFacingAngle(playerid, Position[3]);
  1135.         GetPlayerFacingAngle(playerid, Pos[3]);
  1136.         if(PosV == 0){
  1137.             for(new X; X < Quantidade; X++){
  1138.                 Pos[0] = Pos[0] - DistanciaV;
  1139.                 Veiculo[TotalVeiculos] = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], Cor[0], Cor[1], -1, 0);
  1140.                 TotalVeiculos++;
  1141.                 AddVehicleComponent(TotalVeiculos, 1010);
  1142.                 AddVehicleComponent(TotalVeiculos, 1087);
  1143.                 AddVehicleComponent(TotalVeiculos, 1085);
  1144.                 if(Salvando == true){
  1145.                     DOF2_SetInt(file, "Modelo", Modelo);
  1146.                     DOF2_SetInt(file, "Total Veiculos", X);
  1147.                     format(Str, sizeof(Str), "%02d PosX", TotalVeiculos);
  1148.                     DOF2_SetFloat(file, Str, Pos[0]);
  1149.                     format(Str, sizeof(Str), "%02d PosY", TotalVeiculos);
  1150.                     DOF2_SetFloat(file, Str, Pos[1]);
  1151.                     format(Str, sizeof(Str), "%02d PosZ", TotalVeiculos);
  1152.                     DOF2_SetFloat(file, Str, Pos[2]);
  1153.                     format(Str, sizeof(Str), "%02d Angle", TotalVeiculos);
  1154.                     DOF2_SetFloat(file, Str, Pos[3]);
  1155.                     DOF2_SetInt(file, "Modelo", Modelo);
  1156.                     DOF2_SetInt(file, "Total Veiculos", TotalVeiculos);
  1157.                     DOF2_SaveFile();
  1158.                 }
  1159.  
  1160.             }
  1161.             PutPlayerInVehicle(playerid, TotalVeiculos, 0);
  1162.             format(Str, sizeof(Str), "** [INFO] {FFFFFF}Veículos criados com sucesso! [%d | 200] (Ângulo: %0.3f | Cores: %d e %d)", TotalVeiculos, Pos[3], Cor[0], Cor[1]);
  1163.             SendClientMessage(playerid, Red, Str);
  1164.         }
  1165.         if(PosV == 1){
  1166.             for(new X; X < Quantidade; X++){
  1167.                 Pos[1] = Pos[1] - DistanciaV;
  1168.                 Veiculo[TotalVeiculos] = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], Cor[0], Cor[1], -1, 0);
  1169.                 TotalVeiculos++;
  1170.                 if(Salvando == true){
  1171.                     DOF2_SetInt(file, "Modelo", Modelo);
  1172.                     DOF2_SetInt(file, "Total Veiculos", TotalVeiculos);
  1173.                     format(Str, sizeof(Str), "%02d PosX", TotalVeiculos);
  1174.                     DOF2_SetFloat(file, Str, Pos[0]);
  1175.                     format(Str, sizeof(Str), "%02d PosY", TotalVeiculos);
  1176.                     DOF2_SetFloat(file, Str, Pos[1]);
  1177.                     format(Str, sizeof(Str), "%02d PosZ", TotalVeiculos);
  1178.                     DOF2_SetFloat(file, Str, Pos[2]);
  1179.                     format(Str, sizeof(Str), "%02d Angle", TotalVeiculos);
  1180.                     DOF2_SetFloat(file, Str, Pos[3]);
  1181.                     DOF2_SaveFile();
  1182.                 }
  1183.  
  1184.             }
  1185.             PutPlayerInVehicle(playerid, TotalVeiculos, 0);
  1186.             format(Str, sizeof(Str), "** [INFO] {FFFFFF}Veículos criados com sucesso! [%d | 200] (Ângulo: %0.3f | Cores: %d e %d)", TotalVeiculos, Pos[3], Cor[0], Cor[1]);
  1187.             SendClientMessage(playerid, Red, Str);
  1188.         }
  1189.         if(PosV == 2){
  1190.             for(new X; X < Quantidade; X++){
  1191.                 Pos[0] = Pos[0] - 3;
  1192.                 Pos[1] = Pos[1] + 3.1114;
  1193.                 Veiculo[TotalVeiculos] = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], Cor[0], Cor[1], -1, 0);
  1194.                 TotalVeiculos++;
  1195.                 AddVehicleComponent(TotalVeiculos, 1010);
  1196.                 AddVehicleComponent(TotalVeiculos, 1087);
  1197.                 AddVehicleComponent(TotalVeiculos, 1085);
  1198.                 if(Salvando == true){
  1199.                     DOF2_SetInt(file, "Modelo", Modelo);
  1200.                     DOF2_SetInt(file, "Total Veiculos", X);
  1201.                     format(Str, sizeof(Str), "%02d PosX", TotalVeiculos);
  1202.                     DOF2_SetFloat(file, Str, Pos[0]);
  1203.                     format(Str, sizeof(Str), "%02d PosY", TotalVeiculos);
  1204.                     DOF2_SetFloat(file, Str, Pos[1]);
  1205.                     format(Str, sizeof(Str), "%02d PosZ", TotalVeiculos);
  1206.                     DOF2_SetFloat(file, Str, Pos[2]);
  1207.                     format(Str, sizeof(Str), "%02d Angle", TotalVeiculos);
  1208.                     DOF2_SetFloat(file, Str, Pos[3]);
  1209.                     DOF2_SetInt(file, "Modelo", Modelo);
  1210.                     DOF2_SetInt(file, "Total Veiculos", TotalVeiculos);
  1211.                     DOF2_SaveFile();
  1212.                 }
  1213.  
  1214.             }
  1215.             PutPlayerInVehicle(playerid, TotalVeiculos, 0);
  1216.             format(Str, sizeof(Str), "** [INFO] {FFFFFF}Veículos criados com sucesso! [%d | 200] (Ângulo: %0.3f | Cores: %d e %d)", TotalVeiculos, Pos[3], Cor[0], Cor[1]);
  1217.             SendClientMessage(playerid, Red, Str);
  1218.         }
  1219.         if(PosV == 3){
  1220.             for(new X; X < Quantidade; X++){
  1221.                 Pos[0] = Pos[0] - 2.7035;
  1222.                 Pos[1] = Pos[1] - 2.6541;
  1223.        
  1224.                 Veiculo[TotalVeiculos] = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], Cor[0], Cor[1], -1, 0);
  1225.                 TotalVeiculos++;
  1226.                 AddVehicleComponent(TotalVeiculos, 1010);
  1227.                 AddVehicleComponent(TotalVeiculos, 1087);
  1228.                 AddVehicleComponent(TotalVeiculos, 1085);
  1229.                 if(Salvando == true){
  1230.                     DOF2_SetInt(file, "Modelo", Modelo);
  1231.                     DOF2_SetInt(file, "Total Veiculos", X);
  1232.                     format(Str, sizeof(Str), "%02d PosX", TotalVeiculos);
  1233.                     DOF2_SetFloat(file, Str, Pos[0]);
  1234.                     format(Str, sizeof(Str), "%02d PosY", TotalVeiculos);
  1235.                     DOF2_SetFloat(file, Str, Pos[1]);
  1236.                     format(Str, sizeof(Str), "%02d PosZ", TotalVeiculos);
  1237.                     DOF2_SetFloat(file, Str, Pos[2]);
  1238.                     format(Str, sizeof(Str), "%02d Angle", TotalVeiculos);
  1239.                     DOF2_SetFloat(file, Str, Pos[3]);
  1240.                     DOF2_SetInt(file, "Modelo", Modelo);
  1241.                     DOF2_SetInt(file, "Total Veiculos", TotalVeiculos);
  1242.                     DOF2_SaveFile();
  1243.                 }
  1244.  
  1245.             }
  1246.             PutPlayerInVehicle(playerid, TotalVeiculos, 0);
  1247.             format(Str, sizeof(Str), "** [INFO] {FFFFFF}Veículos criados com sucesso! [%d | 200] (Ângulo: %0.3f | Cores: %d e %d)", TotalVeiculos, Pos[3], Cor[0], Cor[1]);
  1248.             SendClientMessage(playerid, Red, Str);
  1249.         }
  1250.         AddVehicleComponent(Veiculo[TotalVeiculos], 1010);
  1251.         AddVehicleComponent(Veiculo[TotalVeiculos], 1087);
  1252.     }else{
  1253.         SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /C [Modelo] [Quantidade]");
  1254.     }
  1255.     return 1;
  1256. }
  1257.  
  1258.  
  1259. CMD:salvarveiculos(playerid){
  1260.     new file[128];
  1261.     if(Salvando == false){
  1262.         Salvando = true;
  1263.         for(new X; X < 500; X++){
  1264.             format(file, sizeof(file), pasta_veiculos, X);
  1265.             if(DOF2_FileExists(file)) continue;
  1266.             if(!DOF2_FileExists(file)){
  1267.                 DOF2_CreateFile(file);
  1268.                 DOF2_SetString(file, "Criador", GetName(playerid));
  1269.                 DOF2_SaveFile();
  1270.                 IDVeiculos = X;
  1271.             }break;
  1272.         }
  1273.         format(Str, sizeof(Str), "** [INFO] {FFFFFF}Arquivo ID: {FF44AA}%d{FFFFFF} criado para salvar os veículos!", IDVeiculos);
  1274.         SendClientMessage(playerid, Red, Str);
  1275.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF} Para salvar os veículos use: {FF44AA}/C!");
  1276.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF} Se salvar errado use{FF44AA} /DC{FFFFFF} & depois {FF44AA}/DeletarVeiculos");
  1277.     }else{
  1278.         Salvando = false;
  1279.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Veículos salvos com sucesso!");
  1280.     }
  1281.     return 1;
  1282. }
  1283.  
  1284. CMD:posv(playerid, params[]){
  1285.     new POSV;
  1286.     if(sscanf(params, "d", POSV)) return SendClientMessage(playerid, Red, "** [ERRO]{AAAAAA} Utilize: /PosV [0 - X | 1 - Y | 2 - XY | 3 - XY]");
  1287.     if(POSV < 0 || POSV > 3) return SendClientMessage(playerid, Red, "** [ERRO] Use 0(X) ou 3(Y)!");
  1288.     switch(POSV){
  1289.         case 0:
  1290.         {
  1291.             SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Posição dos veículos alterada para X!");
  1292.             PosV = 0;
  1293.         }
  1294.         case 1:
  1295.         {
  1296.             SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Posição dos veículos alterada para Y!");
  1297.             PosV = 1;
  1298.         }
  1299.         case 2:
  1300.         {
  1301.             SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Posição dos veículos alterada para fora do eixo X e Y! {FF0000}(Use: /IrPos 4)");
  1302.             PosV = 2;
  1303.         }
  1304.         case 3:
  1305.         {
  1306.             SendClientMessage(playerid, Red, "** [INFO]{FFFFFF} Posição dos veículos alterada para fora do eixo X e Y! {FF0000}(Use: /IrPos 5)");
  1307.             PosV = 3;
  1308.         }
  1309.     }
  1310.     return 1;
  1311. }
  1312.  
  1313.  
  1314. CMD:dc(playerid){
  1315.     if(Salvando == true) return SendClientMessage(playerid, Red, "** [ERRO] Alguém está salvando veículos");
  1316.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF} Todos veículos criados foram destruídos!");
  1317.     for(new X; X < MAX_VEHICLES; X++){
  1318.         DestroyVehicle(Veiculo[X]);
  1319.         TotalVeiculos = 0;
  1320.         IRVeiculos = 0;
  1321.     }
  1322.     return 1;
  1323. }
  1324.  
  1325. CMD:irpos(playerid, params[]){
  1326.     new x;
  1327.     if(sscanf(params, "d", x)) return SendClientMessage(playerid, Red, "** [ERRO]{AAAAAA} Utilize: /irpos [0 ou 1 - X | 2 ou 3 - Y]");
  1328.     switch(x){
  1329.         case 0:{
  1330.             SetPlayerPos(playerid, Position[0], Position[1]+7, Position[2]);
  1331.             SetPlayerFacingAngle(playerid, Position[3]);
  1332.         }
  1333.  
  1334.         case 1:{
  1335.             SetPlayerPos(playerid, Position[0], Position[1]-7, Position[2]);
  1336.             SetPlayerFacingAngle(playerid, Position[3]);
  1337.         }
  1338.         case 2:
  1339.         {
  1340.             SetPlayerPos(playerid, Position[0]-7, Position[1], Position[2]);
  1341.             SetPlayerFacingAngle(playerid, Position[3]);
  1342.         }
  1343.         case 3:
  1344.         {
  1345.             SetPlayerPos(playerid, Position[0]+7, Position[1], Position[2]);
  1346.             SetPlayerFacingAngle(playerid, Position[3]);
  1347.         }
  1348.        
  1349.         case 4:
  1350.         {
  1351.             if (PosV != 2) return SendClientMessage(playerid, Red, "** [ERRO] Use /IrPos 5 só quanto o /PosV = 2");
  1352.             SetPlayerPos(playerid, Position[0]+4.6811, Position[1]+4.8308, Position[2]);
  1353.             SetPlayerFacingAngle(playerid, Position[3]);
  1354.         }
  1355.        
  1356.         case 5:
  1357.         {
  1358.             if (PosV != 3) return SendClientMessage(playerid, Red, "** [ERRO] Use /IrPos 5 só quanto o /PosV = 3");
  1359.             SetPlayerPos(playerid, Position[0]-4.9276, Position[1]+4.9221, Position[2]);
  1360.             SetPlayerFacingAngle(playerid, Position[3]);
  1361.         }
  1362.     }
  1363.     return 1;
  1364. }
  1365.  
  1366. CMD:mypos(playerid){
  1367.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1368.     format(Str, sizeof(Str), "X:%0.4f    Y: %0.4f    Z: %0.4f", Pos[0], Pos[1], Pos[2]);
  1369.     SendClientMessage(playerid, -1, Str);
  1370.     return 1;
  1371. }
  1372.  
  1373. CMD:dmc(playerid){
  1374.     new idv = GetPlayerVehicleID(playerid);
  1375.     DestroyVehicle(idv);
  1376.     return 1;
  1377. }
  1378.  
  1379. CMD:carregarveiculos(playerid, params[]){
  1380.     new pasta[128], x, str1[120], str2[120], str3[120], str4[120], Max;
  1381.     if(sscanf(params, "d", x)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /CarregarVeiculos [ID do arquivo]");
  1382.     format(pasta, sizeof(pasta), "/Veiculos/%02d.ini", x);
  1383.     Max = DOF2_GetInt(pasta, "Total Veiculos");
  1384.     if(!DOF2_FileExists(pasta)) return SendClientMessage(playerid, Red, "** [ERRO] Não existe veículos salvos com esse ID!");
  1385.     for(new i; i < MAX_VEHICLES; i++){
  1386.         DestroyVehicle(Veiculo[i]);
  1387.         TotalVeiculos = 0;
  1388.     }
  1389.     for(new X = 1; X <= Max; X++){
  1390.         TotalVeiculos++;
  1391.         format(str1, sizeof(str1), "%02d PosX", X);
  1392.         format(str2, sizeof(str2), "%02d PosY", X);
  1393.         format(str3, sizeof(str3), "%02d PosZ", X);
  1394.         format(str4, sizeof(str4), "%02d Angle", X);
  1395.         Pos[0] = DOF2_GetFloat(pasta, str1);
  1396.         Pos[1] = DOF2_GetFloat(pasta, str2);
  1397.         Pos[2] = DOF2_GetFloat(pasta, str3);
  1398.         Pos[3] = DOF2_GetFloat(pasta, str4);
  1399.         Veiculo[TotalVeiculos] = CreateVehicle(DOF2_GetInt(pasta, "Modelo"), Pos[0], Pos[1], Pos[2], Pos[3], Cor[0], Cor[1], -1, 0);
  1400.         AddVehicleComponent(Veiculo[TotalVeiculos], 1010);
  1401.         AddVehicleComponent(Veiculo[TotalVeiculos], 1087);
  1402.         AddVehicleComponent(Veiculo[TotalVeiculos], 1085);
  1403.     }
  1404.     Max = 0;
  1405.     format(Str, sizeof(Str), "** [ATENÇÃO] {AAAAAA}Foram carregados {FF44AA}\"%d\"{AAAAAA} veículos!", TotalVeiculos);
  1406.     SendClientMessage(playerid, Red, Str);
  1407.     format(Str, sizeof(Str), "** [ATENÇÃO] {AAAAAA}Criados por: {FF44AA}%s", DOF2_GetString(pasta, "Criador"));
  1408.     SendClientMessage(playerid, Red, Str);
  1409.     format(Str, sizeof(Str), "** [ATENÇÃO] {AAAAAA}Modelo ID: {FF44AA}%d", DOF2_GetInt(pasta, "Modelo"));
  1410.     SendClientMessage(playerid, Red, Str);
  1411.     return 1;
  1412. }
  1413.  
  1414. CMD:cores(playerid, params[]){
  1415.     new x[2];
  1416.     if(sscanf(params, "dd", x[0], x[1])) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /Cores [Cor 1] [Cor 2]");
  1417.     Cor[0] = x[0];
  1418.     Cor[1] = x[1];
  1419.     format(Str, sizeof(Str), "** [INFO]{FFFFFF} As cores dos veículos foram alteradas para %d e %d", Cor[0], Cor[1]);
  1420.     SendClientMessage(playerid, Red, Str);
  1421.     return 1;
  1422. }
  1423.  
  1424. CMD:deletarveiculos(playerid, params[]){
  1425.     new file[128], id;
  1426.     if(sscanf(params, "d", id)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /DeletarVeiculos [ID do arquivo]");
  1427.     format(file, sizeof(file), pasta_veiculos, id);
  1428.     if(!DOF2_FileExists(file)) return SendClientMessage(playerid, Red, "** [ERRO] Não existe veículos salvos com esse ID!");
  1429.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Arquivo de veículos deletados com sucesso!");
  1430.     DOF2_RemoveFile(file);
  1431.     return 1;
  1432. }
  1433.  
  1434. CMD:contar(playerid, params[]){
  1435.     new Float:p[3], y;
  1436.     if(sscanf(params, "d", y)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /Contar [tempo em segundos]");
  1437.     if(y < 1 || y > 15) return SendClientMessage(playerid, Red, "** [ERRO] O tempo deve ser entre 1 e 15 segundos!");
  1438.     SendClientMessage(playerid, Red, "** [ATENÇÃO] {FFFFFF}Você iniciou a contagem!");
  1439.     for(new i; i < MAX_PLAYERS; i++){
  1440.         if(!IsPlayerConnected(i)) continue;
  1441.         if(Evento[i] == false) continue;
  1442.         KillTimer(TempoRecorde[i]);
  1443.         Tempo[i][0] = 0;
  1444.         Tempo[i][1] = 0;
  1445.         Tempo[i][2] = 0;
  1446.         GetPlayerPos(i, p[0], p[1], p[2]);
  1447.         Count[i] = y;
  1448.         TimerCount[i] = SetTimerEx("CountDown", 1000, true, "d", i);
  1449.         format(Str, sizeof(Str), "~r~~h~#  ~p~Contagem: ~w~%02d  ~r~~h~#", Count[i]);
  1450.         PlayerTextDrawSetString(i, TextContar[i], Str);
  1451.         PlayerTextDrawShow(i, TextContar[i]);
  1452.         TogglePlayerControllable(i, 0);
  1453.         PlayerPlaySound(playerid, 1056, p[0], p[1], p[2]);
  1454.     }
  1455.     return 1;
  1456. }
  1457.  
  1458. CMD:salvarevento(playerid, params[]){
  1459.     new x;
  1460.     if(sscanf(params, "d", x)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /SalvarEvento [Vagas]");
  1461.     if(EventoCriado == true) return SendClientMessage(playerid, Red, "** [ERRO] Já existe um evento criado!");
  1462.     GetPlayerPos(playerid, PosEvento[0], PosEvento[1], PosEvento[2]);
  1463.     EventoCriado = true;
  1464.     Vagas = x;
  1465.     SendClientMessage(playerid, -1, "** [INFO] Evento salvo com sucesso!");
  1466.     return 1;
  1467. }
  1468.  
  1469. CMD:irevento(playerid){
  1470.     new file[120];
  1471.     format(file, sizeof(file), pasta_race, CPCarregado);
  1472.     if (EventoCriado == false) return SendClientMessage(playerid, Red, "** [ERRO] Não existe um evento criado!");
  1473.     if (Evento[playerid] == true) return SendClientMessage(playerid, Red, "** [ERRO] Você já está no evento!");
  1474.     if (Status == true) return SendClientMessage(playerid, Red, "** [ERRO] O evento está fechado!");
  1475.     if (Vagas < 1) return SendClientMessage(playerid, Red, "** [ERRO] Não há mais vagas!");
  1476.     if (EventoIniciou == true){
  1477.         for (new i; i < MAX_PLAYERS; i++){
  1478.             if (!IsPlayerConnected(i)) continue;
  1479.             if (i == playerid) continue;
  1480.             Tempo[playerid][0] = Tempo[i][0];
  1481.             Tempo[playerid][1] = Tempo[i][1];
  1482.         }
  1483.         TempoRecorde[playerid] = SetTimerEx("TimerT", 1000, true, "d", playerid);
  1484.     }
  1485.     if (Congelado == true){
  1486.         TogglePlayerControllable(playerid, 0);
  1487.     }else{
  1488.         TogglePlayerControllable(playerid, 1);
  1489.     }
  1490.  
  1491.    
  1492.     format(Str, sizeof(Str), "%s", DOF2_GetString(file, "Recordista"));
  1493.     PlayerTextDrawSetString(playerid, InicioRace4[playerid], Str);
  1494.     format(Str, sizeof(Str), "%02d", CPCarregado);
  1495.     PlayerTextDrawSetString(playerid, InicioRace2[playerid], Str);
  1496.     if(DOF2_GetInt(file, "Recorde Minutos") != 90){
  1497.         format(Str, sizeof(Str), "00:%02d:%02d", DOF2_GetInt(file, "Recorde Minutos"), DOF2_GetInt(file, "Recorde Segundos"));
  1498.     }else{
  1499.         format(Str, sizeof(Str), "00:00:00");
  1500.     }
  1501.     PlayerTextDrawSetString(playerid, InicioRace6[playerid], Str);
  1502.     PlayerTextDrawShow(playerid, TempoCorrida[playerid]);
  1503.     PlayerTextDrawShow(playerid, InicioRace0[playerid]);
  1504.     PlayerTextDrawShow(playerid, InicioRace7[playerid]);
  1505.     PlayerTextDrawShow(playerid, InicioRace1[playerid]);
  1506.     PlayerTextDrawShow(playerid, InicioRace2[playerid]);
  1507.     PlayerTextDrawShow(playerid, InicioRace3[playerid]);
  1508.     PlayerTextDrawShow(playerid, InicioRace4[playerid]);
  1509.     PlayerTextDrawShow(playerid, InicioRace5[playerid]);
  1510.     PlayerTextDrawShow(playerid, InicioRace6[playerid]);
  1511.  
  1512.  
  1513.     format(Str, sizeof(Str), "~g~~h~0/%d", DOF2_GetInt(file, "Total CPS"));
  1514.     PlayerTextDrawSetString(playerid, Textdraw5[playerid], Str);
  1515.     PlayerTextDrawShow(playerid, Textdraw0[playerid]);
  1516.     PlayerTextDrawShow(playerid, Textdraw1[playerid]);
  1517.     PlayerTextDrawShow(playerid, Textdraw2[playerid]);
  1518.     PlayerTextDrawShow(playerid, Textdraw5[playerid]);
  1519.     PlayerTextDrawShow(playerid, Textdraw6[playerid]);
  1520.     PlayerTextDrawShow(playerid, Textdraw7[playerid]);
  1521.     PlayerTextDrawShow(playerid, Textdraw8[playerid]);
  1522.     PlayerTextDrawShow(playerid, Textdraw9[playerid]);
  1523.  
  1524.     PlayersEvento++;
  1525.     IRVeiculos++;
  1526.     Vagas--;
  1527.     SetCameraBehindPlayer(playerid);
  1528.     Evento[playerid] = true;
  1529.     SetPlayerPos(playerid, PosEvento[0], PosEvento[1], PosEvento[2]);
  1530.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Você veio para o evento!");
  1531.     PutPlayerInVehicle(playerid, Veiculo[IRVeiculos], 0);
  1532.     return 1;
  1533. }
  1534.  
  1535. CMD:sairevento(playerid){
  1536.     if(Evento[playerid] == false) return SendClientMessage(playerid, Red, "** [ERRO] Você não está em um evento!");
  1537.     Evento[playerid] = false;
  1538.     SetTimerEx("EsconderTextdraw", 100, false, "i", playerid);
  1539.     SpawnPlayer(playerid);
  1540.     PlayersEvento--;
  1541.     Vagas++;
  1542.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Você saiu do evento e foi respawnado!");
  1543.     return 1;
  1544. }
  1545.  
  1546. CMD:deletarevento(playerid){
  1547.     SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Evento deletado com sucesso!");
  1548.     for(new I; I < 50; I++){
  1549.         if(!IsPlayerConnected(I)) continue;
  1550.         PlayerTextDrawHide(playerid, TempoCorrida[I]);
  1551.         Evento[I] = false;
  1552.         EventoCriado = false;
  1553.         Congelado = true;
  1554.         IRVeiculos = 0;
  1555.         PlayersEvento = 0;
  1556.         Tempo[I][0] = 0;
  1557.         Tempo[I][1] = 0;
  1558.         EventoIniciou = false;
  1559.         DisableRemoteVehicleCollisions(I, 0);
  1560.         SetTimerEx("EsconderTextdraw", 100, false, "i", I);
  1561.         PlayerTextDrawSetString(I, Textdraw2[I], "~y~~h~1|:  ~r~Ninguem");
  1562.         PlayerTextDrawSetString(I, Textdraw6[I], "~y~~h~2|:  ~r~Ninguem");
  1563.         PlayerTextDrawSetString(I, Textdraw7[I], "~y~~h~3|:  ~r~Ninguem");
  1564.         PlayerTextDrawSetString(I, Textdraw8[I], "~y~~h~4|:  ~r~Ninguem");
  1565.         PlayerTextDrawSetString(I, Textdraw9[I], "~y~~h~5|:  ~r~Ninguem");
  1566.     }
  1567.     return 1;
  1568. }
  1569.  
  1570. CMD:colisao(playerid){
  1571.     if(Colision == false)
  1572.     {
  1573.         Colision = true;
  1574.         for(new i=0; i < MAX_PLAYERS; i++)
  1575.         {
  1576.             DisableRemoteVehicleCollisions(i, 1);
  1577.         }
  1578.         SendClientMessage(playerid, -1, "* Colisão entre os veículos desativada");
  1579.     }else if (Colision == true){
  1580.         Colision = false;
  1581.         for(new i=0; i < MAX_PLAYERS; i++)
  1582.         {
  1583.             DisableRemoteVehicleCollisions(i, 0);
  1584.         }
  1585.         SendClientMessage(playerid, -1, "* Colisão entre os veículos ativada");
  1586.     }
  1587.     return 1;
  1588. }
  1589.  
  1590. CMD:fecharevento(playerid){
  1591.     if(Status == false){
  1592.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Evento fechado!");
  1593.         Status = true;
  1594.     }else{
  1595.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Evento aberto!");
  1596.         Status = false;
  1597.     }
  1598.     return 1;
  1599. }
  1600.  
  1601. CMD:stopppp(playerid){
  1602.     TempoRecorde[playerid] = SetTimerEx("TimerT", 1000, false, "d", playerid);
  1603.     KillTimer(TempoRecorde[playerid]);
  1604.     return 1;
  1605. }
  1606.  
  1607. CMD:congelarevento(playerid){
  1608.     if(Congelado == false){
  1609.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Você congelou todos jogadores do evento!");
  1610.         Congelado = true;
  1611.     }else{
  1612.         SendClientMessage(playerid, Red, "** [INFO] {FFFFFF}Você descongelou todos os jogadores do evento!");
  1613.         Congelado = false;
  1614.     }
  1615.     return 1;
  1616. }
  1617.  
  1618. CMD:autoreparar(playerid){
  1619.     if (AutoRepararX[playerid] == false){
  1620.         AutoRepararX[playerid] = true;
  1621.         AutoReparar[playerid] = SetTimerEx("AutoRepararP", 1000, true, "i", playerid);
  1622.         SendClientMessage(playerid, -1, "* Autoreparar ativado!");
  1623.     }else
  1624.     if(AutoRepararX[playerid] == true){
  1625.         AutoRepararX[playerid] = false;
  1626.         KillTimer(AutoReparar[playerid]);
  1627.         SendClientMessage(playerid, -1, "* Autoreparar desativado!");
  1628.     }
  1629.     return 1;
  1630. }
  1631.  
  1632. CMD:anunciar(playerid, params[]){
  1633.     new Texto[150], strin[150];
  1634.     if (sscanf(params, "s[150]", Texto)) return SendClientMessage(playerid, Red, "** [ERRO] {AAAAAA}Utilize: /Anunciar [Texto]");
  1635.     format(strin, sizeof(strin), "~r~~h~#    ~p~%s :    ~w~%s    ~r~~h~#", GetName(playerid), Texto);
  1636.     TextDrawSetString(TextdrawAnuncio, strin);
  1637.     TextDrawShowForAll(TextdrawAnuncio);
  1638.     KillTimer(Anuncio);
  1639.     Anuncio = SetTimer("RemoverAnuncio", 5000, false);
  1640.     return 1;
  1641. }
  1642.  
  1643.  
  1644. CMD:asdsadasdas(playerid){
  1645.     for(new i; i < MAX_PLAYERS; i++){
  1646.         if(!IsPlayerConnected(i)) continue;
  1647.         PlayerTextDrawHide(playerid, InicioRace0[i]);
  1648.         PlayerTextDrawHide(playerid, InicioRace1[i]);
  1649.         PlayerTextDrawHide(playerid, InicioRace2[i]);
  1650.         PlayerTextDrawHide(playerid, InicioRace3[i]);
  1651.         PlayerTextDrawHide(playerid, InicioRace4[i]);
  1652.         PlayerTextDrawHide(playerid, InicioRace5[i]);
  1653.         PlayerTextDrawHide(playerid, InicioRace6[i]);
  1654.         PlayerTextDrawHide(playerid, InicioRace7[i]);
  1655.         PlayerTextDrawDestroy(playerid, InicioRace0[i]);
  1656.         PlayerTextDrawDestroy(playerid, InicioRace1[i]);
  1657.         PlayerTextDrawDestroy(playerid, InicioRace2[i]);
  1658.         PlayerTextDrawDestroy(playerid, InicioRace3[i]);
  1659.         PlayerTextDrawDestroy(playerid, InicioRace4[i]);
  1660.         PlayerTextDrawDestroy(playerid, InicioRace5[i]);
  1661.         PlayerTextDrawDestroy(playerid, InicioRace6[i]);
  1662.         PlayerTextDrawDestroy(playerid, InicioRace7[i]);
  1663.     }
  1664.     return 1;
  1665. }
  1666.  
  1667.  
  1668. CMD:deletarcp(playerid){
  1669.     new file[128];
  1670.     format(file, sizeof(file), pasta_race, RaceName);
  1671.     CPCountX[playerid]--;
  1672.     CPCountY[playerid]--;
  1673.     CPCountZ[playerid]--;
  1674.     CPCount--;
  1675.     TotalCPS = TotalCPS - 1;
  1676.     format(String, sizeof(String), "%02d CPX", CPCountX[playerid]-1);
  1677.     format(String2, sizeof(String2), "%02d CPY", CPCountY[playerid]-1);
  1678.     format(String3, sizeof(String3), "%02d CPZ", CPCountZ[playerid]-1);
  1679.     SetPlayerRaceCheckpoint(playerid, 1, DOF2_GetFloat(file, String), DOF2_GetFloat(file, String2), DOF2_GetFloat(file, String3), 0.0, 0.0, 0.0, 7);
  1680.     SendClientMessage(playerid, sizeof(playerid), "* Último CP salvo foi deletado");
  1681.     return 1;
  1682. }
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688. forward RemoverAnuncio();
  1689. forward AutoRepararP(playerid);
  1690. forward Recorde(playerid);
  1691. forward CountDown(playerid);
  1692. forward TimerRecorde(playerid);
  1693. forward TimerT(playerid);
  1694. forward EsconderTextdraw(playerid);
  1695. forward OrganizarArray(playerid);
  1696. forward CountCP(playerid);
  1697.  
  1698.  
  1699.  
  1700. public CountCP(playerid)
  1701. {
  1702.     PlayerTextDrawHide(playerid, CPConquistado[playerid]);
  1703.     return 1;
  1704. }
  1705.  
  1706. public RemoverAnuncio()
  1707. {
  1708.     TextDrawHideForAll(TextdrawAnuncio);
  1709.     TextDrawSetString(TextdrawAnuncio, "");
  1710.     return 1;
  1711. }
  1712.  
  1713.  
  1714.  
  1715. forward AtualizarTextdraws(playerid);
  1716. public AtualizarTextdraws(playerid)
  1717. {
  1718.     if (Terminou == 1)
  1719.     {
  1720.         format(Primeiro, sizeof(Primeiro), "~y~~h~1|: ~w~%s ~p~~h~(%02d:%02d)~g~  Won", GetName(Lugar[1]), Tempo[Lugar[1]][1], Tempo[Lugar[1]][0]);
  1721.         PlayerTextDrawSetString(playerid, Textdraw2[playerid], Primeiro);
  1722.     }
  1723.     if (Terminou == 2)
  1724.     {
  1725.         format(Segundo, sizeof(Segundo), "~y~~h~2|: ~w~%s ~p~~h~(%02d:%02d)", GetName(Lugar[2]), Tempo[Lugar[2]][1], Tempo[Lugar[2]][0]);
  1726.         PlayerTextDrawSetString(playerid, Textdraw6[playerid], Segundo);
  1727.     }
  1728.     if (Terminou == 3)
  1729.     {
  1730.         format(Terceiro, sizeof(Terceiro), "~y~~h~3|: ~w~%s ~p~~h~(%02d:%02d)", GetName(Lugar[3]), Tempo[Lugar[3]][1], Tempo[Lugar[3]][0]);
  1731.         PlayerTextDrawSetString(playerid, Textdraw7[playerid], Terceiro);
  1732.     }
  1733.     if (Terminou == 4)
  1734.     {
  1735.         format(Quarto, sizeof(Quarto), "~y~~h~4|: ~w~%s ~p~~h~(%02d:%02d)", GetName(Lugar[4]), Tempo[Lugar[4]][1], Tempo[Lugar[4]][0]);
  1736.         PlayerTextDrawSetString(playerid, Textdraw8[playerid], Quarto);
  1737.     }
  1738.     if (Terminou == 5)
  1739.     {
  1740.         format(Quinto, sizeof(Quinto), "~y~~h~5|: ~w~%s ~p~~h~(%02d:%02d)", GetName(Lugar[5]), Tempo[Lugar[5]][1], Tempo[Lugar[5]][0]);
  1741.         PlayerTextDrawSetString(playerid, Textdraw9[playerid], Quinto);
  1742.     }
  1743.     return 1;
  1744. }
  1745. public EsconderTextdraw(playerid){
  1746.     if(Evento[playerid] == false){
  1747.         PlayerTextDrawHide(playerid, Textdraw0[playerid]);
  1748.         PlayerTextDrawHide(playerid, Textdraw1[playerid]);
  1749.         PlayerTextDrawHide(playerid, Textdraw2[playerid]);
  1750.         PlayerTextDrawHide(playerid, Textdraw5[playerid]);
  1751.         PlayerTextDrawHide(playerid, Textdraw6[playerid]);
  1752.         PlayerTextDrawHide(playerid, Textdraw7[playerid]);
  1753.         PlayerTextDrawHide(playerid, Textdraw8[playerid]);
  1754.         PlayerTextDrawHide(playerid, Textdraw9[playerid]);
  1755.         PlayerTextDrawHide(playerid, TextContar[playerid]);
  1756.         PlayerTextDrawHide(playerid, Textdraw10[playerid]);
  1757.        
  1758.        
  1759.         PlayerTextDrawHide(playerid, TempoCorrida[playerid]);
  1760.         PlayerTextDrawHide(playerid, InicioRace0[playerid]);
  1761.         PlayerTextDrawHide(playerid, InicioRace1[playerid]);
  1762.         PlayerTextDrawHide(playerid, InicioRace2[playerid]);
  1763.         PlayerTextDrawHide(playerid, InicioRace3[playerid]);
  1764.         PlayerTextDrawHide(playerid, InicioRace4[playerid]);
  1765.         PlayerTextDrawHide(playerid, InicioRace5[playerid]);
  1766.         PlayerTextDrawHide(playerid,InicioRace6[playerid]);
  1767.         PlayerTextDrawHide(playerid, InicioRace7[playerid]);
  1768.     }
  1769.     if (EventoCriado == false)
  1770.     {
  1771.         for(new i; i < MAX_PLAYERS; i++){
  1772.  
  1773.             PlayerTextDrawHide(i, Textdraw0[i]);
  1774.             PlayerTextDrawHide(i, Textdraw1[i]);
  1775.             PlayerTextDrawHide(i, Textdraw2[i]);
  1776.             PlayerTextDrawHide(i, Textdraw5[i]);
  1777.             PlayerTextDrawHide(i, Textdraw6[i]);
  1778.             PlayerTextDrawHide(i, Textdraw7[i]);
  1779.             PlayerTextDrawHide(i, Textdraw8[i]);
  1780.             PlayerTextDrawHide(i, Textdraw9[i]);
  1781.             PlayerTextDrawHide(i, Textdraw10[i]);
  1782.             PlayerTextDrawHide(i, TextContar[i]);
  1783.  
  1784.             PlayerTextDrawHide(i, TempoCorrida[i]);
  1785.             PlayerTextDrawHide(i, InicioRace0[i]);
  1786.             PlayerTextDrawHide(i, InicioRace1[i]);
  1787.             PlayerTextDrawHide(i, InicioRace2[i]);
  1788.             PlayerTextDrawHide(i, InicioRace3[i]);
  1789.             PlayerTextDrawHide(i, InicioRace4[i]);
  1790.             PlayerTextDrawHide(i, InicioRace5[i]);
  1791.             PlayerTextDrawHide(i, InicioRace6[i]);
  1792.             PlayerTextDrawHide(i, InicioRace7[i]);
  1793.         }
  1794.     }
  1795.     return 1;
  1796. }
  1797.  
  1798. public TimerT(playerid){
  1799.     Tempo[playerid][0]++;
  1800.     if(Tempo[playerid][0] > 59){
  1801.         Tempo[playerid][0] = 0;
  1802.         Tempo[playerid][1]++;
  1803.     }
  1804.     format(Str, sizeof(Str), "%02d:%02d:%02d", Tempo[playerid][2], Tempo[playerid][1], Tempo[playerid][0]);
  1805.     PlayerTextDrawSetString(playerid, TempoCorrida[playerid], Str);
  1806.     if(Tempo[playerid][1] > 59){
  1807.         Tempo[playerid][2]++;
  1808.         Tempo[playerid][1] = 0;
  1809.     }
  1810.  
  1811.  
  1812.     return 1;
  1813. }
  1814.  
  1815. public AutoRepararP(playerid){
  1816.     RepairVehicle(GetPlayerVehicleID(playerid));
  1817.     return 1;
  1818. }
  1819.  
  1820.  
  1821. public CountDown(playerid){
  1822.     new Float:p[3];
  1823.     GetPlayerPos(playerid, p[0], p[1], p[2]);
  1824.     Count[playerid]--;
  1825.  
  1826.     if(Count[playerid] < 1){
  1827.         KillTimer(TimerCount[playerid]);
  1828.         PlayerTextDrawHide(playerid, TextContar[playerid]);
  1829.         GameTextForPlayer(playerid, "~g~~h~GO ~y~~h~GO ~r~~h~GO!", 3600, 3);
  1830.         TogglePlayerControllable(playerid, 1);
  1831.         Congelado = false;
  1832.         EventoIniciou = true;
  1833.         TempoRecorde[playerid] = SetTimerEx("TimerT", 1000, true, "d", playerid);
  1834.         PlayerPlaySound(playerid, 1057,p[0],p[1],p[2]);
  1835.     }else if(Count[playerid] > 0){
  1836.         PlayerTextDrawShow(playerid, TextContar[playerid]);
  1837.         format(Str, sizeof(Str), "~r~~h~#  ~p~Contagem: ~w~%02d  ~r~~h~#", Count[playerid]);
  1838.         PlayerTextDrawSetString(playerid, TextContar[playerid], Str);
  1839.         PlayerPlaySound(playerid, 1056,p[0],p[1],p[2]);
  1840.     }
  1841.  
  1842.     return 1;
  1843. }
  1844.  
  1845.  
  1846. stock GetName(playerid){
  1847.     new Nome[MAX_PLAYER_NAME];
  1848.     GetPlayerName(playerid, Nome, sizeof(Nome));
  1849.     return Nome;
  1850. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement