Burunu

Sistema - Auto-Escola (Basic)

Dec 11th, 2020 (edited)
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.84 KB | None | 0 0
  1. //============================Burunu=========================================//
  2. //Sistema desenvolvido por Burunu//
  3. //Ap: Diversificados Pawn//
  4. //===========================Burunu=========================================//
  5.  
  6. #include <a_samp>
  7. #include <cpstream>
  8.  
  9. #define Dialog_AutoEscola 5
  10.  
  11. new CPAutoEscola;
  12. new point[MAX_PLAYERS];
  13. new Float:TerrestrePoints[8][3] = //Cordenadas dos Checkpoints
  14. {
  15.      {1518.3596,-1459.9932,9.5000},
  16.      {1606.9006,-1427.1610,13.4378},
  17.      {1641.3010,-1304.1602,15.7496},
  18.      {1641.3010,-1304.1602,15.7496},
  19.      {1852.5596,-1226.3092,17.5544},
  20.      {1772.5421,-1166.5100,23.6560},
  21.      {1671.8254,-1159.1508,23.6563},
  22.      {1599.1776,-1009.4454,23.9063}
  23. };
  24.  
  25. public OnPlayerEnterCheckpoint(playerid){
  26.  
  27.     if(CPS_IsPlayerInCheckpoint(playerid,CPAutoEscola)){//Chekpoint da Auto-Escola (onde ira pegar a carteira)
  28.        
  29.          ShowPlayerDialog ( playerid, Dialog_AutoEscola, DIALOG_STYLE_TABLIST_HEADERS, "Habilitação","Categoria:\t Valor:\nTerrestre\t R$6000", "Ok" , "Cancelar" ) ;
  30.          return 1;
  31.     }
  32.     return 1;
  33. }
  34.  
  35.  
  36. public OnPlayerEnterRaceCheckpoint(playerid){
  37. //chekpoints onde ira começar os testes. //
  38.     switch(point[playerid])
  39.      {
  40.          case 1:
  41.          {
  42.               DisablePlayerRaceCheckpoint(playerid);
  43.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[1][0], TerrestrePoints[1][1], TerrestrePoints[1][2],TerrestrePoints[2][0], TerrestrePoints[2][1], TerrestrePoints[2][2], 10);
  44.               point[playerid] = 2;
  45.               return 1;
  46.          }
  47.          case 2:
  48.          {
  49.               DisablePlayerRaceCheckpoint(playerid);
  50.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[2][0], TerrestrePoints[2][1], TerrestrePoints[2][2],TerrestrePoints[3][0], TerrestrePoints[3][1], TerrestrePoints[3][2], 10);
  51.               point[playerid] = 3;
  52.               return 1;
  53.          }
  54.          case 3:
  55.          {
  56.               DisablePlayerRaceCheckpoint(playerid);
  57.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[3][0], TerrestrePoints[3][1], TerrestrePoints[3][2],TerrestrePoints[4][0], TerrestrePoints[4][1], TerrestrePoints[4][2], 10);
  58.               point[playerid] = 4;
  59.               return 1;
  60.          }
  61.          case 4:
  62.          {
  63.               DisablePlayerRaceCheckpoint(playerid);
  64.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[4][0], TerrestrePoints[4][1], TerrestrePoints[4][2],TerrestrePoints[5][0], TerrestrePoints[5][1], TerrestrePoints[5][2], 10);
  65.               point[playerid] = 5;
  66.               return 1;
  67.          }
  68.          case 5:
  69.          {
  70.               DisablePlayerRaceCheckpoint(playerid);
  71.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[5][0], TerrestrePoints[5][1], TerrestrePoints[5][2],TerrestrePoints[6][0], TerrestrePoints[6][1], TerrestrePoints[6][2], 10);
  72.               point[playerid] = 6;
  73.               return 1;
  74.          }
  75.          case 6:
  76.          {
  77.               DisablePlayerRaceCheckpoint(playerid);
  78.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[6][0], TerrestrePoints[6][1], TerrestrePoints[6][2],TerrestrePoints[7][0], TerrestrePoints[7][1], TerrestrePoints[7][2], 10);
  79.               point[playerid] = 7;
  80.               return 1;
  81.          }
  82.          case 7:
  83.          {
  84.               DisablePlayerRaceCheckpoint(playerid);
  85.               SetPlayerRaceCheckpoint(playerid, 2, TerrestrePoints[7][0], TerrestrePoints[7][1], TerrestrePoints[7][2],TerrestrePoints[7][0], TerrestrePoints[7][1], TerrestrePoints[7][2], 10);
  86.               point[playerid] = 8;
  87.               return 1;
  88.          }
  89.          
  90.          case 8:{
  91.             if(IsPlayerInVehicle(playerid, carroauto[playerid])){
  92.              
  93.               new Float:lataria;
  94.               GetVehicleHealth(carroauto[playerid], lataria);
  95.               if(lataria <= 800)
  96.               {
  97.                 DisablePlayerRaceCheckpoint(playerid);
  98.                 new currentveh;
  99.                 currentveh = GetPlayerVehicleID(playerid);
  100.                 DestroyVehicle(currentveh);
  101.                 SendClientMessage(playerid,VERMELHO,"|AUTO-ESCOLA| Reprovado! Lataria do Veiculo Muito Danificada!");
  102.                 return 1;
  103.               }
  104.               DisablePlayerRaceCheckpoint(playerid);
  105.               GameTextForPlayer(playerid, "AUTO-ESCOLA Completa", 3000, 1);
  106.               SendClientMessage(playerid,VERDE,"|AUTO-ESCOLA| Situação: Aprovado! Dirija com Cuidado para Não perder a Carteira!");
  107.               new currentveh;
  108.               currentveh = GetPlayerVehicleID(playerid);
  109.               DestroyVehicle(currentveh);
  110.               return 1;
  111.             }
  112.             else
  113.             {
  114.                 DisablePlayerRaceCheckpoint(playerid);
  115.                 new currentveh;
  116.                 currentveh = GetPlayerVehicleID(playerid);
  117.                 DestroyVehicle(currentveh);
  118.                 SendClientMessage(playerid,VERMELHO,"|AUTO-ESCOLA| Reprovado! Você não esta em um veiculo da Auto-Escola.");
  119.                 return 1;
  120.             }
  121.          }
  122.      }
  123.  
  124.     return 1;
  125. }
  126. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  127.  
  128. if(dialogid == Dialog_AutoEscola){ //Dialog do Menu da Auto-Escola
  129.        
  130.         if(listitem == 0){ //terrestre
  131.  
  132.             carroauto[playerid] = CreateVehicle(589, 1518.3596,-1459.9932,9.5000,181.0488, 0, 0, 0);
  133.             PutPlayerInVehicle(playerid, carroauto[playerid], 0);
  134.             SendClientMessage(playerid,-1,"|AUTO-ESCOLA| Você iniciou o Teste para Habilitação Terrestre! Siga os Chekpoints e Cuide para não Bater!");
  135.             SetPlayerRaceCheckpoint(playerid, 0, TerrestrePoints[0][0], TerrestrePoints[0][1], TerrestrePoints[0][2],TerrestrePoints[1][0], TerrestrePoints[1][1], TerrestrePoints[1][2], 10);
  136.             point[playerid] = 1;
  137.             GivePlayerMoney(playerid, -6000);
  138.             return 1;
  139.         }
  140.  
  141.  
  142.     }
  143.     return 1;
  144. }
Add Comment
Please, Sign In to add comment