Advertisement
Chip7

[FS] Filterscript Sistema de Auto Escola

Oct 19th, 2013
1,411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.32 KB | None | 0 0
  1. /*
  2.   VISITE NOSSO SITE: http://www.sampknd.com/
  3.   VISITE NOSSO FACEBOOK: http://www.facebook.com/SampKnd
  4.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  5. */
  6.  
  7. #include <a_samp>
  8. #include <cpstream>
  9.  
  10. #define FILTERSCRIPT
  11. #if defined FILTERSCRIPT
  12.  
  13. enum pInfo{
  14.     Carteira
  15. };
  16. new pDados[MAX_PLAYERS][pInfo];
  17.  
  18. #define DIALOG_AUTOESCOLA       2
  19.  
  20. new InAutoEscola[MAX_PLAYERS];
  21. new carroauto[MAX_PLAYERS];
  22. new CPAutoEscola;
  23.  
  24. new point[MAX_PLAYERS];
  25. new Float:AutoPoints[8][3] =
  26. {
  27.      {566.0122,-1240.4834,16.9812},
  28.      {647.4115,-1202.2354,17.8508},
  29.      {794.5209,-1061.8385,24.4309},
  30.      {797.8555,-1255.2906,13.2295},
  31.      {782.1776,-1318.7532,13.1247},
  32.      {632.7460,-1290.5117,15.1381},
  33.      {595.6362,-1228.1689,17.5915},
  34.      {561.3011,-1279.6729,16.9883}
  35. };
  36.  
  37. public OnFilterScriptInit()
  38. {
  39.     CPAutoEscola = CPS_AddCheckpoint(545.2621,-1284.9412,17.2482,2.0,80);
  40.     return 1;
  41. }
  42.  
  43. public OnFilterScriptExit()
  44. {
  45.     return 1;
  46. }
  47.  
  48.  
  49. main()
  50. {
  51.     print("\n----------------------------------");
  52.     print(" Sistema de Auto Escola");
  53.     print(" Visite: www.sampknd.com");
  54.     print("----------------------------------\n");
  55. }
  56.  
  57. public OnPlayerDeath(playerid, killerid, reason)
  58. {
  59.     if(InAutoEscola[playerid] == 1)
  60.     {
  61.         new currentveh;
  62.         currentveh = GetPlayerVehicleID(playerid);
  63.         DestroyVehicle(currentveh);
  64.         InAutoEscola[playerid] = 0;
  65.         DisablePlayerRaceCheckpoint(playerid);
  66.     }
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerEnterCheckpoint(playerid)
  71. {
  72.     if(CPS_IsPlayerInCheckpoint(playerid,CPAutoEscola))
  73.     {
  74.         if(pDados[playerid][Carteira] == 0)
  75.         {
  76.             ShowPlayerDialog(playerid,DIALOG_AUTOESCOLA,DIALOG_STYLE_MSGBOX,"AUTO ESCOLA","Voce gostaria de começar os teste da Auto Escola?","Sim","Nao");
  77.             return 1;
  78.         }else return SendClientMessage(playerid,-1,"(AUTO ESCOLA) Voce ja possui Carteira.");
  79.     }
  80.     return 1;
  81. }
  82.  
  83. public OnPlayerEnterRaceCheckpoint(playerid)
  84. {
  85.     switch(point[playerid])
  86.      {
  87.          case 1:
  88.          {
  89.               DisablePlayerRaceCheckpoint(playerid);
  90.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[1][0], AutoPoints[1][1], AutoPoints[1][2],AutoPoints[2][0], AutoPoints[2][1], AutoPoints[2][2], 10);
  91.               point[playerid] = 2;
  92.               return 1;
  93.          }
  94.          case 2:
  95.          {
  96.               DisablePlayerRaceCheckpoint(playerid);
  97.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[2][0], AutoPoints[2][1], AutoPoints[2][2],AutoPoints[3][0], AutoPoints[3][1], AutoPoints[3][2], 10);
  98.               point[playerid] = 3;
  99.               return 1;
  100.          }
  101.          case 3:
  102.          {
  103.               DisablePlayerRaceCheckpoint(playerid);
  104.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[3][0], AutoPoints[3][1], AutoPoints[3][2],AutoPoints[4][0], AutoPoints[4][1], AutoPoints[4][2], 10);
  105.               point[playerid] = 4;
  106.               return 1;
  107.          }
  108.          case 4:
  109.          {
  110.               DisablePlayerRaceCheckpoint(playerid);
  111.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[4][0], AutoPoints[4][1], AutoPoints[4][2],AutoPoints[5][0], AutoPoints[5][1], AutoPoints[5][2], 10);
  112.               point[playerid] = 5;
  113.               return 1;
  114.          }
  115.          case 5:
  116.          {
  117.               DisablePlayerRaceCheckpoint(playerid);
  118.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[5][0], AutoPoints[5][1], AutoPoints[5][2],AutoPoints[6][0], AutoPoints[6][1], AutoPoints[6][2], 10);
  119.               point[playerid] = 6;
  120.               return 1;
  121.          }
  122.          case 6:
  123.          {
  124.               DisablePlayerRaceCheckpoint(playerid);
  125.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[6][0], AutoPoints[6][1], AutoPoints[6][2],AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2], 10);
  126.               point[playerid] = 7;
  127.               return 1;
  128.          }
  129.          case 7:
  130.          {
  131.               DisablePlayerRaceCheckpoint(playerid);
  132.               SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2],AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2], 10);
  133.               point[playerid] = 8;
  134.               return 1;
  135.          }
  136.          case 8:
  137.          {
  138.             if(IsPlayerInVehicle(playerid, carroauto[playerid]))
  139.             {
  140.               new Float:lataria;
  141.               GetVehicleHealth(carroauto[playerid], lataria);
  142.               if(lataria < 87)
  143.               {
  144.                 DisablePlayerRaceCheckpoint(playerid);
  145.                 new currentveh;
  146.                 currentveh = GetPlayerVehicleID(playerid);
  147.                 DestroyVehicle(currentveh);
  148.                 SendClientMessage(playerid,-1,"(AUTO ESCOLA) Reprovado!! Voce danificou muito a lataria do veiculo.");
  149.                 return 1;
  150.               }
  151.               DisablePlayerRaceCheckpoint(playerid);
  152.               GameTextForPlayer(playerid, "AUTO ESCOLA COMPLETA", 3000, 1);
  153.               pDados[playerid][Carteira] = 1;
  154.               InAutoEscola[playerid] = 0;
  155.               new currentveh;
  156.               currentveh = GetPlayerVehicleID(playerid);
  157.               DestroyVehicle(currentveh);
  158.               return 1;
  159.             }
  160.             else
  161.             {
  162.                 DisablePlayerRaceCheckpoint(playerid);
  163.                 new currentveh;
  164.                 currentveh = GetPlayerVehicleID(playerid);
  165.                 DestroyVehicle(currentveh);
  166.                 SendClientMessage(playerid,-1,"(AUTO ESCOLA) Reprovado!! Voce nao estao em um veiculo da Auto Escola.");
  167.                 return 1;
  168.             }
  169.          }
  170.      }
  171.     return 1;
  172. }
  173.  
  174. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  175. {
  176.     if(dialogid == DIALOG_AUTOESCOLA)
  177.     {
  178.         if(response == 1)
  179.         {
  180.             InAutoEscola[playerid] = 1;
  181.             new Float:X,Float:Y,Float:Z;
  182.             GetPlayerPos(playerid,X,Y,Z);
  183.             carroauto[playerid] = CreateVehicle(466, X,Y,Z,297.6633, 0, 0, -1);
  184.             PutPlayerInVehicle(playerid, carroauto[playerid], 0);
  185.             SendClientMessage(playerid,-1,"(AUTO ESCOLA) Voce iniciou a auto escola,siga as setas.");
  186.             SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[0][0], AutoPoints[0][1], AutoPoints[0][2],AutoPoints[1][0], AutoPoints[1][1], AutoPoints[1][2], 10);
  187.             point[playerid] = 1;
  188.             GivePlayerMoney(playerid, -200);
  189.             return 1;
  190.         }
  191.         if(response == 0)
  192.         {
  193.             SendClientMessage(playerid,-1,"(AUTO ESCOLA) Voce desistiu da auto escola.");
  194.             GivePlayerMoney(playerid, -200);
  195.             return 1;
  196.         }
  197.     }
  198.     return 1;
  199. }
  200.  
  201. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement