SHARE
TWEET

Lava Jato - HomeHots

a guest Jul 28th, 2014 231 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.         CAR WASH FILTERSCRIPT by ANGELENO
  3.                 Copyright -- 2011
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. new Text3D:entrancetext;
  9. new entrancegate, exitgate;
  10. new water1, water2, water3, water4, water5, water6, water7;
  11. new usingcarwash = -1;
  12. new unwashable[89][0] = {
  13. {403},{406},{408},{414},{417},
  14. {423},{424},{425},{430},{431},
  15. {432},{433},{435},{437},{441},
  16. {443},{444},{446},{447},{448},
  17. {452},{453},{454},{455},{456},
  18. {457},{460},{461},{462},{463},
  19. {464},{465},{468},{469},{471},
  20. {472},{473},{476},{481},{484},
  21. {485},{486},{487},{488},{493},
  22. {497},{498},{501},{508},{509},
  23. {510},{511},{512},{513},{514},
  24. {515},{519},{520},{521},{522},
  25. {523},{524},{530},{531},{532},
  26. {539},{544},{548},{553},{556},
  27. {557},{563},{564},{568},{571},
  28. {572},{573},{574},{577},{578},
  29. {581},{583},{586},{588},{592},
  30. {593},{594},{595},{609}
  31. };
  32.  
  33. forward Autocruise(playerid, in);
  34. forward OpenExit(playerid);
  35. forward EndWash(playerid);
  36. forward Water(playerid, on);
  37.  
  38. public OnFilterScriptInit()
  39. {
  40.     print("\n-----------------------------------------------");
  41.     print(" ");
  42.     print("---=== Car Wash Filterscript by Angeleno ===---");
  43.     print(" ");
  44.     print("-------------- Copyright -- 2011 --------------\n");
  45.     entrancegate = CreateObject(17951,1911.21130371,-1780.68151855,14.15972233,0.00000000,0.00000000,90.00000000);
  46.     exitgate = CreateObject(17951,1911.21130371,-1771.97814941,14.15972233,0.00000000,0.00000000,90.00000000);
  47.     CreateObject(1250,1908.84997559,-1783.68945312,13.40625000,0.00000000,0.00000000,90.00000000);
  48.     CreatePickup(1239, 1, 1911.1886,-1784.2952,13.5, -1);
  49.     entrancetext = Create3DTextLabel("Ninguém está usando o Lava Jato no momento.\nPreço: R$5 (/lavajato)",0x008B00FF,1911.1886,-1784.2952,14.5,50,0,1);
  50.     return 1;
  51. }
  52.  
  53. public OnFilterScriptExit()
  54. {
  55.     DestroyObject(entrancegate);
  56.     DestroyObject(exitgate);
  57.     DestroyObject(3);
  58.     DestroyPickup(1);
  59.     Delete3DTextLabel(entrancetext);
  60.     for(new i = 0; i < MAX_PLAYERS; i++)
  61.     {
  62.         if(GetPlayerVehicleID(i) == GetPlayerVehicleID(usingcarwash))
  63.         {
  64.             DestroyPlayerObject(i, water1);
  65.             DestroyPlayerObject(i, water2);
  66.             DestroyPlayerObject(i, water3);
  67.             DestroyPlayerObject(i, water4);
  68.             DestroyPlayerObject(i, water5);
  69.             DestroyPlayerObject(i, water6);
  70.             DestroyPlayerObject(i, water7);
  71.             TogglePlayerControllable(i, 1);
  72.             SetCameraBehindPlayer(i);
  73.         }
  74.     }
  75.     return 1;
  76. }
  77.  
  78. public OnPlayerDisconnect(playerid, reason)
  79. {
  80.     if(usingcarwash == playerid)
  81.     {
  82.         SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  83.         usingcarwash = -1;
  84.         Update3DTextLabelText(entrancetext, 0x008B00FF, "Ninguém está usando o Lava Jato no momento.\nPreço: R$5 (/lavajato)");
  85.     }
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerDeath(playerid, killerid, reason)
  90. {
  91.     if(usingcarwash == playerid)
  92.     {
  93.         SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  94.         usingcarwash = -1;
  95.         Update3DTextLabelText(entrancetext, 0x008B00FF, "Ninguém está usando o Lava Jato no momento.\nPreço: R$5 (/lavajato)");
  96.     }
  97.     return 1;
  98. }
  99.  
  100. public OnPlayerCommandText(playerid, cmdtext[])
  101. {
  102.     if (strcmp("/lavajato", cmdtext, true) == 0)
  103.     {
  104.         if(IsPlayerInRangeOfPoint(playerid, 5, 1911.1886,-1784.2952,13.0801))
  105.         {
  106.             if(IsPlayerInAnyVehicle(playerid))
  107.             {
  108.                 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  109.                 {
  110.                     for(new x = 0; x < sizeof(unwashable); x++)
  111.                     {
  112.                         if(GetVehicleModel(GetPlayerVehicleID(playerid)) == unwashable[x][0])
  113.                         {
  114.                             SendClientMessage(playerid, 0xAA3333AA, "Esse veículo não pode ser lavado.");
  115.                             return 1;
  116.                         }
  117.                     }
  118.                     if(GetPlayerMoney(playerid) > 4)
  119.                     {
  120.                         if(usingcarwash == -1)
  121.                         {
  122.                             GivePlayerMoney(playerid, -5);
  123.                             usingcarwash = playerid;
  124.                             Update3DTextLabelText(entrancetext, 0xB0171FFF, "Alguém está usando o Lava Jato no momento.");
  125.                             for(new i = 0; i < MAX_PLAYERS; i++)
  126.                             {
  127.                                 if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  128.                                 {
  129.                                     TogglePlayerControllable(i, 0);
  130.                                     SetPlayerCameraPos(i,1907.8804,-1790.0590,15);
  131.                                     SetPlayerCameraLookAt(i,1911.0471,-1781.6868,13.3828);
  132.                                 }
  133.                                 if(GetPlayerSurfingVehicleID(i) == GetPlayerVehicleID(playerid))
  134.                                 {
  135.                                     SetPlayerPos(i,1906.9204,-1786.0435,13.5469);
  136.                                     SetPlayerFacingAngle(i, 270);
  137.                                 }
  138.                             }
  139.                             SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, -1784.2952, 13.0801);
  140.                             SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  141.                             MoveObject(entrancegate, 1911.21130371, -1780.68151855, 10.50000000, 1);
  142.                             SetTimerEx("Autocruise",3500,0,"ii",playerid, 1);
  143.                         }
  144.                         else
  145.                         {
  146.                             SendClientMessage(playerid, 0xAA3333AA, "Alguém está usando o Lava Jato no momento.");
  147.                         }
  148.                     }
  149.                     else
  150.                     {
  151.                         SendClientMessage(playerid, 0xAA3333AA, "Você não tem dinheiro sufiente.");
  152.                     }
  153.                 }
  154.                 else
  155.                 {
  156.                     SendClientMessage(playerid, 0xAA3333AA, "Você não é o motorista desse veículo.");
  157.                 }
  158.             }
  159.             else
  160.             {
  161.                 SendClientMessage(playerid, 0xAA3333AA, "Você não está em um veículo.");
  162.             }
  163.         }
  164.         else
  165.         {
  166.             SendClientMessage(playerid, 0xAA3333AA, "Você não está na entrada do Lava Jato.");
  167.         }
  168.         return 1;
  169.     }
  170.     return 0;
  171. }
  172.  
  173. public Autocruise(playerid, in)
  174. {
  175.     new Float:vehx, Float:vehy, Float:vehz;
  176.     GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz);
  177.     if(in == 1)
  178.     {
  179.         if(-1777 < vehy)
  180.         {
  181.             for(new i = 0; i < MAX_PLAYERS; i++)
  182.             {
  183.                 if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  184.                 {
  185.                     SetPlayerCameraPos(i,1910.4637,-1771.8,15);
  186.                     SetPlayerCameraLookAt(i,1911.2863,-1775.1614,13.3828);
  187.                 }
  188.             }
  189.             SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  190.             TogglePlayerControllable(playerid, 0);
  191.             MoveObject(entrancegate, 1911.21130371, -1780.68151855, 14.15972233, 1);
  192.             SetTimerEx("Water",4000,0,"ii",playerid, 1);
  193.         }
  194.         else
  195.         {
  196.             if(vehx != 1911.1886)
  197.             {
  198.                 SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
  199.                 SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  200.             }
  201.             TogglePlayerControllable(playerid, 1);
  202.             SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
  203.             SetTimerEx("Autocruise",100,0,"ii",playerid, 1);
  204.         }
  205.     }
  206.     else
  207.     {
  208.         if(-1768 < vehy)
  209.         {
  210.             SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  211.             TogglePlayerControllable(playerid, 0);
  212.             MoveObject(exitgate, 1911.21130371,-1771.97814941,14.15972233, 1);
  213.             SetTimerEx("EndWash",1000,0,"i",playerid);
  214.         }
  215.         else
  216.         {
  217.             if(vehx != 1911.1886)
  218.             {
  219.                 SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
  220.                 SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  221.             }
  222.             TogglePlayerControllable(playerid, 1);
  223.             SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
  224.             SetTimerEx("Autocruise",100,0,"ii",playerid, 0);
  225.         }
  226.     }
  227.     return 1;
  228. }
  229.  
  230. public Water(playerid, on)
  231. {
  232.     if(on == 0)
  233.     {
  234.         for(new i = 0; i < MAX_PLAYERS; i++)
  235.         {
  236.             if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  237.             {
  238.                 DestroyPlayerObject(i, water1);
  239.                 DestroyPlayerObject(i, water2);
  240.                 DestroyPlayerObject(i, water3);
  241.                 DestroyPlayerObject(i, water4);
  242.                 DestroyPlayerObject(i, water5);
  243.                 DestroyPlayerObject(i, water6);
  244.                 DestroyPlayerObject(i, water7);
  245.                 SetTimerEx("OpenExit",500,0,"i",playerid);
  246.             }
  247.         }
  248.     }
  249.     else
  250.     {
  251.         for(new i = 0; i < MAX_PLAYERS; i++)
  252.         {
  253.             if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  254.             {
  255.                 water1 = CreatePlayerObject(i, 18747, 1911, -1776, 10, 0, 0, 90);
  256.                 water2 = CreatePlayerObject(i, 18747, 1914, -1776, 10, 0, 0, 90);
  257.                 water3 = CreatePlayerObject(i, 18739, 1910.1821, -1777.8997, 25, 0, 180, 0);
  258.                 water4 = CreatePlayerObject(i, 18739, 1910.1821, -1774.8132, 25, 0, 180, 0);
  259.                 water5 = CreatePlayerObject(i, 18739, 1912.1490, -1774.8132, 25, 0, 180, 0);
  260.                 water6 = CreatePlayerObject(i, 18739, 1912.1490, -1777.8997, 25, 0, 180, 0);
  261.                 water7 = CreatePlayerObject(i, 18739, 1911.2194, -1776.5117, 25, 0, 180, 0);
  262.                 SetTimerEx("Water",15000,0,"ii",playerid, 0);
  263.             }
  264.         }
  265.     }
  266.     return 1;
  267. }
  268.  
  269. public OpenExit(playerid)
  270. {
  271.     for(new i = 0; i < MAX_PLAYERS; i++)
  272.     {
  273.         if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  274.         {
  275.             SetPlayerCameraPos(i,1909.0697,-1760.7429,15);
  276.             SetPlayerCameraLookAt(i,1911.2600,-1771.5955,13.3828);
  277.         }
  278.     }
  279.     MoveObject(exitgate, 1911.21130371, -1771.97814941, 10.50000000, 1);
  280.     SetTimerEx("Autocruise",3500,0,"ii",playerid, 0);
  281.     return 1;
  282. }
  283.  
  284. public EndWash(playerid)
  285. {
  286.     for(new i = 0; i < MAX_PLAYERS; i++)
  287.     {
  288.         if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
  289.         {
  290.             TogglePlayerControllable(i, 1);
  291.             SetCameraBehindPlayer(i);
  292.         }
  293.     }
  294.     usingcarwash = -1;
  295.     Update3DTextLabelText(entrancetext, 0x008B00FF, "Ninguém está usando o Lava Jato no momento.\nPreço: R$5 (/lavajato)");
  296.     return 1;
  297. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top