Guest User

Sistema de Test de Habilitação

a guest
Mar 18th, 2012
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 30.43 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define PickupCor 0xF09C00AA
  4. #define DMenuAutoEscola          200
  5. #define DInstrucaoAutoEscola     201
  6. #define DRepetirCarros1          202
  7. #define DRepetirCarros2          203
  8. #define DRepetirCarros3          204
  9. #define DRepetirMoto1            205
  10. #define DRepetirMoto2            206
  11. #define DRepetirMoto3            207
  12. #define DRepetirAero1            208
  13. #define DRepetirAero2            209
  14. #define MAXPLAYERS 40
  15. //=============================[† Forward †]====================================
  16. forward VerificarConclusao(playerid);
  17. //============================[† Variáveis †]===================================
  18. new VAutoEscolaTeste[MAXPLAYERS];        //Veiculo do teste
  19. new TesteEtapa[MAXPLAYERS];              //Etapa do teste
  20. new FazendoTeste[MAXPLAYERS];            //Fazendo teste
  21. new Verificar[MAXPLAYERS];               //Tempo para chegada
  22. new Float: TesteCoords[21][3] =          //Coordenadas dos Checkpoints
  23. {
  24.     {-1641.479980, 1300.554687, 6.861728},       //Chegada 1° teste carros
  25.     {-1838.397460, -2455.462890, 27.546628},     //1° Ponto 2° teste carros
  26.     {-1649.979736, -2619.526611, 45.465484},     //2° Ponto 2° teste carros
  27.     {-1180.888061, -2639.533447, 11.539744},     //3° Ponto 2° teste carros
  28.     {-780.500183, -2684.883544, 83.137527},      //4° Ponto 2° teste carros
  29.     {-364.759643, -2255.772216, 43.043220},      //5° Ponto 2° teste carros
  30.     {-160.736419, -2425.323242, 35.856044},      //6° Ponto 2° teste carros
  31.     {-184.029815, -2819.222167, 42.097366},      //7° Ponto 2° teste carros
  32.     {-1342.344726, -2875.889160, 54.987930},     //8° Ponto 2° teste carros
  33.     {-1970.295898, -2434.038574, 30.194002},     //Chegada 2° teste carros
  34.     {2305.241455, 1962.293823, 9.433162},        //1° Ponto 3° teste carros
  35.     {2236.203613, 1974.228759, 31.350551},       //Saída 3° teste carros
  36.     {2305.241455, 1962.293823, 9.433162},        //Chegada 3° teste carros
  37.     {305.941436, -1760.017211, 7.244368},        //1° Ponto 1° teste motos
  38.     {294.514434, -1758.280761, 8.047305},        //Chegada 1° teste motos
  39.     {2775.379394, -1044.423217, 38.830417},      //1° Ponto 2° teste motos
  40.     {2697.045410, -1050.630004, 67.454254},      //2° Ponto 2° teste motos
  41.     {2660.527099, -1071.078979, 68.900634},      //3° Ponto 2° teste motos
  42.     {2742.664794, -1177.842651, 68.896690},      //4° Ponto 2° teste motos
  43.     {2815.201416, -1170.591308, 32.239631},      //Chegada 2° teste motos
  44.     {-577.292663, -189.324462, 78.249137}        //Chegada 3° teste motos
  45. };
  46.  
  47. main()
  48. {
  49.     print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                            Progressão Pawn\n              Envolvendo jogadores, revolucionando servidores!\n                             Josma_CMD\n\n\n\n\n\n\n\n\n");
  50. }//MAIN By: Gill Penner
  51.  
  52. public OnFilterScriptInit()
  53. {
  54.     CreatePickup(1239, 1, 1494.325195,1304.942871,1093.289062, 0);   //Pickup autoescola entrada
  55.     CreatePickup(1239, 1, 1081.219726, -1696.847534, 13.546875, 0);  //Pickup autoescola saída
  56.     CreatePickup(2894, 1, 1490.509765, 1305.782958, 1093.296386, 0); //Pickup menu auto escola
  57.     Create3DTextLabel("Auto escola\nPressione ENTER para entrar.", PickupCor, 356.8607,186.0784,1009.1264, 40, 0, 0);
  58.     Create3DTextLabel("Auto escola\nPressione ENTER para sair.", PickupCor, 1494.325195,1304.942871,1093.289062, 40, 0, 0);
  59.     Create3DTextLabel("Menu Auto escola\nPressione ENTER para ver as opções.", PickupCor, 1490.509765, 1305.782958, 1093.296386, 40, 0, 0);
  60.     return 1;
  61. }
  62.  
  63. public OnPlayerConnect(playerid)
  64. {
  65.     SendClientMessage(playerid, 0x1E90FF99, "Este servidor usa um sistema de teste de habilitação do{FFFFFF} Progressão Pawn - Josma_CMD");
  66.     return 1;
  67. }
  68.  
  69. public OnPlayerStateChange(playerid, newstate, oldstate)
  70. {
  71.     if(oldstate == PLAYER_STATE_DRIVER)
  72.     {
  73.         if(TesteEtapa[playerid] == 14 && FazendoTeste[playerid] == 1 || TesteEtapa[playerid] == 13 && FazendoTeste[playerid] == 1)
  74.         {
  75.             ShowPlayerDialog(playerid, DRepetirMoto1, DIALOG_STYLE_MSGBOX, "Você caiu", "Você caiu da moto, deseja repetir o teste?", "Sim", "Não");
  76.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  77.             DisablePlayerRaceCheckpoint(playerid);
  78.             return 1;
  79.         }
  80.         return 1;
  81.     }
  82.     return 1;
  83. }
  84.  
  85. public OnPlayerEnterRaceCheckpoint(playerid)
  86. {
  87.     new Float: lataria, Float: P[3];                       //Cria as variáveis que serão usadas abaixo
  88.     GetVehicleHealth(VAutoEscolaTeste[playerid], lataria); //Getará o health do veiculo, para ver se o player danificou ele no teste
  89.     GetPlayerPos(playerid, P[0], P[1], P[2]);          //Pegará a coordenada de onde será aplicado o som
  90.     PlayerPlaySound(playerid, 1053, P[0], P[1], P[2]); //Aplicará som ao entrar no Race Checkpoint
  91.     if(TesteEtapa[playerid] == 1 && FazendoTeste[playerid] == 1)
  92.     {
  93.         if(lataria < 1000)
  94.         {
  95.             ShowPlayerDialog(playerid, DRepetirCarros1, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você danificou seu veículo, deseja repetir o teste?", "Sim", "Não");
  96.             KillTimer(Verificar[playerid]);
  97.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  98.             FazendoTeste[playerid] = 0;
  99.             DisablePlayerRaceCheckpoint(playerid);
  100.             return 1;
  101.         }
  102.         else if(lataria == 1000)
  103.         {
  104.             ShowPlayerDialog(playerid, DRepetirCarros2, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você deseja passar para a próxima etapa do teste de habilitação?", "Sim", "Não");
  105.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  106.             FazendoTeste[playerid] = 0;
  107.             KillTimer(Verificar[playerid]);
  108.             DisablePlayerRaceCheckpoint(playerid);
  109.             return 1;
  110.         }
  111.         return 1;
  112.     }
  113.     if(TesteEtapa[playerid] == 2 && FazendoTeste[playerid] == 1)
  114.     {
  115.         DisablePlayerRaceCheckpoint(playerid);
  116.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[2][0], TesteCoords[2][1], TesteCoords[2][2], TesteCoords[3][0], TesteCoords[3][1], TesteCoords[3][2], 5.0);
  117.         TesteEtapa[playerid] = 3;
  118.         return 1;
  119.     }
  120.     if(TesteEtapa[playerid] == 3 && FazendoTeste[playerid] == 1)
  121.     {
  122.         DisablePlayerRaceCheckpoint(playerid);
  123.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[3][0], TesteCoords[3][1], TesteCoords[3][2], TesteCoords[4][0], TesteCoords[4][1], TesteCoords[4][2], 5.0);
  124.         TesteEtapa[playerid] = 4;
  125.         return 1;
  126.     }
  127.     if(TesteEtapa[playerid] == 4 && FazendoTeste[playerid] == 1)
  128.     {
  129.         DisablePlayerRaceCheckpoint(playerid);
  130.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[4][0], TesteCoords[4][1], TesteCoords[4][2], TesteCoords[5][0], TesteCoords[5][1], TesteCoords[5][2], 5.0);
  131.         TesteEtapa[playerid] = 5;
  132.         return 1;
  133.     }
  134.     if(TesteEtapa[playerid] == 5 && FazendoTeste[playerid] == 1)
  135.     {
  136.         DisablePlayerRaceCheckpoint(playerid);
  137.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[5][0], TesteCoords[5][1], TesteCoords[5][2], TesteCoords[6][0], TesteCoords[6][1], TesteCoords[6][2], 5.0);
  138.         TesteEtapa[playerid] = 6;
  139.         return 1;
  140.     }
  141.     if(TesteEtapa[playerid] == 6 && FazendoTeste[playerid] == 1)
  142.     {
  143.         DisablePlayerRaceCheckpoint(playerid);
  144.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[6][0], TesteCoords[6][1], TesteCoords[6][2], TesteCoords[7][0], TesteCoords[7][1], TesteCoords[7][2], 5.0);
  145.         TesteEtapa[playerid] = 7;
  146.         return 1;
  147.     }
  148.     if(TesteEtapa[playerid] == 7 && FazendoTeste[playerid] == 1)
  149.     {
  150.         DisablePlayerRaceCheckpoint(playerid);
  151.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[7][0], TesteCoords[7][1], TesteCoords[7][2], TesteCoords[8][0], TesteCoords[8][1], TesteCoords[8][2], 5.0);
  152.         TesteEtapa[playerid] = 8;
  153.         return 1;
  154.     }
  155.     if(TesteEtapa[playerid] == 8 && FazendoTeste[playerid] == 1)
  156.     {
  157.         DisablePlayerRaceCheckpoint(playerid);
  158.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[8][0], TesteCoords[8][1], TesteCoords[8][2], TesteCoords[9][0], TesteCoords[9][1], TesteCoords[9][2], 5.0);
  159.         TesteEtapa[playerid] = 9;
  160.         return 1;
  161.     }
  162.     if(TesteEtapa[playerid] == 9 && FazendoTeste[playerid] == 1)
  163.     {
  164.         DisablePlayerRaceCheckpoint(playerid);
  165.         SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[9][0], TesteCoords[9][1], TesteCoords[9][2], TesteCoords[9][0], TesteCoords[9][1], TesteCoords[9][2], 5.0);
  166.         TesteEtapa[playerid] = 10;
  167.         return 1;
  168.     }
  169.     if(TesteEtapa[playerid] == 10 && FazendoTeste[playerid] == 1)
  170.     {
  171.         if(lataria < 1000)
  172.         {
  173.             ShowPlayerDialog(playerid, DRepetirCarros2, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você danificou seu veículo, deseja repetir o teste?", "Sim", "Não");
  174.             KillTimer(Verificar[playerid]);
  175.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  176.             FazendoTeste[playerid] = 0;
  177.             DisablePlayerRaceCheckpoint(playerid);
  178.             return 1;
  179.         }
  180.         else if(lataria == 1000)
  181.         {
  182.             ShowPlayerDialog(playerid, DRepetirCarros3, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você deseja passar para a próxima etapa do teste de habilitação?", "Sim", "Não");
  183.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  184.             FazendoTeste[playerid] = 0;
  185.             KillTimer(Verificar[playerid]);
  186.             DisablePlayerRaceCheckpoint(playerid);
  187.             return 1;
  188.         }
  189.         return 1;
  190.     }
  191.     if(TesteEtapa[playerid] == 11 && FazendoTeste[playerid] == 1)
  192.     {
  193.         DisablePlayerRaceCheckpoint(playerid);
  194.         SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[11][0], TesteCoords[11][1], TesteCoords[11][2], TesteCoords[11][0], TesteCoords[11][1], TesteCoords[11][2], 5.0);
  195.         TesteEtapa[playerid] = 12;
  196.         return 1;
  197.     }
  198.     if(TesteEtapa[playerid] == 12 && FazendoTeste[playerid] == 1)
  199.     {
  200.         if(lataria < 1000)
  201.         {
  202.             ShowPlayerDialog(playerid, DRepetirCarros3, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você danificou seu veículo, deseja repetir o teste?", "Sim", "Não");
  203.             KillTimer(Verificar[playerid]);
  204.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  205.             FazendoTeste[playerid] = 0;
  206.             DisablePlayerRaceCheckpoint(playerid);
  207.             return 1;
  208.         }
  209.         else if(lataria == 1000)
  210.         {
  211.             SetPlayerInterior(playerid, 3);
  212.             SetPlayerPos(playerid, 1497.034423, 1308.573730, 1093.294799);
  213.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você tirou sua carteira de habilitação, e agora pode dirigir carros.", "Ok", "");
  214.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  215.             FazendoTeste[playerid] = 0;
  216.             KillTimer(Verificar[playerid]);
  217.             DisablePlayerRaceCheckpoint(playerid);
  218.             //Aqui a variável habilitando o jogador à pilotar carros
  219.             return 1;
  220.         }
  221.         return 1;
  222.     }
  223.     if(TesteEtapa[playerid] == 13 && FazendoTeste[playerid] == 1)
  224.     {
  225.         DisablePlayerRaceCheckpoint(playerid);
  226.         SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[14][0], TesteCoords[14][1], TesteCoords[14][2], TesteCoords[14][0], TesteCoords[14][1], TesteCoords[14][2], 5.0);
  227.         TesteEtapa[playerid] = 14;
  228.         FazendoTeste[playerid] = 0;
  229.         return 1;
  230.     }
  231.     if(TesteEtapa[playerid] == 14 && FazendoTeste[playerid] == 0)
  232.     {
  233.         DisablePlayerRaceCheckpoint(playerid);
  234.         DestroyVehicle(VAutoEscolaTeste[playerid]);
  235.         ShowPlayerDialog(playerid, DRepetirMoto2, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você passou na primeira etapa, deseja ir para a próxima etapa do teste?", "Sim", "Não");
  236.         return 1;
  237.     }
  238.     if(TesteEtapa[playerid] == 15 && FazendoTeste[playerid] == 1)
  239.     {
  240.         DisablePlayerRaceCheckpoint(playerid);
  241.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[15][0], TesteCoords[15][1], TesteCoords[15][2], TesteCoords[16][0], TesteCoords[16][1], TesteCoords[16][2], 5.0);
  242.         TesteEtapa[playerid] = 16;
  243.         return 1;
  244.     }
  245.     if(TesteEtapa[playerid] == 16 && FazendoTeste[playerid] == 1)
  246.     {
  247.         DisablePlayerRaceCheckpoint(playerid);
  248.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[16][0], TesteCoords[16][1], TesteCoords[16][2], TesteCoords[17][0], TesteCoords[17][1], TesteCoords[17][2], 5.0);
  249.         TesteEtapa[playerid] = 17;
  250.         return 1;
  251.     }
  252.     if(TesteEtapa[playerid] == 17 && FazendoTeste[playerid] == 1)
  253.     {
  254.         DisablePlayerRaceCheckpoint(playerid);
  255.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[17][0], TesteCoords[17][1], TesteCoords[17][2], TesteCoords[18][0], TesteCoords[18][1], TesteCoords[18][2], 5.0);
  256.         TesteEtapa[playerid] = 18;
  257.         return 1;
  258.     }
  259.     if(TesteEtapa[playerid] == 18 && FazendoTeste[playerid] == 1)
  260.     {
  261.         DisablePlayerRaceCheckpoint(playerid);
  262.         SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[18][0], TesteCoords[18][1], TesteCoords[18][2], TesteCoords[19][0], TesteCoords[19][1], TesteCoords[19][2], 5.0);
  263.         TesteEtapa[playerid] = 19;
  264.         return 1;
  265.     }
  266.     if(TesteEtapa[playerid] == 19 && FazendoTeste[playerid] == 1)
  267.     {
  268.         DisablePlayerRaceCheckpoint(playerid);
  269.         SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[19][0], TesteCoords[19][1], TesteCoords[19][2], TesteCoords[19][0], TesteCoords[19][1], TesteCoords[19][2], 5.0);
  270.         TesteEtapa[playerid] = 20;
  271.         return 1;
  272.     }
  273.     if(TesteEtapa[playerid] == 20 && FazendoTeste[playerid] == 1)
  274.     {
  275.         DisablePlayerRaceCheckpoint(playerid);
  276.         DestroyVehicle(VAutoEscolaTeste[playerid]);
  277.         ShowPlayerDialog(playerid, DRepetirMoto3, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você passou na segunda etapa, deseja ir para a próxima etapa do teste?", "Sim", "Não");
  278.         TesteEtapa[playerid] = 0;
  279.         KillTimer(Verificar[playerid]);
  280.         return 1;
  281.     }
  282.     if(TesteEtapa[playerid] == 21 && FazendoTeste[playerid] == 1)
  283.     {
  284.         DisablePlayerRaceCheckpoint(playerid);
  285.         DestroyVehicle(VAutoEscolaTeste[playerid]);
  286.         SetPlayerInterior(playerid, 3);
  287.         SetPlayerPos(playerid, 1497.034423, 1308.573730, 1093.294799);
  288.         ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você concluiu o teste para adiquirir sua habilitação, agora já pode pilotar motos.", "Ok", "");
  289.         TesteEtapa[playerid] = 0;
  290.         KillTimer(Verificar[playerid]);
  291.         //Aqui a variável habilitando o jogador à pilotar motos
  292.         return 1;
  293.     }
  294.     if(TesteEtapa[playerid] == 22 && FazendoTeste[playerid] == 1)
  295.     {
  296.         if(lataria < 1000)
  297.         {
  298.             DisablePlayerRaceCheckpoint(playerid);
  299.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  300.             KillTimer(Verificar[playerid]);
  301.             ShowPlayerDialog(playerid, DRepetirAero1, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você danificou sua aeronave, deseja repetir o teste?", "Sim", "Não");
  302.             return 1;
  303.         }
  304.         else if(lataria == 1000)
  305.         {
  306.             DisablePlayerRaceCheckpoint(playerid);
  307.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  308.             ShowPlayerDialog(playerid, DRepetirAero2, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você passou na primeira etapa do teste de aeronaves, deseja passar para próxima etapa?", "Sim", "Não");
  309.             TesteEtapa[playerid] = 0;
  310.             KillTimer(Verificar[playerid]);
  311.             return 1;
  312.         }
  313.         return 1;
  314.     }
  315.     if(TesteEtapa[playerid] == 23 && FazendoTeste[playerid] == 1)
  316.     {
  317.         if(lataria < 1000)
  318.         {
  319.             DisablePlayerRaceCheckpoint(playerid);
  320.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  321.             KillTimer(Verificar[playerid]);
  322.             ShowPlayerDialog(playerid, DRepetirAero2, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você danificou sua aeronave, deseja repetir o teste?", "Sim", "Não");
  323.             return 1;
  324.         }
  325.         else if(lataria == 1000)
  326.         {
  327.             DisablePlayerRaceCheckpoint(playerid);
  328.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  329.             SetPlayerInterior(playerid, 3);
  330.             SetPlayerPos(playerid, 1497.034423, 1308.573730, 1093.294799);
  331.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Você conseguiu", "Você terminou o teste para obter a hábilitação para pilotar aeronaves, e agora já pode pilotar.", "Ok", "");
  332.             TesteEtapa[playerid] = 0;
  333.             KillTimer(Verificar[playerid]);
  334.             //Aqui a variável habilitando o jogador à pilotar aeronaves
  335.             return 1;
  336.         }
  337.         return 1;
  338.     }
  339.     return 1;
  340. }
  341.  
  342. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  343. {
  344.     if(newkeys == KEY_SECONDARY_ATTACK)
  345.     {
  346.         if(IsPlayerInRangeOfPoint(playerid, 3.0, 1081.219726, -1696.847534, 13.546875)) //Caso esteja nesta coordenada, executará o que está abaixo
  347.         {
  348.             SetPlayerPos(playerid, 1494.325195,1304.942871,1093.289062);        //Teleporta para dentro da Auto Escola
  349.             SetPlayerInterior(playerid, 3);                                     //Setará o interior para [3]
  350.             return 1;
  351.         }
  352.         if(IsPlayerInRangeOfPoint(playerid, 3.0, 1494.325195,1304.942871,1093.289062)) //Caso esteja nesta coordenada, executará o que está abaixo
  353.         {
  354.             SetPlayerPos(playerid, 1081.219726, -1696.847534, 13.546875);       //Teleporta para fora da Auto Escola
  355.             SetPlayerInterior(playerid, 0);                                     //Setará o interior para [0]
  356.             return 1;
  357.         }
  358.         if(IsPlayerInRangeOfPoint(playerid, 3.0, 1490.509765, 1305.782958, 1093.296386)) //Caso esteja nesta coordenada, executará o que está abaixo
  359.         {
  360.             ShowPlayerDialog(playerid, DMenuAutoEscola, DIALOG_STYLE_LIST, "{FFFFFF}Escolha o teste", "{FFFFFF}Carros {1E90FF}$5.000\n{FFFFFF}Motos {1E90FF}$3.000\n{FFFFFF}Aeronaves {1E90FF}$4.000", "Comprar", "Cancelar"); //Mostrará o menu
  361.             return 1;
  362.         }
  363.         return 1;
  364.     }
  365.     return 1;
  366. }
  367.  
  368. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  369. {
  370. switch(dialogid)
  371. {
  372.     case DMenuAutoEscola:
  373.     {
  374.         if(response)
  375.         {
  376.             switch(listitem)
  377.             {
  378.                 case 0:
  379.                 {
  380.                     ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Dirija de LS até o porto de San Fierro sem danos e em menos de 3:40 minutos", "OK", "");
  381.                     VAutoEscolaTeste[playerid] = CreateVehicle(402, 1089.949218, -1757.977783, 13.212669, 89.3455565, 1, 1, 5000);
  382.                     PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  383.                     SetPlayerInterior(playerid, 0);
  384.                     TesteEtapa[playerid] = 1;
  385.                     FazendoTeste[playerid] = 1;
  386.                     GivePlayerMoney(playerid, -5000);
  387.                     Verificar[playerid] = SetTimerEx("VerificarConclusao", 220000, false, "playerid", playerid);
  388.                     SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[0][0], TesteCoords[0][1], TesteCoords[0][2], TesteCoords[0][0], TesteCoords[0][1], TesteCoords[0][2], 5.0);
  389.                     return 1;
  390.                 }
  391.                 case 1:
  392.                 {
  393.                     ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Siga reto e suba na laje atravez do meio fiu. Após isso vá para a casa do lado esquerdo com a moto.", "OK", "");
  394.                     VAutoEscolaTeste[playerid] = CreateVehicle(522, 305.917968, -1868.175415, 2.393410, 0.3362, 0, 158, 5000);
  395.                     PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  396.                     SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[13][0], TesteCoords[13][1], TesteCoords[13][2], TesteCoords[14][0], TesteCoords[14][1], TesteCoords[14][2], 5.0);
  397.                     TesteEtapa[playerid] = 13;
  398.                     GivePlayerMoney(playerid, -3000);
  399.                     FazendoTeste[playerid] = 1;
  400.                     SetPlayerInterior(playerid, 0);
  401.                     return 1;
  402.                 }
  403.                 case 2:
  404.                 {
  405.                     ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Decole o avião, leve-o até o hangar localizado no aeroporto abandonado de Las Venturas, estacione-o.", "OK", "");
  406.                     VAutoEscolaTeste[playerid] = CreateVehicle(511, -1646.996459, -154.085769, 15.522509, 315.0830, 0, 158, 5000);
  407.                     PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  408.                     SetPlayerRaceCheckpoint(playerid, 1, 405.687927, 2451.601562, 17.873716, 405.687927, 2451.601562, 17.873716, 5.0);
  409.                     TesteEtapa[playerid] = 22;
  410.                     GivePlayerMoney(playerid, -4000);
  411.                     FazendoTeste[playerid] = 1;
  412.                     SetPlayerInterior(playerid, 0);
  413.                     return 1;
  414.                 }
  415.             }
  416.             return 1;
  417.         }
  418.         return 1;
  419.     }
  420.     case DRepetirCarros1:
  421.     {
  422.         if(response)
  423.         {
  424.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Dirija de LS até o porto de San Fierro sem danos e em menos de 3:40 minutos", "OK", "");
  425.             VAutoEscolaTeste[playerid] = CreateVehicle(402, 1089.949218, -1757.977783, 13.212669, 89.3455565, 1, 1, 5000);
  426.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  427.             SetPlayerInterior(playerid, 0);
  428.             TesteEtapa[playerid] = 1;
  429.             FazendoTeste[playerid] = 1;
  430.             Verificar[playerid] = SetTimerEx("VerificarConclusao", 220000, false, "playerid", playerid);
  431.             SetPlayerRaceCheckpoint(playerid, 1, TesteCoords[0][0], TesteCoords[0][1], TesteCoords[0][2], TesteCoords[0][0], TesteCoords[0][1], TesteCoords[0][2], 5.0);
  432.             return 1;
  433.         }
  434.         return 1;
  435.     }
  436.     case DRepetirCarros2:
  437.     {
  438.         if(response)
  439.         {
  440.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Siga a trilha de checkpoints até o final do circuito, sem danos e em menos de 3:00 minutos", "OK", "");
  441.             VAutoEscolaTeste[playerid] = CreateVehicle(424, -1970.295898, -2434.038574, 30.194002, 273.215728, 0, 1, 5000);
  442.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  443.             SetPlayerInterior(playerid, 0);
  444.             TesteEtapa[playerid] = 2;
  445.             FazendoTeste[playerid] = 1;
  446.             Verificar[playerid] = SetTimerEx("VerificarConclusao", 180000, false, "playerid", playerid);
  447.             SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[1][0], TesteCoords[1][1], TesteCoords[1][2], TesteCoords[2][0], TesteCoords[2][1], TesteCoords[2][2], 5.0);
  448.             return 1;
  449.         }
  450.         return 1;
  451.     }
  452.     case DRepetirCarros3:
  453.     {
  454.         if(response)
  455.         {
  456.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Desca pelo estacionamento até o Checkpoint no térreo e suba até o ponto de partida, sem danos e em 1:15 minutos", "OK", "");
  457.             VAutoEscolaTeste[playerid] = CreateVehicle(562, 2236.203613, 1974.228759, 31.350551, 273.215728, 158, 1, 5000);
  458.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  459.             SetPlayerInterior(playerid, 0);
  460.             TesteEtapa[playerid] = 11;
  461.             FazendoTeste[playerid] = 1;
  462.             Verificar[playerid] = SetTimerEx("VerificarConclusao", 75000, false, "playerid", playerid);
  463.             SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[12][0], TesteCoords[12][1], TesteCoords[12][2], TesteCoords[11][0], TesteCoords[11][1], TesteCoords[11][2], 5.0);
  464.             return 1;
  465.         }
  466.         return 1;
  467.     }
  468.     case DRepetirMoto1:
  469.     {
  470.         if(response)
  471.         {
  472.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Siga reto e suba na laje atravez do meio fiu. Após isso vá para a casa do lado esquerdo com a moto.", "OK", "");
  473.             VAutoEscolaTeste[playerid] = CreateVehicle(522, 305.917968, -1868.175415, 2.393410, 0.3362, 0, 158, 5000);
  474.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  475.             SetPlayerRaceCheckpoint(playerid, 0, TesteCoords[13][0], TesteCoords[13][1], TesteCoords[13][2], TesteCoords[14][0], TesteCoords[14][1], TesteCoords[14][2], 5.0);
  476.             TesteEtapa[playerid] = 13;
  477.             FazendoTeste[playerid] = 1;
  478.             return 1;
  479.         }
  480.         return 1;
  481.     }
  482.     case DRepetirMoto2:
  483.     {
  484.         if(response)
  485.         {
  486.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Siga a trilha de checkpoints até o alto do morro, por fim, pule o muro e pare na laje abaixo.", "OK", "");
  487.             VAutoEscolaTeste[playerid] = CreateVehicle(522, 2838.280517, -1046.117309, 22.838201, 89.345565, 0, 158, 5000);
  488.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  489.             SetPlayerRaceCheckpoint(playerid, 0, 2838.280517, -1046.117309, 22.838201, TesteCoords[15][0], TesteCoords[15][1], TesteCoords[15][2], 5.0);
  490.             TesteEtapa[playerid] = 15;
  491.             FazendoTeste[playerid] = 1;
  492.             return 1;
  493.         }
  494.         return 1;
  495.     }
  496.     case DRepetirMoto3:
  497.     {
  498.         if(response)
  499.         {
  500.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Chegue até o checkpoint em menos de 1:50 minutos, pegue o caminho que desejar.", "OK", "");
  501.             VAutoEscolaTeste[playerid] = CreateVehicle(468, 2418.786132, 91.505310, 26.047235, 89.345565, 158, 158, 5000);
  502.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  503.             Verificar[playerid] = SetTimerEx("VerificarConclusao", 150000, false, "playerid", playerid);
  504.             SetPlayerRaceCheckpoint(playerid, 1, -577.292663, -189.324462, 78.249137, TesteCoords[20][0], TesteCoords[20][1], TesteCoords[20][2], 5.0);
  505.             TesteEtapa[playerid] = 21;
  506.             FazendoTeste[playerid] = 1;
  507.             return 1;
  508.         }
  509.         return 1;
  510.     }
  511.     case DRepetirAero1:
  512.     {
  513.         if(response)
  514.         {
  515.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Decole o avião, leve-o até o hangar localizado no aeroporto abandonado de Las Venturas, estacione-o.", "OK", "");
  516.             VAutoEscolaTeste[playerid] = CreateVehicle(511, -1646.996459, -154.085769, 15.522509, 315.0830, 0, 158, 5000);
  517.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  518.             SetPlayerRaceCheckpoint(playerid, 1, 405.687927, 2451.601562, 17.873716, 405.687927, 2451.601562, 17.873716, 5.0);
  519.             TesteEtapa[playerid] = 22;
  520.             FazendoTeste[playerid] = 1;
  521.             SetPlayerInterior(playerid, 0);
  522.             return 1;
  523.         }
  524.         return 1;
  525.     }
  526.     case DRepetirAero2:
  527.     {
  528.         if(response)
  529.         {
  530.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Decole o avião, leve-o até o hangar localizado no aeroporto abandonado de Las Venturas, estacione-o.", "OK", "");
  531.             VAutoEscolaTeste[playerid] = CreateVehicle(563, 1766.504882, -2286.285644, 27.501468, 268.859832, 0, 158, 5000);
  532.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  533.             SetPlayerRaceCheckpoint(playerid, 1, 2093.283447, 2414.863037, 75.284034, 2093.283447, 2414.863037, 75.284034, 5.0);
  534.             TesteEtapa[playerid] = 23;
  535.             FazendoTeste[playerid] = 1;
  536.             return 1;
  537.         }
  538.         return 1;
  539.     }
  540. }
  541. return 1;
  542. }
  543.  
  544. public VerificarConclusao(playerid) //É chamada no fim do prazo, se o player chegar à tempo esse timer é destruído, então não será chamado
  545. {
  546.     //Abaixo todas as etapas que tem um tempo limite para a chegada
  547.     if(TesteEtapa[playerid] == 1)
  548.     {
  549.         if(FazendoTeste[playerid] == 1)
  550.         {
  551.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  552.             FazendoTeste[playerid] = 0;
  553.             TesteEtapa[playerid] = 0;
  554.             ShowPlayerDialog(playerid, DRepetirCarros1, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você não chegou à tempo, deseja repetir o teste?", "Sim", "Não");
  555.             return 1;
  556.         }
  557.         return 1;
  558.     }
  559.     if(TesteEtapa[playerid] >= 2 && TesteEtapa[playerid] <= 10)
  560.     {
  561.         if(FazendoTeste[playerid] == 1)
  562.         {
  563.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  564.             FazendoTeste[playerid] = 0;
  565.             TesteEtapa[playerid] = 0;
  566.             ShowPlayerDialog(playerid, DRepetirCarros2, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você não chegou à tempo, deseja repetir o teste?", "Sim", "Não");
  567.             return 1;
  568.         }
  569.         return 1;
  570.     }
  571.     if(TesteEtapa[playerid] >= 11 && TesteEtapa[playerid] <= 12)
  572.     {
  573.         if(FazendoTeste[playerid] == 1)
  574.         {
  575.             DestroyVehicle(VAutoEscolaTeste[playerid]);
  576.             FazendoTeste[playerid] = 0;
  577.             TesteEtapa[playerid] = 0;
  578.             ShowPlayerDialog(playerid, DRepetirCarros3, DIALOG_STYLE_MSGBOX, "Você não conseguiu", "Você não chegou à tempo, deseja repetir o teste?", "Sim", "Não");
  579.             return 1;
  580.         }
  581.         return 1;
  582.     }
  583.     if(TesteEtapa[playerid] == 21)
  584.     {
  585.         if(FazendoTeste[playerid] == 1)
  586.         {
  587.             ShowPlayerDialog(playerid, DInstrucaoAutoEscola, DIALOG_STYLE_MSGBOX, "Como concluír seu teste", "Chegue até o checkpoint em menos de 1:50 minutos, pegue o caminho que desejar.", "OK", "");
  588.             VAutoEscolaTeste[playerid] = CreateVehicle(468, 2418.786132, 91.505310, 26.047235, 89.345565, 158, 158, 5000);
  589.             PutPlayerInVehicle(playerid, VAutoEscolaTeste[playerid], 0);
  590.             Verificar[playerid] = SetTimerEx("VerificarConclusao", 15000, false, "playerid", playerid);
  591.             SetPlayerRaceCheckpoint(playerid, 1, 2838.280517, -1046.117309, 22.838201, TesteCoords[20][0], TesteCoords[20][1], TesteCoords[20][2], 5.0);
  592.             TesteEtapa[playerid] = 21;
  593.             FazendoTeste[playerid] = 1;
  594.             return 1;
  595.         }
  596.         return 1;
  597.     }
  598.     return 1;
  599. }
Add Comment
Please, Sign In to add comment