Advertisement
Guest User

MichaelWojtanisRinepimChallanges

a guest
Sep 19th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 123.62 KB | None | 0 0
  1. // DODAĆ NOWY TIMER DLA SPRAWDZANIA POJAZDÓW!!!
  2. // KAŻDY NOWY TIMER DLA DANEGO POJAZDU
  3. // ROZWIĄZAĆ JAKOŚ PROBLEM Z PUSTYM ODCZYTEM NA STARCIE GRY
  4. using System;
  5. using System.Timers;
  6. using System.Windows.Forms;
  7. using System.Drawing;
  8. using System.Text;
  9. using System.Windows;
  10. using GTA;
  11.  
  12. namespace RinepimChallenges
  13. {
  14.     public class Part_1 : Script
  15.     {
  16.         bool makeScreen = false, endChallenge = false,
  17.              challengeRun = false, it_WLACZONY=false;
  18.        bool[] zadanieCheck,zgaszony;
  19.        int timerChallenge, timerAll = 0, soundID, zdarzenieNr = 0, ptfxLodziarka, PTFX_nr1 = 0, PTFX_nr2 = 1;
  20.        byte ileLodowDel = 0, smoothEnd = 0,gasnicaPojemnosc=255;
  21.        int[] plomien;
  22.         float[] daneAuta;
  23.         float getX;
  24.         string animacja;
  25.         public string[] calyPlik;
  26.         AnimationSet grupa_anim;
  27.         GTA.Object antenaAuta,lodzikCh2,gasnica;
  28.         GTA.Object[] arrayArrow;
  29.         Vehicle goodCar,crashFlat;
  30.         Vehicle[] specialCars;
  31.         Ped[] pedsAround,startPed;
  32.         Ped goodGuy;
  33.         Checkpoint drawRedCircle;
  34.         Blip MissionBlip;
  35.         Camera cutSceneCam;
  36.         Vector3[] miejscaStartPed;
  37.         Vector3 corner1_challenge1= new Vector3(-344.71F,1212.62F,17.51F),
  38.             corner2_challenge1= new Vector3(-384.68F,-34.42F,14.29F);
  39.         GTA.Font screenFont,resultFont;
  40.         GTA.Timer timerDraw, prepareRing, challengeNr1_first, challengeNr1_second, challengeNr2,challengeNr3,
  41.             SpecialCar_CHECK, SpecialCar0, SpecialCar1, SpecialCar2;
  42.         //cutsceneNr1,
  43.  
  44.         public Part_1()
  45.         {
  46.             plomien = new int[30];
  47.             zadanieCheck = new bool[4];
  48.             zgaszony = new bool[30];
  49.  
  50.             miejscaStartPed = new Vector3[25];
  51.             miejscaStartPed[0] = new Vector3(-394.04F, 1195.20F, 13.76F);
  52.             miejscaStartPed[1] = new Vector3(-389.36F, 613.74F, 13.71F);
  53.             miejscaStartPed[2] = new Vector3(-526.6850F, 1258.5880F, 17.4778F);
  54.  
  55.             startPed = new Ped[25];
  56.  
  57.  
  58.             specialCars = new Vehicle[25];
  59.  
  60.             daneAuta = new float[3];
  61.             arrayArrow = new GTA.Object[3];
  62.  
  63.             SpecialCar_CHECK = new GTA.Timer(100, true);
  64.             SpecialCar0 = new GTA.Timer(1000, false);
  65.             SpecialCar1 = new GTA.Timer(10, false);
  66.             SpecialCar2 = new GTA.Timer(100, false);
  67.             prepareRing = new GTA.Timer(10,true);
  68.  
  69.             //cutsceneNr1 = new GTA.Timer(1, false);
  70.             challengeNr1_first = new GTA.Timer(0, false);
  71.             challengeNr1_second = new GTA.Timer(1, false);
  72.             challengeNr2 = new GTA.Timer(1, false);
  73.             challengeNr3 = new GTA.Timer(5, false);
  74.             timerDraw = new GTA.Timer(1000,false);
  75.  
  76.             drawRedCircle = new Checkpoint();
  77.             drawRedCircle.Color = Color.FromArgb(80, 250, 0, 0);
  78.  
  79.             resultFont = new GTA.Font("Impact", 1, FontScaling.FontSize, false, false);
  80.             resultFont.Effect = FontEffect.Shadow;
  81.             resultFont.EffectColor = Color.FromArgb(125, Color.Gold);
  82.             resultFont.EffectSize = 1;
  83.            
  84.  
  85.             screenFont = new GTA.Font("Impact", 2, FontScaling.FontSize, false, false);
  86.             screenFont.Effect = FontEffect.Edge;
  87.             screenFont.EffectColor = Color.FromArgb(125,Color.DarkGoldenrod);
  88.             screenFont.EffectSize = 3;
  89.            
  90.             soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  91.             this.timerDraw.Tick += new EventHandler(this.TimerChallenge);
  92.             this.prepareRing.Tick += new EventHandler(this.Peds_In_City);
  93.             //this.cutsceneNr1.Tick += new EventHandler(this.CutScene1_Challenge1);
  94.             this.challengeNr1_first.Tick += new EventHandler(this.FirstMission_Challenge1);
  95.             this.challengeNr1_second.Tick += new EventHandler(this.SecondMission_Challenge1);
  96.             this.challengeNr2.Tick += new EventHandler(this.FirstMission_Challenge2);
  97.             this.challengeNr3.Tick += new EventHandler(this.FirstMission_Challenge3);
  98.             this.SpecialCar_CHECK.Tick += new EventHandler(this.CheckSpecialCar);
  99.             this.SpecialCar0.Tick += new EventHandler(this.SpecialCar0_tick);
  100.             this.SpecialCar1.Tick += new EventHandler(this.SpecialCar1_tick);
  101.             this.SpecialCar2.Tick += new EventHandler(this.SpecialCar2_tick);
  102.             this.PerFrameDrawing += new GraphicsEventHandler(DrawingThings);
  103.             this.BindKey(System.Windows.Forms.Keys.L, new KeyPressDelegate(KeyDown));
  104.             this.Interval = 1;
  105.             this.BindConsoleCommand("Clear", new ConsoleCommandDelegate(Czystka), " - Clear Rinepim");
  106.             //this.BindConsoleCommand("Start", new ConsoleCommandDelegate(Start));
  107.             Start();
  108.             calyPlik = SprawdzanieCodes();
  109.         }
  110.        
  111.  
  112.  
  113.         private void Add_Award(int numer_adward)
  114.         {
  115.             switch (numer_adward)
  116.             {
  117.                 case 0:
  118.                     if (!(antenaAuta == null)) if (antenaAuta.Exists())
  119.                         {
  120.                             antenaAuta.NoLongerNeeded();
  121.                             antenaAuta.Detach();
  122.                             antenaAuta.Delete();
  123.                         }
  124.                     if (!(specialCars[0] == null)) if (specialCars[0].Exists())
  125.                         {
  126.                             specialCars[0].NoLongerNeeded();
  127.                             specialCars[0].Delete();
  128.                         }
  129.  
  130.                     GTA.Native.Function.Call("REQUEST_MODEL", 0x3A196CEA);
  131.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", -353.1F, 9.7F, 14.18F, 5F);
  132.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", -353.1F, 9.7F, 14.18F, 5F);
  133.                     GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", -353.1F, 9.7F, 14.18F, 5F);
  134.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -353.1F, 9.7F, 14.18F, 5F);
  135.                     specialCars[0] = World.CreateVehicle(0x3A196CEA, new Vector3(-353.1F, 9.7F, 14.18F));
  136.                     specialCars[0].Heading = 2;
  137.                     GTA.Native.Function.Call("REQUEST_MODEL", 0x700F7C5A);
  138.                     antenaAuta = World.CreateObject(0x700F7C5A, new Vector3(-353.1F, 9.7F, 40.18F));
  139.                     antenaAuta.AttachToVehicle(specialCars[0], new Vector3(0, -0.4F, 0.96F), new Vector3(0F,3.15F,0F));
  140.                     antenaAuta.Collision = true;
  141.                    
  142.                     //GTA.Native.Function.Call("ATTACH_OBJECT_TO_CAR_PHYSICALLY",0x700F7C5A, specialCars[0], 0, 0, 0F,0F,1F, 0, 0, 0, 0, 0, 0, 0, 1);
  143.                    
  144.                     break;
  145.                 case 1:
  146.                     if (!(specialCars[1] == null)) if (specialCars[1].Exists())
  147.                         {
  148.                             GTA.Native.Function.Call("STOP_PTFX", ptfxLodziarka);
  149.                             GTA.Native.Function.Call("REMOVE_PTFX", ptfxLodziarka);
  150.                             specialCars[1].NoLongerNeeded();
  151.                             specialCars[1].Delete();
  152.                         }
  153.                    
  154.                     GTA.Native.Function.Call("REQUEST_MODEL", 0x22C16A2F);
  155.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", -533.42F, 1477.21F, 18.35F, 10F);
  156.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", -533.42F, 1477.21F, 18.35F, 10F);
  157.                     GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", -533.42F, 1477.21F, 18.35F, 10F);
  158.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -533.42F, 1477.21F, 18.35F, 10F);
  159.                     specialCars[1] = World.CreateVehicle(0x22C16A2F,new Vector3(-533.42F,1477.21F,18.35F));
  160.                     specialCars[1].Heading = 180;
  161.                     ptfxLodziarka = GTA.Native.Function.Call<int>("START_PTFX_ON_VEH", "ambient_dry_ice", specialCars[1], 0, 0, 0, 0, 0, 0, 1.0);
  162.                     break;
  163.                 case 2:
  164.                     if (!(specialCars[2] == null)) if (specialCars[2].Exists())
  165.                         {
  166.                             specialCars[2].NoLongerNeeded();
  167.                             specialCars[2].Delete();
  168.                         }
  169.                     GTA.Native.Function.Call("REQUEST_MODEL", 0x9D0450CA);
  170.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", -528.16F, 1284.33F, 109.6F, 10F);
  171.                     GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", -528.16F, 1284.33F, 109.6F, 10F);
  172.                     GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", -528.16F, 1284.33F, 109.6F, 10F);
  173.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -528.16F, 1284.33F, 109.6F, 10F);
  174.                     specialCars[2] = World.CreateVehicle(0x9D0450CA, new Vector3(-528.16F, 1284.33F, 109.6F));
  175.                     specialCars[2].Heading = 0;
  176.                     break;
  177.             }
  178.            
  179.  
  180.         }
  181.         private void NadpisanieCodes(int numer_challenge)
  182.         {
  183.             if (!(System.IO.File.Exists(Game.InstallFolder + "//scripts/RinepimChallenge/codes.txt")))
  184.             {
  185.                 GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Script did not find 'codes.txt' file. Award was not saved.", 10000, 1);
  186.             }
  187.             else
  188.             {
  189.                 StringBuilder MICHAL = new StringBuilder();
  190.                 System.IO.StreamWriter MichalWpisz = new System.IO.StreamWriter(Game.InstallFolder + "//scripts/RinepimChallenge/codes.txt", false);
  191.                 MichalWpisz.WriteLine("Special Awards:");
  192.                 for (int linijka3_nr = 0; linijka3_nr < numer_challenge; linijka3_nr++)
  193.                 {
  194.                     MichalWpisz.WriteLine(calyPlik[linijka3_nr]);
  195.                 }
  196.                 switch (numer_challenge)
  197.                 {
  198.                     case 0:
  199.                         MichalWpisz.WriteLine("64657374726f79656e67696e65");  // destroyengine
  200.                         //GTA.Native.Function.Call("SET_MISSION_PASSED_CASH",true, 5000, 1);
  201.  
  202.                         Player.Money = Player.Money + 1000;
  203.                         if (zadanieCheck[0] == true) Player.Money = Player.Money + 1000;
  204.                         if (zadanieCheck[1] == true) Player.Money = Player.Money + 5000;
  205.                         GTA.Native.Function.Call("DISPLAY_CASH", true);
  206.                         // TEST TUTAJ
  207.                         break;
  208.                     case 1:
  209.                         MichalWpisz.WriteLine("6672657a7a65"); // frezze
  210.                         Player.Money = Player.Money + 1000;
  211.                         if (zadanieCheck[2] == true) Player.Money = Player.Money + 5000;
  212.                         if (zadanieCheck[3] == true) Player.Money = Player.Money + 2000;
  213.                         GTA.Native.Function.Call("DISPLAY_CASH", true);
  214.                         break;
  215.                     case 2:
  216.                         MichalWpisz.WriteLine("70726f70656c6c6572"); // propeller
  217.                         Player.Money = Player.Money + 10000;
  218.                         //if (zadanieCheck[2] == true) Player.Money = Player.Money + 5000;
  219.                         //if (zadanieCheck[3] == true) Player.Money = Player.Money + 2000;
  220.                         GTA.Native.Function.Call("DISPLAY_CASH", true);
  221.                         break;
  222.                 }
  223.  
  224.  
  225.                 for (int linijka4_nr = numer_challenge+1; linijka4_nr < 25; linijka4_nr++)
  226.                 {
  227.                     MichalWpisz.WriteLine(calyPlik[linijka4_nr]);
  228.                 }
  229.                 MichalWpisz.Close();
  230.                 calyPlik = SprawdzanieCodes();
  231.                
  232.  
  233.             }
  234.         }
  235.         private string[] SprawdzanieCodes()
  236.         {
  237.             string[] linesFileRead = new string[25];
  238.             if (!(System.IO.File.Exists(Game.InstallFolder + "//scripts/RinepimChallenge/codes.txt")))
  239.             {
  240.                 GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Script did not find 'codes.txt' file. Awards do not loaded.", 10000, 1);
  241.             }
  242.             else
  243.             {
  244.                 using (System.IO.StreamReader TESTUJE = new System.IO.StreamReader(Game.InstallFolder.ToString() + "//scripts/RinepimChallenge/codes.txt", true))
  245.                 {
  246.                     if (!(TESTUJE.ReadLine() == "Special Awards:"))  //pusty znak - alt+2+5+5
  247.                     {
  248.                         GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "codes.txt IS NOT ORYGINAL!", 10000, 1);
  249.                         return null;
  250.                     }
  251.                     for (int linijka1_nr = 0; linijka1_nr < 25; linijka1_nr++)
  252.                     {
  253.                         linesFileRead[linijka1_nr] = TESTUJE.ReadLine();
  254.                     }
  255.                     TESTUJE.Close();
  256.                 }
  257.                 for (int linijka2_nr = 0; linijka2_nr < 25; linijka2_nr++)
  258.                 {
  259.                     switch (linijka2_nr)
  260.                     {
  261.                         case 0:  // pierwsza linijka
  262.                         if (linesFileRead[0] == "64657374726f79656e67696e65")
  263.                         {
  264.                             Add_Award(0);
  265.                         }
  266.                         break;
  267.                         case 1:
  268.                         if (linesFileRead[1] == "6672657a7a65")
  269.                         {
  270.                             Add_Award(1);
  271.                         }
  272.                         break;
  273.                         case 2:
  274.                         if (linesFileRead[2] == "70726f70656c6c6572")
  275.                         {
  276.                             Add_Award(2);
  277.                         }
  278.                         break;
  279.                     }
  280.                 }
  281.             }
  282.             return linesFileRead;
  283.         }
  284.         public void Start()//(ParameterCollection Parameter)
  285.         {
  286.             for (int numerCzlowiek = 0; numerCzlowiek <= 2; numerCzlowiek++)
  287.             {
  288.                 //GTA.Native.Function.Call("REQUEST_COLLISION_AT_POSN", miejscaStartPed[numerCzlowiek].X, miejscaStartPed[numerCzlowiek].Y, miejscaStartPed[numerCzlowiek].Z);
  289.                 GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", miejscaStartPed[numerCzlowiek].X, miejscaStartPed[numerCzlowiek].Y, miejscaStartPed[numerCzlowiek].Z, 5F);
  290.                 GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", miejscaStartPed[numerCzlowiek].X, miejscaStartPed[numerCzlowiek].Y, miejscaStartPed[numerCzlowiek].Z, 5F);
  291.                 GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", miejscaStartPed[numerCzlowiek].X, miejscaStartPed[numerCzlowiek].Y, miejscaStartPed[numerCzlowiek].Z, 5F);
  292.                 GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", miejscaStartPed[numerCzlowiek].X, miejscaStartPed[numerCzlowiek].Y, miejscaStartPed[numerCzlowiek].Z, 5F);
  293.                 Game.WaitInCurrentScript(100);
  294.                 //GTA.Native.Function.Call("REQUEST_INTERIOR_MODELS", 0xFC2BE1B8, char *interiorName);
  295.                 GTA.Native.Function.Call("REQUEST_MODEL", 0xFC2BE1B8);
  296.                 //GTA.Native.Function.Call("REQUEST_COLLISION_FOR_MODEL", 0xFC2BE1B8);
  297.                 startPed[numerCzlowiek] = World.CreatePed(0xFC2BE1B8, miejscaStartPed[numerCzlowiek]);
  298.             }
  299.             Game.WaitInCurrentScript(10000);
  300.             Game.Console.Print("XXX");
  301.             startPed[0].Heading = 220F;
  302.             startPed[1].Heading = 264.7293F;
  303.             startPed[2].Heading = 292.31F;
  304.             //-389.3637, 613.7462, 14.7132 - ped spawn a head: 264.7293
  305.  
  306.            
  307.             for (int numerCzlowiek = 0; numerCzlowiek <= 2; numerCzlowiek++)
  308.             {
  309.                 //GTA.Native.Function.Call("SET_LOAD_COLLISION_FOR_CHAR_FLAG", startPed[numerCzlowiek], true);
  310.                 startPed[numerCzlowiek].BlockPermanentEvents = true;
  311.                 startPed[numerCzlowiek].BlockGestures = true;
  312.                 startPed[numerCzlowiek].BlockWeaponSwitching = true;
  313.                 startPed[numerCzlowiek].Task.PlayAnimation(new AnimationSet("missroman6"), "partial_wave_a", 1.0F, AnimationFlags.Unknown11 | AnimationFlags.Unknown05 | AnimationFlags.Unknown09);
  314.                 GTA.Native.Function.Call("SET_CHAR_KEEP_TASK", startPed[numerCzlowiek], true);
  315.                 GTA.Native.Function.Call("BLOCK_CHAR_VISEME_ANIMS", startPed[numerCzlowiek], true);
  316.                 GTA.Native.Function.Call("BLOCK_CHAR_AMBIENT_ANIMS", startPed[numerCzlowiek], true);
  317.                 GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", startPed[numerCzlowiek], "missroman6", "partial_wave_a", 0.2F);
  318.                 //GTA.Native.Function.Call("TASK_ACHIEVE_HEADING", startPed[numerCzlowiek], 220F);
  319.                 GTA.Native.Function.Call("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", startPed[numerCzlowiek], true);
  320.                 startPed[numerCzlowiek].BlockPermanentEvents = true;
  321.                 startPed[numerCzlowiek].CowerInsteadOfFleeing = false;
  322.                 startPed[numerCzlowiek].Invincible = true;
  323.                 startPed[numerCzlowiek].SenseRange = 0.0F;
  324.                 startPed[numerCzlowiek].Task.AlwaysKeepTask = true;
  325.                
  326.                 startPed[numerCzlowiek].MakeProofTo(true, true, true, true, true);
  327.                 GTA.Native.Function.Call("UNLOCK_RAGDOLL", startPed[numerCzlowiek], false);
  328.                 startPed[numerCzlowiek].FreezePosition = true;
  329.             }
  330.         }
  331.         private void Czystka(ParameterCollection Parameter)
  332.         {
  333.  
  334.             startPed[2].NoLongerNeeded();
  335.             startPed[2].Delete();
  336.             //specialCars[0].NoLongerNeeded();
  337.             //specialCars[0].Delete();
  338. // NA WEJŚCIU GRY - SPRAWDZ CZY JEST PLIK + CZY JEST ORYGINALNY
  339. // POTEM WCZYTAJ JAKIE KODY GRACZ DOSTAŁ
  340. // DODAJ TE OBIEKTY NA MAPE itp
  341.             //string TurretCode = "turret_one";
  342.             //Game.Console.Print("turret_one hash: " + TurretCode.GetHashCode() + "1030");
  343.             /*
  344.             if (!(System.IO.File.Exists(Game.InstallFolder + "//scripts/RinepimChallenge/codes.txt")))
  345.             {
  346.                 GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Script did not find 'codes.txt' file. Award was not saved.", 10000, 1);
  347.             }
  348.             else
  349.             {
  350.                 /*using (System.IO.StreamReader TESTUJE = new System.IO.StreamReader(Game.InstallFolder.ToString() + "//scripts/RinepimChallenge/codes.txt", true))
  351.                 {
  352.                     if (!(TESTUJE.ReadLine() == "Special Awards:"))  //pusty znak - alt+2+5+5
  353.                     {
  354.                         GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "codes.txt IS NOT ORYGINAL!", 10000, 1);
  355.                         return;
  356.                     }
  357.                    
  358.                     //while (TESTUJE.Peek() >= 0)
  359.                     //{
  360.                         //Game.Console.Print(TESTUJE.ReadLine());
  361.                         //ABC = ABC + 1;
  362.                     //while (!TESTUJE.EndOfStream)
  363.                     for(ABC=0;ABC<25;ABC++)
  364.                     {
  365.                     lines[ABC] = TESTUJE.ReadLine();
  366.                     Game.Console.Print(lines[ABC]);
  367.                    
  368.                     }  
  369.                     //}
  370.                     //Game.Console.Print("BYLO ABC: " + ABC);
  371.                     TESTUJE.Close();
  372.                 }
  373.                 StringBuilder MICHAL = new StringBuilder();
  374.  
  375.                 //MICHAL.AppendLine(mojTekst.GetHashCode().ToString());
  376.                
  377.                 System.IO.StreamWriter MichalWpisz = new System.IO.StreamWriter(Game.InstallFolder + "//scripts/RinepimChallenge/codes.txt",false);
  378.                 MichalWpisz.WriteLine("Special Awards:");
  379.                 for (int linijka3_nr = 0; linijka3_nr < 5; linijka3_nr++)
  380.                 {
  381.                     MichalWpisz.WriteLine(calyPlik[linijka3_nr]);
  382.                 }
  383.                 for (int linijka4_nr = 6; linijka4_nr < 25; linijka4_nr++)
  384.                     {
  385.                         MichalWpisz.WriteLine(calyPlik[linijka4_nr]);
  386.                     }
  387.                 MichalWpisz.Close();
  388.             }
  389.         */
  390.         }
  391.         private int Losowanie(int min, int max)
  392.         {
  393.             Random newRandom = new Random();
  394.             return newRandom.Next(min, max);
  395.         }
  396.         private void PlayerIsAlive()
  397.         {
  398.             if (Player.Character.isDead == true)
  399.             {
  400.                 ClearAll();
  401.             }
  402.         }
  403.         private void KeyDown()
  404.         {
  405.             //Game
  406.               //  .Consolegasnica.CurrentRoom;
  407.            
  408.             //GTA.Native.Function.Call("GET_INTERIOR_FROM_CHAR",Player.Character, &inter);
  409.             //Game.Console.Print("ROOM: " + Player.Character.CurrentRoom);
  410.             /*
  411.             GTA.Native.Function.Call("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE",new Model(0xb7bda30e), -528.0F, 1262.0F, 18.0F, 0, 0.0F); // open
  412.             //GTA.Native.Function.Call("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", new Model(0xb7bda30e), -528.0F, 1262.0F, 18.0F, 1, 0.0F); // lock
  413.             //tStateOfClosestDoorOfType(0xb7bda30e, -528.0f, 1262.0f, 18.0f, 0, 0.0f)
  414.             /*GTA.Native.Function.Call("GET_STATE_OF_CLOSEST_DOOR_OF_TYPE",(uint model, float x, float y, float z, int *state, float *);
  415.             GetStateOfClosestDoorOfType(model, x, y, z, &lock, &doorSwing);
  416.                         if (lock == 1)  // if door is locked, unlock
  417.                         {
  418.                             SetStateOfClosestDoorOfType(model, x, y, z, 0, 0.0f);
  419.                             LogInfo("Episode: TLAD, Door: '%s', Coords: %.2f  %.2f  %.2f", strDoor, x, y, z);
  420.                         }
  421.             //GTA.Native.Function.Call("SET_FORCE_PLAYER_TO_ENTER_THROUGH_DIRECT_DOOR",Player.Character, true);
  422.             //GTA.Native.Function.Call("PLAYSTATS_MISSION_FAILED",1000);
  423.             //Wait(1000);
  424.             /*
  425.             //soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  426.             GTA.Native.Function.Call("PLAY_AUDIO_EVENT", "FLAT_TYRE_BLOWOUT");
  427.             Wait(1000);
  428.             GTA.Native.Function.Call("PLAY_SOUND_FRONTEND", soundID, "FLAT_TYRE_BLOWOUT");
  429.             Wait(1000);
  430.             GTA.Native.Function.Call("PLAY_SOUND", soundID, "FLAT_TYRE_BLOWOUT");
  431.             //Player.TeleportTo(startPed[1].Position.Around(2F));
  432.             /*
  433.             if(TEEEST==false)
  434.             {
  435.             MissionBlip = GTA.Blip.AddBlip(Player.Character.Position);
  436.             TEEEST = true;
  437.                 GTA.Native.Function.Call("FLASH_BLIP",MissionBlip, true);
  438.             }
  439.            
  440.             //GTA.Native.Function.Call("SET_BLIP_COORDINATES", , Player.Character.Position.X, Player.Character.Position.Y, Player.Character.Position.Z);
  441.            
  442.            
  443.            
  444.  
  445.             //MissionBlip.Position = Player.Character.GetOffsetPosition(new Vector3(0,5F,0));
  446.  
  447.             //GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"),new Vector3(-340.04F,640.93F,16.48F));
  448.             //BLIP 1: -362.00F,621.62, 14.77
  449.             // DRUGI:GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"),new Vector3(-35.58F,606.64F,14.46F));
  450.             // trzeci GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-70.44F, 1241.32F, 20.97F));
  451.             // czwarty LAST :GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-503.9102F, 1467.0360F, 21.660F));
  452.             //-389.3637, 613.7462, 14.7132 - ped spawn a head: 264.7293
  453.             //lodzik.FreezePosition = true;
  454.  
  455.            
  456.           //while(!(GTA.Native.Function.Call<bool>("HAS_OBJECT_BEEN_DAMAGED_BY_CHAR",lodzik, Player.Character))
  457.             //lodzik.NoLongerNeeded();
  458.             //lodzik.Delete();
  459.             /*
  460.             Ped CEL = World.CreatePed(Player.Character.GetOffsetPosition(new Vector3(0, 5F, 0))) ;
  461.             GTA.Native.Function.Call("SET_CHAR_MOVE_ANIM_SPEED_MULTIPLIER",CEL, 4.0F);
  462.                 CEL.Task.RunTo(Player.Character.GetOffsetPosition(new Vector3(0,30F,0)),true);
  463.                 Wait(1000);
  464.                 //int qwe = 254;
  465.                 //do
  466.                 //{
  467.                     //qwe = qwe - 1;
  468.                     //GTA.Native.Function.Call("SET_PED_ALPHA", CEL, 48);
  469.                     //Wait(10);
  470.                 //} while (qwe > 10);
  471.                 //Game.Console.Print("QWE: " + qwe);
  472.             Wait(5000);
  473.             CEL.Task.RunTo(Player.Character.GetOffsetPosition(new Vector3(10, -10F, 0)), true);
  474.             //GTA.Native.Function.Call("SET_PED_ALPHA", CEL, 255);
  475.             Wait(5000);
  476.             CEL.NoLongerNeeded();
  477.             CEL.Delete();
  478.             /// DRAW_SPRITE_WITH_UV_COORDS(uint texture, float, float, float, float, float, float, float, float, float angle, int r, int g, int b, int a);
  479.             /// SPRAWDZIC
  480.            
  481.             //Wait(500);
  482.  
  483.            
  484.  
  485.                 //GTA.Native.Function.Call("GET_OBJECT_MASS",obiektH, masa);
  486.                 //Game.Console.Print("MASA : " + masa);
  487.                 //GTA.Native.Function.Call("CLEAR_OBJECT_LAST_DAMAGE_ENTITY", obiektH);
  488.                 //GTA.Native.Function.Call("SET_OBJECT_CCD", obiektH,true);
  489.                 //GTA.Native.Function.Call("SET_OBJECT_HEALTH", obiektH, -10F);
  490.                 //GTA.Native.Function.Call("SET_ACTIVATE_OBJECT_PHYSICS_AS_SOON_AS_IT_IS_UNFROZEN", obiektH, true);
  491.                    
  492.                    
  493.                    
  494.                 //}
  495.                
  496.                
  497.            
  498.             /*
  499.            
  500.            
  501.                         //Vector3 qwe = Player.Character.GetOffsetPosition(new Vector3(0F,10F,2F));
  502.              //GTA.Native.Function.Call("PLAY_FIRE_SOUND_FROM_POSITION",1, qwe.X, qwe.Y, qwe.Z);
  503.             //GTA.Native.Function.Call("DRAW_CORONA", -357.69F, Player.Character.Position.Y - 30F, 22.96F, 200F, 1, 1F, 255, 255, 255);
  504.  
  505.            
  506.            
  507.             //Player.Character.Animation.Play(grupa_anim2, animacja2, 1.0F,AnimationFlags.Unknown06);
  508.             //Wait(2000);
  509.             //Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown11 | AnimationFlags.Unknown12);
  510.             //GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, animacja, grupa_anim.Name, 0.9F, 0, 0, 0, 1, 0);
  511.             //GTA.Native.Function.Call("TASK_PLAY_ANIM_UPPER_BODY", Player.Character, animacja, grupa_anim.Name, 1.0F, 0, 0, 0, 0, 0);
  512.  
  513.             //Wait(5000);
  514.            
  515.             //dymek.Visible = false;
  516.            
  517.            
  518.            
  519.             //GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, animacja, grupa_anim.Name, 0.9F, 0, 0, 0, 1, 0);
  520.              *
  521.              *
  522.    // START GASNICY !!!!!!!!!!!!!!!!!!!!!!!!!!
  523.             string animacja = "swing_idle";
  524.             AnimationSet grupa_anim = new AnimationSet("amb@baseball");
  525.             string animacja2 = "use_vendmac";
  526.             AnimationSet grupa_anim2 = new AnimationSet("amb@arcade");
  527.             soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  528.             GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  529.             GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim2.Name);
  530.             Player.Character.FreezePosition = true;
  531.             Player.CanControlCharacter = false;
  532.             Player.Character.Animation.Play(grupa_anim2, animacja2, 1.0F);
  533.             Wait(100);
  534.             GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim2.Name, animacja2, 0.60F);
  535.             Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06|AnimationFlags.Unknown09 | AnimationFlags.Unknown11 | AnimationFlags.Unknown12);
  536.             //GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, animacja, grupa_anim.Name, 0.9F, 0, 0, 0, 1, 0);
  537.             Wait(100);
  538.             GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim.Name, animacja, 0.90F);
  539.             Wait(1000);
  540.             Player.Character.FreezePosition = false;
  541.             Player.CanControlCharacter = true;
  542.              
  543.             Vector3 PRZOD = Player.Character.GetOffsetPosition(new Vector3(0, 1F, 0));
  544.             int myFire1 = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -542.1921F, 1256.6660F, 21.5448F, 25, 50);
  545.             int myFire2 = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", PRZOD.X, PRZOD.Y+4F, PRZOD.Z, 25, 50);
  546.  
  547.            
  548.             //GTA.Native.Function.Call("TASK_PLAY_ANIM_NON_INTERRUPTABLE", Player.Character, animacja, grupa_anim.Name, 0.9F, 0, 0, 0, 1, 0);
  549.             //UPDATE_PTFX_TINT(iParam1, uVar4 / 255.00000000, uVar5 / 255.00000000, uVar6 / 255.00000000, 255);
  550.             //Wait(2000);
  551.             //GTA.Native.Function.Call("UPDATE_PTFX_OFFSETS", MY_TEST, 0F, 0F, 0.5F, 15F, 15F,-25.0F);
  552.             //int PTFX_nr1 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "shot_directed_steam", gasnica, 0.2F, 0F, 0.63F, Player.Character.Direction.X + 80F, Player.Character.Direction.Y + 180F, Player.Character.Direction.Z+80F, 1.0F);
  553.             //int PTFX_nr1 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "shot_directed_water", gasnica, 0.2F, 0F, 0.63F, Player.Character.Direction.X + 80F, Player.Character.Direction.Y + 180F, Player.Character.Direction.Z + 80F, 1.0F);
  554.            
  555.            
  556.             int TTT = 20;
  557.             float RRR = 16.2F;
  558.             int PTFX_nr1=0,PTFX_nr2=1;
  559.             bool it_WLACZONY = false;
  560.             Wait(200);
  561.            
  562.            
  563.             GTA.Object gasnica = World.CreateObject(0x145D8395, Player.Character.GetOffsetPosition(new Vector3(0, 1F, 0F)));
  564.              
  565.             //GTA.Native.Function.Call("MUTE_POSITIONED_RADIO", true);
  566.             //GTA.Native.Function.Call("SET_LOBBY_MUTE_OVERRIDE", true);
  567.             //GTA.Native.Function.Call("MUTE_GAMEWORLD_AUDIO", true);
  568.             //GTA.Native.Function.Call("MUTE_GAMEWORLD_AND_POSITIONED_RADIO_FOR_TV", true); // to dziala
  569.              
  570.             GTA.Native.Function.Call("BLOCK_CHAR_VISEME_ANIMS",Player.Character, true);
  571.             GTA.Native.Function.Call("BLOCK_CHAR_AMBIENT_ANIMS",Player.Character, true);
  572.             GTA.Native.Function.Call("HIDE_CHAR_WEAPON_FOR_SCRIPTED_CUTSCENE", Player.Character, true);
  573.             GTA.Native.Function.Call("BLOCK_PED_WEAPON_SWITCHING", Player.Character, true);
  574.             GTA.Native.Function.Call("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", Player.Character, true);
  575.             //GTA.Native.Function.Call("IS_PED_IN_CUTSCENE_BLOCKING_BOUNDS",Player.Character);
  576.             gasnica.AttachToPed(Player.Character, Bone.LeftHand, new Vector3(0F, 0.02F, 0.63F), new Vector3(3.15F, 0.0F, -1.65F));
  577.            
  578.             //GTA.Native.Function.Call("UPDATE_PTFX_TINT", PTFX_nr1, 255F, 0.0F, 1.0F, 255);
  579.             bool zgaszony1=false,zgaszony2=false;
  580.             int control = 0;
  581.             do
  582.             {
  583.                 //GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim.Name, animacja, 0.90F);
  584.                 //GTA.Native.Function.Call("UPDATE_PTFX_TINT", MY_TEST, 5F / 255.00000F, 155.5F / 255.00000000, 255.0F / 255.00000000, 255);
  585.                 //GTA.Native.Function.Call("UPDATE_PTFX_TINT", MY_TEST, 255F, 0.0F, 1.0F, 0F);
  586.                 RRR = RRR + 1.0F;
  587.                 //GTA.Native.Function.Call("UPDATE_PTFX_OFFSETS", MY_TEST, 0F, 0F, 0.5F, RRR, RRR, RRR);    
  588.                 if(Game.isGameKeyPressed(GameKey.Action))
  589.                 {
  590.                     if (it_WLACZONY)
  591.                     {
  592.                         it_WLACZONY = false;
  593.                         GTA.Native.Function.Call("STOP_SOUND", soundID);
  594.                        
  595.                         GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  596.                         GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  597.                         GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  598.                         GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  599.                         Wait(300);
  600.                     }
  601.                     else
  602.                     {
  603.                        
  604.                         GTA.Native.Function.Call("PLAY_SOUND_FROM_OBJECT",soundID, "BULLET_SPRAY_LOOP", gasnica);
  605.                         //GTA.Native.Function.Call("PLAY_SOUND_FROM_OBJECT", soundID, "AMBIENT_CREAKING_BV_WRAPPER", gasnica);
  606.                         //Wait(1000);
  607.                         //GTA.Native.Function.Call("PLAY_AUDIO_EVENT", "AMBIENT_CREAKING_BV_WRAPPER");
  608.                         //Wait(1000);
  609.                         //GTA.Native.Function.Call("PLAY_SOUND_FRONTEND", soundID, "AMBIENT_CREAKING_BV_WRAPPER");
  610.                         //Wait(1000);
  611.                         //GTA.Native.Function.Call("PLAY_SOUND", soundID, "AMBIENT_CREAKING_BV_WRAPPER");
  612.                         PTFX_nr1 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "water_carwash_jets", gasnica, 0.15F, 0F, 0.66F, Player.Character.Direction.X + 90F, Player.Character.Direction.Y + 110F, Player.Character.Direction.Z, 1.0F);
  613.                         PTFX_nr2 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "water_carwash_jets", gasnica, 0.16F, 0F, 0.66F, Player.Character.Direction.X + 90F, Player.Character.Direction.Y + 110F, Player.Character.Direction.Z, 1.0F);
  614.                         it_WLACZONY = true;
  615.                        
  616.                     }
  617.                 }
  618.                 if (it_WLACZONY)
  619.                 {
  620.                     Vector3 Gaszenie = Player.Character.GetOffsetPosition(new Vector3(0,1.0F,-0.5F));
  621.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT",Gaszenie.X, Gaszenie.Y, Gaszenie.Z, 1.0F);
  622.                     TTT = TTT - 1;
  623.                     //Wait(500);
  624.                     //dymek.Delete();
  625.                 }
  626.                
  627.                 Wait(100);
  628.                 if (GTA.Native.Function.Call<bool>("IS_SCRIPT_FIRE_EXTINGUISHED", myFire1) && zgaszony1==false)
  629.                 {
  630.                     Game.Console.Print("ZGASZONY 1!");
  631.                     zgaszony1 = true;
  632.                     control = control + 1;
  633.                 }
  634.                 if (GTA.Native.Function.Call<bool>("IS_SCRIPT_FIRE_EXTINGUISHED", myFire2) && zgaszony2 == false)
  635.                 {
  636.                     Game.Console.Print("ZGASZONY 2!");
  637.                     zgaszony2 = true;
  638.                     control = control + 1;
  639.                     /// Zabezpieczenie anty cheat:
  640.                     /// jak suma kontrolna wiecej niz 1 to jest cheater
  641.                     /// jak ostatni ogien zgasi nie bedac w poblizu = dodaj do sumy kontrolnej i tez wykryje cheatera
  642.                 }
  643.  
  644.                 if (control > 1)
  645.                 {
  646.                     Game.Console.Print("CHEATER!");
  647.                 }
  648.                     control = 0;
  649.                 Game.DisplayText("TTT : " + TTT);
  650.             } while (TTT > 10);
  651.  
  652.             GTA.Native.Function.Call("STOP_SOUND", soundID);
  653.             GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  654.             GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  655.             GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  656.             GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  657.             GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  658.  
  659.             //GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  660.             //GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  661.             //GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  662.             //GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  663.            
  664.             gasnica.Detach();
  665.             gasnica.NoLongerNeeded();
  666.             Player.Character.Task.ClearAll();
  667.             Player.Character.Task.ClearSecondary();
  668.             //GTA.Native.Function.Call("MUTE_GAMEWORLD_AND_POSITIONED_RADIO_FOR_TV", false);
  669.             //GTA.Native.Function.Call("MUTE_POSITIONED_RADIO", false);
  670.             //GTA.Native.Function.Call("SET_LOBBY_MUTE_OVERRIDE", false);
  671.             //GTA.Native.Function.Call("MUTE_GAMEWORLD_AUDIO", false);
  672.             GTA.Native.Function.Call("BLOCK_CHAR_AMBIENT_ANIMS", Player.Character, false);
  673.             GTA.Native.Function.Call("BLOCK_CHAR_VISEME_ANIMS", Player.Character, false);
  674.             GTA.Native.Function.Call("BLOCK_PED_WEAPON_SWITCHING", Player.Character, false);
  675.             GTA.Native.Function.Call("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", Player.Character, false);
  676.  // KONIEC GASNICY !!!!!!!!!!!!!!!!!!!!!!!!!!
  677.             /*
  678.             Wait(1000);
  679.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown11);
  680.             Wait(1000);
  681.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown10);
  682.             Wait(1000);
  683.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown08);
  684.             Wait(1000);
  685.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown07);
  686.             Wait(1000);
  687.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown02);
  688.             Wait(1000);
  689.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown04);
  690.             Wait(1000);
  691.             Player.Character.Task.PlayAnimation(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown09 | AnimationFlags.Unknown03);*/
  692.             // obiekt BM_fire_extingB
  693.  
  694.  
  695.            
  696.            
  697.             // wycelować - zwolnić - jakaś oznaka lodu - ragdoll po
  698.            
  699.  
  700.             // na dole vvv jak odegrać od pewnego momentu
  701.             /*
  702.              string animacja = "use_vendmac";
  703.                 AnimationSet grupa_anim = new AnimationSet("amb@arcade");
  704.             GTA.Native.Function.Call("REQUEST_ANIMS",grupa_anim.Name);
  705.             Wait(200);
  706.             Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown01);
  707.             Wait(200);
  708.             GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim.Name, animacja, 0.75F);
  709.             */
  710.  
  711.  
  712.             //Wait(10000);
  713.          
  714.             //Player.Character.Task.PlayAnimation(new AnimationSet("reaction@male_flee"), "front", 1.0F,AnimationFlags.Unknown06);
  715.             //GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME",Player.Character, "reaction@male_flee", "front", 0.1);
  716.  
  717.            
  718.             //Game.Console.Print("HEY : "+new AnimationSet("reaction@male_flee").GetPedsCurrentAnimationTime(Player.Character,"front"));
  719.             /*
  720.             if (Player.Character.isInVehicle())
  721.             {
  722.                 if (Player.Character.CurrentVehicle.Model == 0x22C16A2F)
  723.                 {
  724.                     if (Game.isGameKeyPressed(GameKey.SoundHorn))
  725.                     {
  726.                         int ABC = 0;
  727.                         float QWE = 1.0F;
  728.                         Ped[] pedsAround = World.GetPeds(Player.Character.Position, 14F);
  729.                         foreach (Ped targetArray in pedsAround)
  730.                         {
  731.                             if (targetArray == Player || targetArray.isInVehicle() ||
  732.                                 0.1F<targetArray.Animation.GetCurrentAnimationTime(new AnimationSet("reaction@male_flee"),"front")||
  733.                                 0.1F < targetArray.Animation.GetCurrentAnimationTime(new AnimationSet("reaction@male_flee"), "left") ||
  734.                                 0.1F < targetArray.Animation.GetCurrentAnimationTime(new AnimationSet("reaction@male_flee"), "right") ||
  735.                                 0.1F < targetArray.Animation.GetCurrentAnimationTime(new AnimationSet("amb@flee"), "stand_into_ball"))
  736.                                 //targetArray.Animation.isPlaying(new AnimationSet("reaction@male_flee"),"front")||
  737.                                 //targetArray.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "left")||
  738.                                 //targetArray.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "right")||
  739.                                 //targetArray.Animation.isPlaying(new AnimationSet("amb@flee"), "stand_into_ball"))
  740.                             {
  741.                                 continue;
  742.                             }
  743.                             int wynikLosowania = Losowanie(0, 4);
  744.                             Wait(1);
  745.                             if (wynikLosowania == 0)
  746.                             {
  747.                                 animacja = "front";
  748.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  749.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  750.                                 targetArray.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  751.                             }
  752.                             else if (wynikLosowania == 1)
  753.                             {
  754.                                 animacja = "left";
  755.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  756.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  757.                                 targetArray.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  758.                             }
  759.                             else if (wynikLosowania == 2)
  760.                             {
  761.                                 animacja = "right";
  762.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  763.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  764.                                 targetArray.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  765.                             }
  766.                             else if (wynikLosowania == 3)
  767.                             {
  768.                                 animacja = "stand_into_ball";
  769.                                 grupa_anim = new AnimationSet("amb@flee");
  770.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  771.                                 targetArray.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  772.                             }
  773.                         }
  774.                         while (QWE > 0.01F)
  775.                         {
  776.                             foreach (Ped targetArray in pedsAround)
  777.                             {
  778.                                 if (targetArray == Player || targetArray.isInVehicle())
  779.                                 {
  780.                                     continue;
  781.                                 }
  782.                                 ABC = ABC + 1;
  783.                                 if (ABC == pedsAround.Length)
  784.                                 {
  785.                                     QWE = QWE - 0.01F;
  786.                                     ABC = 1;
  787.                                     Wait(1);
  788.                                 }
  789.  
  790.                                 GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", targetArray, grupa_anim.Name, animacja, QWE);
  791.  
  792.                             }
  793.                         }
  794.                         Game.Console.Print("Ilu: " + pedsAround.Length);
  795.                         ABC = 0;
  796.                         foreach (Ped targetArray in pedsAround)
  797.                         {
  798.                             ABC = ABC + 1;
  799.                             if (targetArray == Player || targetArray.isInVehicle())
  800.                             {
  801.                                 continue;
  802.                             }
  803.  
  804.                             Game.Console.Print("Ile zwalnia: " + ABC);
  805.  
  806.                             GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", targetArray, grupa_anim.Name, animacja, 0.0F);
  807.                         }
  808.                         QWE = 1.0F;
  809.                         Wait(2000);
  810.                         Game.Console.Print("END!");
  811.                         foreach (Ped targetArray in pedsAround)
  812.                         {
  813.                             if (targetArray == Player.Character)
  814.                             {
  815.                                 continue;
  816.                             }
  817.                             targetArray.Task.ClearAllImmediately();
  818.                         }
  819.                     }
  820.                 }
  821.             }
  822.        
  823.            
  824.  
  825.             /*
  826.            
  827.  
  828.                 int wynikLosowania = Losowanie(0, 4);
  829.                 Game.Console.Print("LOSUJE: " + wynikLosowania);
  830.                
  831.                 if (wynikLosowania == 0)
  832.                 {
  833.                     string animacja = "front";
  834.                     AnimationSet grupa_anim = new AnimationSet("reaction@male_flee");
  835.                     GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  836.                     Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  837.                     while (QWE > 0.1F)
  838.                     {
  839.                         GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, QWE);
  840.                         QWE = QWE - 0.01F;
  841.                         Wait(1);
  842.                     }
  843.                     Wait(200);
  844.                     GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, 0.0);
  845.                 }
  846.                 else if (wynikLosowania == 1)
  847.                 {
  848.                     string animacja = "left";
  849.                     AnimationSet grupa_anim = new AnimationSet("reaction@male_flee");
  850.                     GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  851.                     Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  852.                     while (QWE > 0.1F)
  853.                     {
  854.                         GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, QWE);
  855.                         QWE = QWE - 0.01F;
  856.                         Wait(1);
  857.                     }
  858.                     Wait(200);
  859.                     GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, 0.0);
  860.                 }
  861.                 else if (wynikLosowania == 2)
  862.                 {
  863.                     string animacja = "right";
  864.                     AnimationSet grupa_anim = new AnimationSet("reaction@male_flee");
  865.                     GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  866.                     Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  867.                     while (QWE > 0.1F)
  868.                     {
  869.                         GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, QWE);
  870.                         QWE = QWE - 0.01F;
  871.                         Wait(1);
  872.                     }
  873.                     Wait(200);
  874.                     GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, 0.0);
  875.                 }
  876.                 else if (wynikLosowania == 3)
  877.                 {
  878.                     string animacja = "stand_into_ball";
  879.                     AnimationSet grupa_anim = new AnimationSet("amb@flee");
  880.                     GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  881.                     Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  882.                     while (QWE > 0.1F)
  883.                     {
  884.                         GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, QWE);
  885.                         QWE = QWE - 0.01F;
  886.                         Wait(1);
  887.                     }
  888.                     Wait(200);
  889.                     GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, grupa_anim.Name, animacja, 0.0);
  890.                 }
  891.            
  892.            
  893.             */
  894.             // versja STARA - TO NA IDLE --int myPtfx = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", "ambient_cig_clouds", Player.Character, 0, 0, 0, 0, 0, 0, 1.0);
  895.                 //0xF1388248
  896.             //GTA.Native.Function.Call("REQUEST_MODEL", 0xF1388248);
  897.             //dir_ptfx = GTA.World.CreateObject(0xF0E633D9,Player.Character.Position);
  898.             //dir_ptfx.FreezePosition = false;
  899.             //dir_ptfx.Collision = false;
  900.             //dir_ptfx.AttachToPed(Player.Character,Bone.Root,new Vector3(0,0,0),new Vector3(12,15,10));
  901.  
  902.  
  903.             // DO IDLE !!!!!!! int myPtfx = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", "ambient_cig_clouds", Player.Character, 0, 0, -0.6, 0, 0, 0, 1.0);
  904.             //ambient_steam_chimney
  905.             //ambient_hotdogstand
  906.             /*
  907.             int myPtfx = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", "ambient_hotdogstand", Player.Character, 0, 0, -0.8, 0, 0, 0, 1.0);
  908.             GTA.Native.Function.Call("UPDATE_PTFX_TINT",myPtfx, 0.0F, 0.0F, 1.0F, 255F);
  909.             //int myPtfx = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", "ambient_respray_can", Player.Character, 0, 0, -0.6, 2F, 95F, 22F, 1.0);
  910.            
  911.             //GTA.Native.Function.Call("EVOLVE_PTFX",myPtfx, "fade", 1.6);
  912.            
  913.             Game.Console.Print("STOP!");
  914.             QWE = 1.0F;
  915.             //if (new AnimationSet("reaction@male_flee").isPedPlayingAnimation(Player.Character, "front"))
  916.             //{
  917.                 //Game.Console.Print("GRA!");
  918.             //}
  919.  
  920.  
  921.             Wait(6000);
  922.  
  923.             GTA.Native.Function.Call("STOP_PTFX", myPtfx);
  924.             GTA.Native.Function.Call("REMOVE_PTFX", myPtfx);
  925.             //dest_ceramic
  926.             //dest_glass_clear_empty
  927.             //dest_plastic
  928.             myPtfx = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", "dest_glass_clear_empty", Player.Character, 0, 0, 0, 0, 0, 0, 2.0);
  929.             GTA.Native.Function.Call("PLAY_SOUND_FROM_POSITION", soundID, "GLASS_CRACK_S1_C", Player.Character.Position.X, Player.Character.Position.Y, Player.Character.Position.Z);
  930.             GTA.Native.Function.Call("STOP_PTFX", myPtfx);
  931.             GTA.Native.Function.Call("REMOVE_PTFX", myPtfx);
  932.             Game.Console.Print("CLEAR");
  933.            
  934.  
  935.            
  936.  
  937.             Player.Character.Task.ClearAll();
  938.             Player.Character.ForceRagdoll(2000, false);
  939.             Wait(200);
  940.             GTA.Native.Function.Call("STOP_SOUND", soundID);
  941.             GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  942.             //Player.Character.Euphoria.BodyBalance.Start(1000);
  943.            
  944.            
  945.            
  946.            
  947.            
  948.  
  949.             //reaction@male_flee
  950.             //Player.TeleportTo(new Vector3(-395.61F, 1178.95F, 14.54F));
  951.              */
  952.         }
  953.         private void CheckSpecialCar(object sender, EventArgs e)
  954.         {
  955.             if (Player.Character.isInVehicle())
  956.             {
  957.                 if (!(specialCars[0] == null))
  958.                 {
  959.                     if (Player.Character.CurrentVehicle == specialCars[0])
  960.                     {
  961.                         SpecialCar0.Start();
  962.                         SpecialCar_CHECK.Stop();
  963.                     }
  964.                 }
  965.                 if (!(specialCars[1] == null))
  966.                 {
  967.                     if (Player.Character.CurrentVehicle == specialCars[1])
  968.                     {
  969.                         SpecialCar1.Start();
  970.                         SpecialCar_CHECK.Stop();
  971.                     }
  972.                 }
  973.                 if (!(specialCars[2] == null))
  974.                 {
  975.                     if (Player.Character.CurrentVehicle == specialCars[2])
  976.                     {
  977.                         SpecialCar2.Start();
  978.                         SpecialCar_CHECK.Stop();
  979.                     }
  980.                 }
  981.             }
  982.         }
  983.         private void SpecialCar0_tick(object sender, EventArgs e)
  984.         {
  985.             if (Player.Character.isInVehicle())
  986.             {
  987.                 if (Player.Character.CurrentVehicle.Speed < 10F)
  988.                 {
  989.                     //GTA.Native.Function.Call("DRAW_LIGHT_WITH_RANGE",antenaAuta.Position.X, antenaAuta.Position.Y, antenaAuta.Position.Z, 255, 255, 255, 50F, 5F);
  990.                     GTA.Native.Function.Call("DRAW_CORONA",antenaAuta.Position.X, antenaAuta.Position.Y, antenaAuta.Position.Z+0.7F, 40.0F, 0, 0, 255, 255, 255);
  991.                     Vehicle[] carsAround = World.GetVehicles(Player.Character.Position, 15F);
  992.                     foreach (Vehicle car in carsAround)
  993.                     {
  994.                         if (car == Player.Character.CurrentVehicle)
  995.                         {
  996.                             continue;
  997.                         }
  998.                         if (car.EngineRunning == true)
  999.                         {
  1000.                             car.EngineHealth = 0;
  1001.                         }
  1002.                         Ped pedAuta = car.GetPedOnSeat(VehicleSeat.Driver);
  1003.                         if (!(pedAuta==null)) pedAuta.Task.FleeFromChar(Player.Character);
  1004.  
  1005.                     }
  1006.                 }
  1007.             }
  1008.             else
  1009.             {
  1010.                 SpecialCar_CHECK.Start();
  1011.                 SpecialCar0.Stop();
  1012.             }
  1013.         }
  1014.         private void SpecialCar1_tick(object sender, EventArgs e)
  1015.         {
  1016.             if (Player.Character.isInVehicle())
  1017.             {
  1018.                 if (Game.isGameKeyPressed(GameKey.SoundHorn))
  1019.                 {
  1020.                     pedsAround = World.GetPeds(Player.Character.Position, 24F);
  1021.                     foreach (Ped killFrezze in pedsAround)
  1022.                     {
  1023.                         if (Player.Character.CurrentVehicle.Speed > 10F)
  1024.                         {
  1025.                             return;
  1026.                         }
  1027.                         if (killFrezze == Player || killFrezze == startPed[0])
  1028.                         {
  1029.                             continue;
  1030.                         }
  1031.                         if (
  1032.                         killFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "front") ||
  1033.                         killFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "left") ||
  1034.                         killFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "right") ||
  1035.                         killFrezze.Animation.isPlaying(new AnimationSet("amb@flee"), "stand_into_ball"))
  1036.                         {
  1037.  
  1038.                             int myPtfx = GTA.Native.Function.Call<int>("START_PTFX", "dest_glass_clear_empty", killFrezze.Position.X, killFrezze.Position.Y, killFrezze.Position.Z, 0, 0, 0, 3.0);
  1039.                             soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  1040.                             GTA.Native.Function.Call("PLAY_SOUND_FROM_POSITION", soundID, "GLASS_CRACK_S1_C", killFrezze.Position.X, killFrezze.Position.Y, killFrezze.Position.Z);
  1041.                             if (killFrezze.isInVehicle())
  1042.                             {
  1043.                                 killFrezze.CurrentVehicle.NoLongerNeeded();
  1044.                                 killFrezze.Task.ClearAllImmediately();
  1045.                                 //GTA.Native.Function.Call("TASK_LEAVE_CAR_IMMEDIATELY",killFrezze, killFrezze.CurrentVehicle);
  1046.  
  1047.                             }
  1048.  
  1049.                             //Wait(1);
  1050.                             GTA.Native.Function.Call("STOP_PTFX", myPtfx);
  1051.                             GTA.Native.Function.Call("REMOVE_PTFX", myPtfx);
  1052.                             //GTA.Native.Function.Call("STOP_SOUND", soundID);
  1053.                             GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  1054.                             killFrezze.Position = new Vector3(killFrezze.Position.X, killFrezze.Position.Y, killFrezze.Position.Z - 100F);
  1055.  
  1056.                         }
  1057.                     }
  1058.                 }
  1059.                     pedsAround = World.GetPeds(Player.Character.Position, 14F);
  1060.                     int ABC = 0;
  1061.                     float QWE = 1.0F;
  1062.                     foreach (Ped startFrezze in pedsAround)
  1063.                     {
  1064.  
  1065.                         if (Player.Character.CurrentVehicle.Speed > 10F)
  1066.                         {
  1067.                             return;
  1068.                         }
  1069.                         if (startFrezze == Player || startFrezze == startPed[0] ||
  1070. //xxxxxxxxxxxxxxxxxxxx                            tytaj // aaaaaaaaaaaaaaaaaaaaaaaaa
  1071.                         startFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "front") ||
  1072.                         startFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "left") ||
  1073.                         startFrezze.Animation.isPlaying(new AnimationSet("reaction@male_flee"), "right") ||
  1074.                         startFrezze.Animation.isPlaying(new AnimationSet("amb@flee"), "stand_into_ball"))
  1075.                         {
  1076.                             continue;
  1077.                         }
  1078.                             int wynikLosowania = Losowanie(0, 4);
  1079.                             GTA.Native.Function.Call("UNLOCK_RAGDOLL", startFrezze, false);
  1080.                             startFrezze.FreezePosition = true;
  1081.                             if (wynikLosowania == 0)
  1082.                             {
  1083.                                 animacja = "front";
  1084.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  1085.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  1086.                                 if (startFrezze.isInVehicle())
  1087.                                 {
  1088.                                     if (startFrezze.Position.DistanceTo(Player.Character.Position) < 10F)
  1089.                                     {
  1090.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06 | AnimationFlags.Unknown09);
  1091.                                     startFrezze.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;
  1092.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 0);
  1093.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 1);
  1094.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 2);
  1095.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 3);
  1096.                                     }
  1097.                                 }
  1098.                                    
  1099.                                 else
  1100.                                 {
  1101.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  1102.                                 }
  1103.                             }
  1104.                             else if (wynikLosowania == 1)
  1105.                             {
  1106.                                 animacja = "left";
  1107.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  1108.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  1109.                                 if (startFrezze.isInVehicle())
  1110.                                 {
  1111.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06 | AnimationFlags.Unknown09);
  1112.                                     startFrezze.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;
  1113.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 0);
  1114.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 1);
  1115.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 2);
  1116.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 3);
  1117.                                 }
  1118.                                 else
  1119.                                 {
  1120.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  1121.                                 }
  1122.                             }
  1123.                             else if (wynikLosowania == 2)
  1124.                             {
  1125.                                 animacja = "right";
  1126.                                 grupa_anim = new AnimationSet("reaction@male_flee");
  1127.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  1128.                                 if (startFrezze.isInVehicle())
  1129.                                 {
  1130.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06 | AnimationFlags.Unknown09);
  1131.                                     startFrezze.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;
  1132.  
  1133.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 0);
  1134.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 1);
  1135.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 2);
  1136.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 3);
  1137.                                 }
  1138.                                 else
  1139.                                 {
  1140.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  1141.                                 }
  1142.                             }
  1143.                             else if (wynikLosowania == 3)
  1144.                             {
  1145.                                 animacja = "stand_into_ball";
  1146.                                 grupa_anim = new AnimationSet("amb@flee");
  1147.                                 GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  1148.                                 if (startFrezze.isInVehicle())
  1149.                                 {
  1150.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06 | AnimationFlags.Unknown09);
  1151.                                     startFrezze.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;
  1152.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 0);
  1153.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 1);
  1154.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 2);
  1155.                                     GTA.Native.Function.Call("SMASH_CAR_WINDOW", startFrezze.CurrentVehicle, 3);
  1156.                                 }
  1157.                                 else
  1158.                                 {
  1159.                                     startFrezze.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06);
  1160.                                 }
  1161.                             }
  1162.                     }
  1163.                     while (QWE > 0.01F)
  1164.                     {
  1165.                         foreach (Ped slowDownMan in pedsAround)
  1166.                         {
  1167.                             ABC = ABC + 1;
  1168.                             if (ABC == pedsAround.Length)
  1169.                             {
  1170.                                 QWE = QWE - 0.01F;
  1171.                                 ABC = 0;
  1172.                                 Game.WaitInCurrentScript(1);
  1173.                             }
  1174.                             if (slowDownMan == Player || slowDownMan == startPed[0])
  1175.                             {
  1176.                                 continue;
  1177.                             }
  1178.                             GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", slowDownMan, grupa_anim.Name, animacja, QWE);
  1179.  
  1180.                         }
  1181.                     }
  1182.                     ABC = 0;
  1183.                     foreach (Ped stopMan in pedsAround)
  1184.                     {
  1185.                         ABC = ABC + 1;
  1186.                         if (stopMan == Player || stopMan == startPed[0])
  1187.                         {
  1188.                             continue;
  1189.                         }
  1190.                         GTA.Native.Function.Call("SET_CHAR_ANIM_SPEED", stopMan, grupa_anim.Name, animacja, 0.00001F);
  1191.                         stopMan.Die();
  1192.                         stopMan.NoLongerNeeded();
  1193.                     }
  1194.                     QWE = 1.0F;
  1195.             }
  1196.             else
  1197.             {
  1198.                 SpecialCar_CHECK.Start();
  1199.                 SpecialCar1.Stop();
  1200.                 //Game.Console.Print("CHECK START, one spec cial STOP!");
  1201.                 // tick check auta ON
  1202.             }
  1203.         }
  1204.         private void SpecialCar2_tick(object sender, EventArgs e)
  1205.         {
  1206.             if (Player.Character.isInVehicle())
  1207.             {
  1208.                 if (Player.Character.CurrentVehicle.EngineRunning == true)
  1209.                 {
  1210.                     Vector3 graczWHeli = Player.Character.GetOffsetPosition(new Vector3(0, 0, -3F));
  1211.                     Ped[] ludzieHeli = World.GetPeds(graczWHeli, 10F);
  1212.                     Vehicle[] pojazdyHeli = World.GetVehicles(graczWHeli, 10F);
  1213.                     GTA.Object[] obiektyHeli = World.GetAllObjects();
  1214.  
  1215.                     foreach (Ped czlekH in ludzieHeli)
  1216.                     {
  1217.                         if (!Game.Exists(czlekH) || czlekH == Player || czlekH.isInVehicle())
  1218.                             continue;
  1219.                         czlekH.Euphoria.BodyBalance.Start(5000);
  1220.                         czlekH.ApplyForce(Vector3.Normalize(czlekH.Position - Player.Character.Position) * (czlekH.Position.DistanceTo(Player.Character.Position) / 2));
  1221.                     }
  1222.                     foreach (Vehicle carH in pojazdyHeli)
  1223.                     {
  1224.                         if (!Game.Exists(carH) || carH == Player.Character.CurrentVehicle)
  1225.                             continue;
  1226.                         carH.ApplyForce(Vector3.Normalize(carH.Position - Player.Character.Position) * (carH.Position.DistanceTo(Player.Character.Position) / 2));
  1227.                     }
  1228.                     foreach (GTA.Object obiektH in obiektyHeli)
  1229.                     {
  1230.                         if (!Game.Exists(obiektH) || obiektH.Position.DistanceTo(graczWHeli) > 10F)
  1231.                             continue;
  1232.                         if (obiektH.isAttachedSomewhere)
  1233.                         {
  1234.                             //GTA.Native.Function.Call("DETACH_OBJECT", obiektH, true);
  1235.                             obiektH.Detach();
  1236.  
  1237.  
  1238.                         }
  1239.                         GTA.Native.Function.Call("SET_OBJECT_DYNAMIC", obiektH, true);
  1240.                         obiektH.ApplyForce(Vector3.Normalize(obiektH.Position - Player.Character.Position) * (obiektH.Position.DistanceTo(Player.Character.Position)));
  1241.                     }
  1242.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", graczWHeli.X, graczWHeli.Y, graczWHeli.Z, 10F);
  1243.                 }
  1244.             }
  1245.             else
  1246.             {
  1247.                 SpecialCar_CHECK.Start();
  1248.                 SpecialCar2.Stop();
  1249.             }
  1250.         }
  1251.         private void TimerChallenge(object sender, EventArgs e)
  1252.         {
  1253.             timerAll = timerAll + 1;
  1254.             if (challengeNr1_second.isRunning)
  1255.             {
  1256.                 if ((timerAll % 2) == 0)
  1257.                 {
  1258.                     GTA.Native.Function.Call("FIRE_SINGLE_BULLET", -357.69F, Player.Character.Position.Y - 30F, 22.96F, getX + 0.3F, Player.Character.Position.Y, Player.Character.Position.Z + 0.52F, 200);
  1259.                 }
  1260.                 getX = Player.Character.Position.X;  
  1261.             }
  1262.             if (challengeNr3.isRunning)
  1263.             {
  1264.                 if(gasnicaPojemnosc<250) gasnicaPojemnosc = (byte)(gasnicaPojemnosc + 5);
  1265.             }
  1266.             if (challengeRun)
  1267.             {
  1268.                 timerChallenge = timerChallenge - 1;
  1269.                 if (timerChallenge < 10)
  1270.                 {
  1271.                     GTA.Native.Function.Call("PLAY_SOUND_FROM_POSITION", soundID, "F5_TRUCK_ARSON_BOMB_BLEEP", Player.Character.Position.X, Player.Character.Position.Y, Player.Character.Position.Z);
  1272.                     if (timerChallenge <= 0)
  1273.                     {
  1274.                         if (challengeNr3.isRunning) Challenge3_clear();
  1275.                         if (!(goodCar==null))
  1276.                         {
  1277.                             if (goodCar.Exists())
  1278.                             {
  1279.                                 goodCar.Explode();
  1280.                             }
  1281.                         }
  1282.                         GTA.Native.Function.Call("STOP_SOUND", soundID);
  1283.                         GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  1284.                         ClearAll();
  1285.                     }
  1286.                 }
  1287.             }
  1288.         }
  1289.         private void DrawingThings(object sender, GraphicsEventArgs abc)
  1290.         {
  1291.             abc.Graphics.Scaling = FontScaling.FontSize;
  1292.             if (challengeRun == true)
  1293.             {
  1294.                 abc.Graphics.DrawText("TIME:"+timerChallenge, new RectangleF(10, 1,10, 2), TextAlignment.Center, Color.Black, screenFont);
  1295.             }
  1296.             if (endChallenge == true)
  1297.             {
  1298.                 if (makeScreen == true)
  1299.                 {
  1300.                     abc.Graphics.DrawRectangle(10F, 0F,10F, 0.2F, Color.Gold);
  1301.                     abc.Graphics.DrawText(DateTime.Now.ToString(), new RectangleF(0.5F, 19F, 5F, 2F), TextAlignment.Left, Color.WhiteSmoke, new GTA.Font("Times New Roman", 0.5F, FontScaling.FontSize));
  1302.                     abc.Graphics.DrawText("Rinepim", new RectangleF(10F, 19F, 5F, 2F), TextAlignment.Center, Color.FromArgb(255,Color.DarkKhaki), new GTA.Font("Times New Roman", 0.5F, FontScaling.FontSize,true,false));
  1303.                 }
  1304.                 abc.Graphics.DrawRectangle(new RectangleF(5, 0, 10, 20), Color.FromArgb(smoothEnd, Color.Black));
  1305.                
  1306.                 //abc.Graphics.DrawText("Rinepim\n Challenge nr 1", new RectangleF(5, 1, 10, 4), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GreenYellow), screenFont);
  1307.                 abc.Graphics.DrawText("Rinepim", new RectangleF(5, 1, 10, 4), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GreenYellow), screenFont);
  1308.                 if (challengeNr1_second.isRunning) abc.Graphics.DrawText("\n Challenge nr 1", new RectangleF(5, 1, 10, 4), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GreenYellow), screenFont);
  1309.                 if (challengeNr2.isRunning) abc.Graphics.DrawText("\n Challenge nr 2", new RectangleF(5, 1, 10, 4), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GreenYellow), screenFont);
  1310.                 if (challengeNr3.isRunning) abc.Graphics.DrawText("\n Challenge nr 3", new RectangleF(5, 1, 10, 4), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GreenYellow), screenFont);
  1311.  
  1312.  
  1313.                 abc.Graphics.DrawText("Time challenge: "+timerAll+"sec", new RectangleF(5, 5, 10, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1314.  
  1315.                 if (challengeNr1_second.isRunning == true)
  1316.                 {
  1317.                     abc.Graphics.DrawRectangle(new RectangleF(13.2F, 7.0F, 0.5F, 0.8F), Color.FromArgb(smoothEnd + 50, Color.DarkGreen));
  1318.                     abc.Graphics.DrawRectangle(new RectangleF(13.2F, 9.0F, 0.5F, 0.8F), Color.FromArgb(smoothEnd + 50, Color.DarkGreen));
  1319.                     abc.Graphics.DrawText("Clear loop", new RectangleF(5, 7, 10, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1320.                     if (zadanieCheck[0] == true)
  1321.                     {
  1322.                         abc.Graphics.DrawText(((char)0x221A).ToString(), new RectangleF(13, 7, 1, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1323.                     }
  1324.                     abc.Graphics.DrawText("Clear slalom", new RectangleF(5, 9, 10, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1325.                     if (zadanieCheck[1] == true)
  1326.                     {
  1327.                         abc.Graphics.DrawText(((char)0x221A).ToString(), new RectangleF(13, 9, 1, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1328.                     }
  1329.                 }
  1330.                 if (challengeNr2.isRunning == true)
  1331.                 {
  1332.                     abc.Graphics.DrawRectangle(new RectangleF(13.2F, 7.0F, 0.5F, 0.8F), Color.FromArgb(smoothEnd + 50, Color.DarkGreen));
  1333.                     abc.Graphics.DrawRectangle(new RectangleF(13.2F, 9.0F, 0.5F, 0.8F), Color.FromArgb(smoothEnd + 50, Color.DarkGreen));
  1334.                     abc.Graphics.DrawText("Nade on roof", new RectangleF(5, 7, 10, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1335.                     if (zadanieCheck[2] == true)
  1336.                     {
  1337.                         abc.Graphics.DrawText(((char)0x221A).ToString(), new RectangleF(13, 7, 1, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1338.                     }
  1339.                     abc.Graphics.DrawText("All time in vehicle", new RectangleF(5, 9, 10, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1340.                     if (zadanieCheck[3] == true)
  1341.                     {
  1342.                         abc.Graphics.DrawText(((char)0x221A).ToString(), new RectangleF(13, 9, 1, 1), TextAlignment.Center, Color.FromArgb(smoothEnd * 2 + 5, Color.GhostWhite), resultFont);
  1343.                     }
  1344.                 }
  1345.             }
  1346.         }
  1347.         private void Peds_In_City(object sender, EventArgs e)
  1348.         {
  1349.            
  1350.             if (Player.Character.Position.DistanceTo(miejscaStartPed[0]) <= 1.4F && Player.Character.isInVehicle()==false)
  1351.             {
  1352.                 if (Player.WantedLevel == 0)
  1353.                 {
  1354.                     startPed[0].Task.TurnTo(Player.Character);
  1355.                     if (Game.isGameKeyPressed(GameKey.Action)) Prepare_Challenge1();
  1356.                     else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Challenge nr.1 - press " + GameKey.Action.ToString() + " to start.", 15, 1);
  1357.                 }
  1358.                 else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Lose cops!", 15, 1);
  1359.             }
  1360.             if (Player.Character.Position.DistanceTo(miejscaStartPed[1]) <= 2.4F)
  1361.             {
  1362.                  if (Player.WantedLevel == 0)
  1363.                 {
  1364.                     startPed[1].Task.TurnTo(Player.Character);
  1365.                     if (Game.isGameKeyPressed(GameKey.Action)) Prepare_Challenge2();
  1366.                     else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Challenge nr.2 - press " + GameKey.Action.ToString() + " to start.", 15, 1);
  1367.                 }
  1368.                 else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Lose cops!", 15, 1);
  1369.             }
  1370.             if (Player.Character.Position.DistanceTo(miejscaStartPed[2]) <= 1.4F && Player.Character.isInVehicle() == false)
  1371.             {
  1372.                 if (Player.WantedLevel == 0)
  1373.                 {
  1374.                     startPed[2].Task.TurnTo(Player.Character);
  1375.                     if (Game.isGameKeyPressed(GameKey.Action)) Prepare_Challenge3();
  1376.                     else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Challenge nr.3 - press " + GameKey.Action.ToString() + " to start.", 15, 1);
  1377.                 }
  1378.                 else GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Lose cops!", 15, 1);
  1379.             }
  1380.         }
  1381.         private void Prepare_Challenge1()
  1382.         {
  1383.  
  1384.             GTA.Native.Function.Call("HIDE_CHAR_WEAPON_FOR_SCRIPTED_CUTSCENE", Player.Character, true);
  1385.             startPed[0].Task.ClearSecondary();
  1386.             startPed[0].Task.ClearAllImmediately();
  1387.             //drawRedCircle.Visible = false;
  1388.             Vector3 spawnpoint = new Vector3(-390.66F, 1180.09F, 14.18F);
  1389.             GTA.Native.Function.Call("SET_MISSION_FLAG", true);
  1390.             GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1391.             GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1392.             GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1393.             GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1394.             GTA.Native.Function.Call("REQUEST_MODEL", 0x3A196CEA);
  1395.             goodCar = World.CreateVehicle(0x3A196CEA, spawnpoint);
  1396.             goodCar.Heading = 90F;
  1397.             goodCar.Color = ColorIndex.DarkGreenPoly;
  1398.             MissionBlip = GTA.Blip.AddBlip(goodCar);
  1399.             MissionBlip.Icon = BlipIcon.Misc_Destination2;
  1400.             MissionBlip.Scale = 1.0F;
  1401.             MissionBlip.ShowOnlyWhenNear = false;
  1402.             MissionBlip.Display = BlipDisplay.ArrowAndMap;
  1403.             MissionBlip.Name = "Joker Challenge Car";
  1404.             //cutsceneNr1.Start();
  1405.             Prepare1_Challenge1();
  1406.         }
  1407.         private void Prepare1_Challenge1()
  1408.         {
  1409.                         prepareRing.Stop();
  1410.                         SpecialCar_CHECK.Stop();
  1411.                         Player.CanControlCharacter = true;
  1412.                         GTA.Native.Function.Call("SETTIMERC", 0);
  1413.                         do{
  1414.                         GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Get into car to start challenge!", 100, 1);
  1415.                         Game.WaitInCurrentScript(50);
  1416.                         }while(GTA.Native.Function.Call<int>("TIMERC")<14000 && !(Player.Character.isInVehicle(goodCar)));
  1417.                         PlayerIsAlive();
  1418.                         if (Player.Character.isInVehicle(goodCar))
  1419.                         {
  1420.                             GTA.Native.Function.Call("REQUEST_MODEL", 0x4071AA4A);
  1421.                             arrayArrow[0] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-422.95F, 1163.0F, 13.08F));
  1422.                             arrayArrow[0].Rotation = new Vector3(1.5F, 90F, -90F);
  1423.                             arrayArrow[1] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-422.95F, 1171.0F, 13.08F));
  1424.                             arrayArrow[1].Rotation = new Vector3(1.5F, 90F, -90F);
  1425.                             arrayArrow[2] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-422.95F, 1179.0F, 13.08F));
  1426.                             arrayArrow[2].Rotation = new Vector3(1.5F, 90F, -90F);
  1427.                             arrayArrow[0].Collision = false;
  1428.                             arrayArrow[1].Collision = false;
  1429.                             arrayArrow[2].Collision = false;
  1430.                             MissionBlip = GTA.Blip.AddBlip(new Vector3(-454.53F, 945.15F, 9.00F));
  1431.                             MissionBlip.Scale = 2.0F;
  1432.                             MissionBlip.RouteActive = true;
  1433.                             goodCar.EngineRunning = true;
  1434.                             Zdarzenie(zdarzenieNr = 1);
  1435.                             cutSceneCam = new Camera();
  1436.                             cutSceneCam.Position = Player.Character.GetOffsetPosition(new Vector3(6, -5, 1));
  1437.                             cutSceneCam.FOV = 57;
  1438.                             cutSceneCam.Heading = 130F;
  1439.                             cutSceneCam.Activate();
  1440.                             goodCar.DoorLock = DoorLock.ImpossibleToOpen;
  1441.                             Player.CanControlCharacter = false;
  1442.                             GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "You have only 45 sec to pass track. If time shows 0, BOOM!", 5000, 1);
  1443.                             Game.WaitInCurrentScript(2000);
  1444.                             goodCar.PetrolTankHealth = 1000;
  1445.                             goodCar.EngineHealth = 1000;
  1446.                             goodCar.Health = 1000;
  1447.                             goodCar.CloseAllDoors();
  1448.                             Game.WaitInCurrentScript(3000);
  1449.                             cutSceneCam.Deactivate();
  1450.                            
  1451.                             Player.CanControlCharacter = true;
  1452.                             Player.Character.WillFlyThroughWindscreen = false;
  1453.                             challengeRun = true;
  1454.                             soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  1455.                             timerChallenge=45;
  1456.                             timerDraw.Start();
  1457.                          }
  1458.                         else
  1459.                         {
  1460.                             goodCar.Explode();
  1461.                             ClearAll();
  1462.                         }
  1463.                         //cutsceneNr1.Stop();
  1464.         }
  1465.         private void FirstMission_Challenge1(object sender, EventArgs e)
  1466.         {
  1467.            
  1468.             PlayerIsAlive();
  1469.             if (zdarzenieNr == 1)
  1470.             {
  1471.                 arrayArrow[0].Position = arrayArrow[0].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1472.                 arrayArrow[1].Position = arrayArrow[1].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1473.                 arrayArrow[2].Position = arrayArrow[2].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1474.                 if (arrayArrow[0].Position.Y <= 1155.0F)
  1475.                 {
  1476.                     arrayArrow[0].Position = new Vector3(-422.95F, 1179.0F, 14.58F);
  1477.                 }
  1478.                 if (arrayArrow[1].Position.Y <= 1155.0F)
  1479.                 {
  1480.                     arrayArrow[1].Position = new Vector3(-422.95F, 1179.0F, 14.58F);
  1481.                 }
  1482.                 if (arrayArrow[2].Position.Y <= 1155.0F)
  1483.                 {
  1484.                     arrayArrow[2].Position = new Vector3(-422.95F, 1179.0F, 14.58F);
  1485.                 }
  1486.                 if (goodCar.Position.DistanceTo(new Vector3(-435.21F, 1101.40F, 10F)) < 6F)
  1487.                 {
  1488.                     Zdarzenie(zdarzenieNr = 2);
  1489.                 }
  1490.             }
  1491.             if (zdarzenieNr == 2)
  1492.             {
  1493.                 arrayArrow[0].Position = arrayArrow[0].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1494.                 arrayArrow[1].Position = arrayArrow[1].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1495.                 arrayArrow[2].Position = arrayArrow[2].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1496.                 if (arrayArrow[0].Position.X >= -447.0F)
  1497.                 {
  1498.                     arrayArrow[0].Position = new Vector3(-462.0F, 925.64F, 11.0F);
  1499.                 }
  1500.                 if (arrayArrow[1].Position.X >= -447.0F)
  1501.                 {
  1502.                     arrayArrow[1].Position = new Vector3(-462.0F, 925.64F, 11.0F);
  1503.                 }
  1504.                 if (arrayArrow[2].Position.X >= -447.0F)
  1505.                 {
  1506.                     arrayArrow[2].Position = new Vector3(-462.0F, 925.64F, 11.0F);
  1507.                 }
  1508.                 if (goodCar.Position.DistanceTo(new Vector3(-454.53F, 945.15F, 9.00F)) < 6F)
  1509.                 {
  1510.                     Zdarzenie(zdarzenieNr = 3); // każe rysować nowy numer zdrzenia + zmienia numer
  1511.                 }
  1512.             }
  1513.             if (zdarzenieNr == 3)
  1514.             {
  1515.                 arrayArrow[0].Position = arrayArrow[0].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1516.                 arrayArrow[1].Position = arrayArrow[1].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1517.                 arrayArrow[2].Position = arrayArrow[2].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1518.                 if (arrayArrow[0].Position.Y >= 940.00F)
  1519.                 {
  1520.                     arrayArrow[0].Position = new Vector3(-302.0F, 928.00F, 15.79F);
  1521.                 }
  1522.                 if (arrayArrow[1].Position.Y >= 940.00F)
  1523.                 {
  1524.                     arrayArrow[1].Position = new Vector3(-302.0F, 928.00F, 15.79F);
  1525.                 }
  1526.                 if (arrayArrow[2].Position.Y >= 940.00F)
  1527.                 {
  1528.                     arrayArrow[2].Position = new Vector3(-302.0F, 928.00F, 15.79F);
  1529.                 }
  1530.                 if (goodCar.Position.DistanceTo(new Vector3(-316.44F, 938.43F, 13.00F)) < 6F)
  1531.                 {
  1532.                     Zdarzenie(zdarzenieNr = 4);
  1533.                 }
  1534.             }
  1535.             if (zdarzenieNr == 4)
  1536.             {
  1537.                
  1538.                 if (goodCar.Position.DistanceTo(new Vector3(-306.11F, 1039.86F, 9.00F)) < 6F)
  1539.                 {
  1540.                     Zdarzenie(zdarzenieNr = 5);
  1541.                 }
  1542.             }
  1543.             if (zdarzenieNr == 5)
  1544.             {
  1545.                 arrayArrow[0].Position = arrayArrow[0].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1546.                 arrayArrow[1].Position = arrayArrow[1].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1547.                 arrayArrow[2].Position = arrayArrow[2].GetOffsetPosition(new Vector3(0, 0, 0.1F));
  1548.                 if (arrayArrow[0].Position.Y >= 1130.29)
  1549.                 {
  1550.                     arrayArrow[0].Position = new Vector3(-314.34F,1121.29F,14.41F);
  1551.                 }
  1552.                 if (arrayArrow[1].Position.Y >= 1130.29)
  1553.                 {
  1554.                     arrayArrow[1].Position = new Vector3(-314.34F, 1121.29F, 14.41F);
  1555.                 }
  1556.                 if (arrayArrow[2].Position.Y >= 1130.29)
  1557.                 {
  1558.                     arrayArrow[2].Position = new Vector3(-314.34F, 1121.29F, 14.41F);
  1559.                 }
  1560.                 if (goodCar.Position.DistanceTo(new Vector3(-376.95F, 1181.22F, 14.00F)) < 6F)
  1561.                 {
  1562.                     drawRedCircle.Visible = false;
  1563.                     challengeRun = false;
  1564.                     MissionBlip.Delete();
  1565.                     if (goodCar.PetrolTankHealth == 1000 && goodCar.Health == 1000 && goodCar.EngineHealth == 1000)
  1566.                     {
  1567.                         zadanieCheck[0] = true;
  1568.                     }
  1569.                     challengeNr1_first.Stop();
  1570.                     Prepare2_Challenge1();
  1571.                 }
  1572.             }
  1573.         }
  1574.         private void Zdarzenie(int NumerZdarzenia)
  1575.         {
  1576.             if (NumerZdarzenia == 1)
  1577.             {
  1578.                 drawRedCircle.Position = new Vector3(-435.21F, 1101.40F, 9.0F);
  1579.                 drawRedCircle.Diameter = 10F; // średnica koła
  1580.                 drawRedCircle.Visible = true;
  1581.                 MissionBlip.Delete();
  1582.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-435.21F, 1101.40F, 9.0F));
  1583.                 //MissionBlip = GTA.Blip.AddBlipContact(Player.Character.Position);
  1584.                 MissionBlip.Scale = 2.0F;
  1585.                 challengeNr1_first.Start();
  1586.             }
  1587.             if (NumerZdarzenia == 2)
  1588.             {
  1589.                 drawRedCircle.Position = new Vector3(-454.53F, 945.15F, 9.00F);
  1590.                 MissionBlip.Delete();
  1591.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-454.53F, 945.15F, 9.00F));
  1592.                 MissionBlip.Scale = 2.0F;
  1593.                 MissionBlip.RouteActive = true;
  1594.                 arrayArrow[0].Delete();
  1595.                 arrayArrow[1].Delete();
  1596.                 arrayArrow[2].Delete();
  1597.                 arrayArrow[0] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-452.0F, 925.64F, 9.58F));
  1598.                 arrayArrow[0].Rotation = new Vector3(1.5F, 90F, 0F);
  1599.                 arrayArrow[0].Collision = false;
  1600.                 arrayArrow[1] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-457.0F, 925.64F, 9.58F));
  1601.                 arrayArrow[1].Rotation = new Vector3(1.5F, 90F, 0F);
  1602.                 arrayArrow[1].Collision = false;
  1603.                 arrayArrow[2] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-462.0F, 925.64F, 9.58F));
  1604.                 arrayArrow[2].Rotation = new Vector3(1.5F, 90F, 0F);
  1605.                 arrayArrow[2].Collision = false;
  1606.                 GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", -361.08F, 845.62F, 14.36F, 15F);
  1607.                 GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", -361.08F, 845.62F, 14.36F, 15F);
  1608.                 GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", -361.08F, 845.62F, 14.36F, 15F);
  1609.                 GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -361.08F, 845.62F, 14.36F, 15F);
  1610.                 crashFlat = World.CreateVehicle(0x50B0215A, new Vector3(-361.08F, 845.62F, 14.36F));//)
  1611.                 goodGuy = World.CreatePed(0xB2F9C1A1, new Vector3(-361.08F, 845.62F, 19.36F)); //new Vector3(-361.08F,845.62F,17.36F)
  1612.                 goodGuy.WarpIntoVehicle(crashFlat, VehicleSeat.Driver);
  1613.                 crashFlat.Heading = 0;
  1614.                 crashFlat.EngineRunning = true;
  1615.                 crashFlat.Dirtyness = 3;
  1616.                 crashFlat.Speed = 30.0F;
  1617.                 GTA.Native.Function.Call("TASK_CAR_TEMP_ACTION", goodGuy, crashFlat, 9, 15000);
  1618.                 GTA.Native.Function.Call("SET_DRIVE_TASK_CRUISE_SPEED", goodGuy, 40.0F);
  1619.                 goodGuy.Task.AlwaysKeepTask = true;
  1620.             }
  1621.             if (NumerZdarzenia == 3)
  1622.             {
  1623.                 drawRedCircle.Position = new Vector3(-316.44F, 938.43F, 13.00F);
  1624.                 MissionBlip.Delete();
  1625.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-316.44F, 938.43F, 13.00F));
  1626.                 MissionBlip.Scale = 2.0F;
  1627.                 MissionBlip.RouteActive = true;
  1628.                 if (goodGuy.Exists())
  1629.                 {
  1630.                     goodGuy.NoLongerNeeded();
  1631.                 }
  1632.                 if (!(crashFlat == null))
  1633.                 {
  1634.                     if (crashFlat.Exists())
  1635.                     {
  1636.                         crashFlat.NoLongerNeeded();
  1637.                     }
  1638.                 }
  1639.                 arrayArrow[0].Delete();
  1640.                 arrayArrow[1].Delete();
  1641.                 arrayArrow[2].Delete();
  1642.                 arrayArrow[0] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-302.0F, 936.0F, 15.09F));
  1643.                 arrayArrow[0].Rotation = new Vector3(1.5F, 90F, 90F);
  1644.                 arrayArrow[0].Collision = false;
  1645.                 arrayArrow[1] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-302.0F, 932F, 15.09F));
  1646.                 arrayArrow[1].Rotation = new Vector3(1.5F, 90F, 90F);
  1647.                 arrayArrow[1].Collision = false;
  1648.                 arrayArrow[2] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-302.0F, 928F, 15.09F));
  1649.                 arrayArrow[2].Rotation = new Vector3(1.5F, 90F, 90F);
  1650.                 arrayArrow[2].Collision = false;
  1651.             }
  1652.             if (NumerZdarzenia == 4)
  1653.             {
  1654.                 arrayArrow[0].Delete();
  1655.                 arrayArrow[1].Delete();
  1656.                 arrayArrow[2].Delete();
  1657.                 drawRedCircle.Position = new Vector3(-306.11F, 1039.86F, 9.00F);
  1658.                 MissionBlip.Delete();
  1659.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-306.11F, 1039.86F, 9.00F));
  1660.                 MissionBlip.Scale = 2.0F;
  1661.             }
  1662.             if (NumerZdarzenia == 5)
  1663.             {
  1664.                 drawRedCircle.Position = new Vector3(-376.95F, 1181.22F, 14.00F);
  1665.                 MissionBlip.Delete();
  1666.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-376.95F, 1181.22F, 14.00F));
  1667.                 MissionBlip.Scale = 2.0F;
  1668.                 arrayArrow[0] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-320.34F, 1127.29F, 12.71F));
  1669.                 arrayArrow[0].Rotation = new Vector3(1.5F, 90F, 145F);
  1670.                 arrayArrow[0].Collision = false;
  1671.                 arrayArrow[1] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-317.34F, 1124.29F, 12.71F));
  1672.                 arrayArrow[1].Rotation = new Vector3(1.5F, 90F, 145F);
  1673.                 arrayArrow[1].Collision = false;
  1674.                 arrayArrow[2] = World.CreateObject(new Model(0x4071AA4A), new Vector3(-314.34F, 1121.29F, 12.71F));
  1675.                 arrayArrow[2].Rotation = new Vector3(1.5F, 90F, 145F);
  1676.                 arrayArrow[2].Collision = false;
  1677.             }
  1678.             if (NumerZdarzenia == 6)
  1679.             {
  1680.                
  1681.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-360.00F, 621F, 14.77F));
  1682.                 MissionBlip.Icon = BlipIcon.Misc_Objective5;
  1683.                 MissionBlip.Scale = 1.0F;
  1684.                 MissionBlip.ShowOnlyWhenNear = false;
  1685.                 MissionBlip.Display = BlipDisplay.MapOnly;
  1686.                 MissionBlip.Name = "First icecone nearly";
  1687.                 lodzikCh2 = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-340.04F, 640.93F, 16.48F));
  1688.                 lodzikCh2.FreezePosition = true;
  1689.                 zadanieCheck[3] = true;
  1690.             }
  1691.            
  1692.             if (NumerZdarzenia == 7)
  1693.             {
  1694.                
  1695.                 MissionBlip.Delete();
  1696.                 timerChallenge = timerChallenge + 30;
  1697.                 // DRUGI:
  1698.                 // trzeci GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-70.44F, 1241.32F, 20.97F));
  1699.                 // czwarty LAST :GTA.Object lodzik = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-503.9102F, 1467.0360F, 21.660F));
  1700.                 // zmiana blipa + spawnu obiektu
  1701.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-49.4134F, 621.1909F, 14.7134F));
  1702.                 MissionBlip.Icon = BlipIcon.Misc_Objective5;
  1703.                 MissionBlip.Scale = 1.0F;
  1704.                 MissionBlip.ShowOnlyWhenNear = false;
  1705.                 MissionBlip.Display = BlipDisplay.MapOnly;
  1706.                 MissionBlip.Name = "First icecone nearly";
  1707.                 //lodzikCh2 = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-340.04F, 640.93F, 16.48F));
  1708.                 lodzikCh2 = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-35.58F, 606.64F, 14.46F));
  1709.                 lodzikCh2.FreezePosition = true;
  1710.             }
  1711.             if (NumerZdarzenia == 8)
  1712.             {
  1713.  
  1714.                 MissionBlip.Delete();
  1715.                 timerChallenge = timerChallenge + 30;
  1716.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-49.6953F, 1252.4010F, 20.0150F));
  1717.                 MissionBlip.Icon = BlipIcon.Misc_Objective5;
  1718.                 MissionBlip.Scale = 1.0F;
  1719.                 MissionBlip.ShowOnlyWhenNear = false;
  1720.                 MissionBlip.Display = BlipDisplay.MapOnly;
  1721.                 MissionBlip.Name = "First icecone nearly";
  1722.                 lodzikCh2 = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-70.44F, 1241.32F, 20.97F));
  1723.                 lodzikCh2.FreezePosition = true;
  1724.             }
  1725.             if (NumerZdarzenia == 9)
  1726.             {
  1727.  
  1728.                 MissionBlip.Delete();
  1729.                 timerChallenge = timerChallenge + 30;
  1730.                 MissionBlip = GTA.Blip.AddBlip(new Vector3(-501.2669F, 1485.2340F, 18.2470F));
  1731.                 MissionBlip.Icon = BlipIcon.Misc_Objective5;
  1732.                 MissionBlip.Scale = 1.0F;
  1733.                 MissionBlip.ShowOnlyWhenNear = false;
  1734.                 MissionBlip.Display = BlipDisplay.MapOnly;
  1735.                 MissionBlip.Name = "First icecone nearly";
  1736.                 lodzikCh2 = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-503.9102F, 1467.0360F, 21.660F));
  1737.                 lodzikCh2.FreezePosition = true;
  1738.             }
  1739.             if (NumerZdarzenia == 10)
  1740.             {
  1741.                 if (Player.Character.Weapons.Current == Weapon.Thrown_Grenade) zadanieCheck[2] = true;
  1742.                 else zadanieCheck[2] = false;
  1743.                
  1744.                
  1745.                 challengeRun=false;
  1746.                 endChallenge = true;
  1747.                 timerDraw.Stop();
  1748.                 GTA.Native.Function.Call("TRIGGER_MISSION_COMPLETE_AUDIO", 1);
  1749.                 endOfAll(1);
  1750.                     // tutaj koniec, zatrzymanie timera, clearAll
  1751.                
  1752.                
  1753.             }
  1754.         }
  1755.         private void Prepare2_Challenge1()
  1756.         {
  1757.             cutSceneCam = new Camera();
  1758.             cutSceneCam.Position = new Vector3(-364.00F,Player.Character.Position.Y+10,Player.Character.Position.Z+5);
  1759.             cutSceneCam.FOV = 45F;
  1760.             cutSceneCam.Heading = 180F;
  1761.             Player.CanControlCharacter = false;
  1762.             cutSceneCam.Activate();
  1763.             arrayArrow[0].NoLongerNeeded();
  1764.             arrayArrow[0].Delete();
  1765.             arrayArrow[1].NoLongerNeeded();
  1766.             arrayArrow[1].Delete();
  1767.             arrayArrow[2].NoLongerNeeded();
  1768.             arrayArrow[2].Delete();
  1769.             GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Now, go along this street and miss sniper shoots. Do not leave this way if You want life.", 10000, 1);
  1770.             drawRedCircle.Visible = true;
  1771.             drawRedCircle.Position = new Vector3(-362.01F, 22.96F, 14.00F);
  1772.             MissionBlip = GTA.Blip.AddBlip(new Vector3(-362.01F, 22.96F, 14.00F));
  1773.             MissionBlip.RouteActive = true;
  1774.             Game.WaitInCurrentScript(5000);
  1775.             PlayerIsAlive();
  1776.             cutSceneCam.Position = Player.Character.GetOffsetPosition(new Vector3(-1.5F,3F,0F));
  1777.             cutSceneCam.Heading = (Player.Character.Heading-150);
  1778.             cutSceneCam.FOV = 40F;
  1779.             Game.WaitInCurrentScript(500);
  1780.             goodCar.BurstTire(VehicleWheel.FrontLeft);
  1781.             soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  1782.             GTA.Native.Function.Call("PLAY_SOUND_FROM_VEHICLE", soundID, "FLAT_TYRE_BLOWOUT", goodCar);
  1783.             goodCar.BurstTire(VehicleWheel.FrontRight);
  1784.             goodCar.BurstTire(VehicleWheel.RearLeft);
  1785.             goodCar.BurstTire(VehicleWheel.RearRight);
  1786.             Game.WaitInCurrentScript(3500);
  1787.             GTA.Native.Function.Call("STOP_SOUND", soundID);
  1788.             GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  1789.             cutSceneCam.Deactivate();
  1790.            
  1791.             Player.CanControlCharacter = true;
  1792.             challengeNr1_second.Start();
  1793.             daneAuta[0] = goodCar.PetrolTankHealth;
  1794.             daneAuta[1] = goodCar.Health;
  1795.             daneAuta[2] = goodCar.EngineHealth;
  1796.  
  1797.            
  1798.             Game.WaitInCurrentScript(3000);
  1799.             timerAll = timerAll + 12;
  1800.         }
  1801.         #region Sniper Alley
  1802.         private void SecondMission_Challenge1(object sender, EventArgs e)
  1803.         {
  1804.             if (!(goodCar.isAlive))
  1805.             {
  1806.                 ClearAll();
  1807.             }
  1808.             PlayerIsAlive();
  1809.             if (!(Player.Character.isInArea(corner1_challenge1, corner2_challenge1, true)))
  1810.             {
  1811.                 goodCar.Explode();
  1812.                 ClearAll();
  1813.             }
  1814.             if (goodCar.Position.DistanceTo(new Vector3(-362.01F, 22.96F, 14.00F)) < 6.0F)
  1815.             {
  1816.                 endChallenge = true;
  1817.                 goodCar.DoorLock = DoorLock.None;
  1818.                 if ((goodCar.PetrolTankHealth == daneAuta[0]) && (goodCar.Health == daneAuta[1]) && (goodCar.EngineHealth == daneAuta[2]))
  1819.                 {
  1820.                     zadanieCheck[1] = true;
  1821.                 }
  1822.                 drawRedCircle.Visible = false;
  1823.                 GTA.Native.Function.Call("TRIGGER_MISSION_COMPLETE_AUDIO", 1);
  1824.                 endOfAll(0);
  1825.             }
  1826.         }
  1827.         #endregion
  1828.         public void Prepare_Challenge2()
  1829.         {
  1830.             prepareRing.Stop();
  1831.             SpecialCar_CHECK.Stop();
  1832.             GTA.Native.Function.Call("HIDE_CHAR_WEAPON_FOR_SCRIPTED_CUTSCENE", Player.Character, true);
  1833.             startPed[1].Task.ClearSecondary();
  1834.             startPed[1].Task.ClearAllImmediately();
  1835.             Player.CanControlCharacter = false;
  1836.             //drawRedCircle.Visible = false;
  1837.             //Vector3 spawnpoint = new Vector3(-390.66F, 1180.09F, 14.18F);
  1838.             GTA.Native.Function.Call("SET_MISSION_FLAG", true);
  1839.             GTA.Object lodzikCutscene = World.CreateObject(Model.FromString("amb_icecone01"), new Vector3(-388.1567F, 614.7545F, 14.8061F));
  1840.             lodzikCutscene.FreezePosition = true;
  1841.             cutSceneCam = new Camera();
  1842.             cutSceneCam.Position = new Vector3(-385.70F, 613.16F, 16F);
  1843.             cutSceneCam.Heading = 30F;
  1844.             cutSceneCam.LookAt(lodzikCutscene.Position);
  1845.             cutSceneCam.FOV = 40F;
  1846.             cutSceneCam.Activate();
  1847.             Game.WaitInCurrentScript(10);
  1848.             GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Find ice cones hidden in city and destroy them!", 5000, 1);
  1849.             Game.WaitInCurrentScript(2000);
  1850.             int myPtfx = GTA.Native.Function.Call<int>("START_PTFX", "dest_food_debris", lodzikCutscene.Position.X+0.1F, lodzikCutscene.Position.Y, lodzikCutscene.Position.Z, 0, 0, 0, 1.0);
  1851.             lodzikCutscene.NoLongerNeeded();
  1852.             lodzikCutscene.Delete();
  1853.             Game.WaitInCurrentScript(2000);
  1854.             cutSceneCam.Deactivate();
  1855.             Player.CanControlCharacter = true;
  1856.            
  1857.            
  1858.  
  1859.  
  1860.             //GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1861.             //GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1862.             //GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1863.             //GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", spawnpoint.X, spawnpoint.Y, spawnpoint.Z, 8F);
  1864.             //goodCar = World.CreateVehicle(0x3A196CEA, spawnpoint);
  1865.             //goodCar.Heading = 90F;
  1866.             //goodCar.Color = ColorIndex.DarkGreenPoly;
  1867.             //MissionBlip = GTA.Blip.AddBlip(goodCar);
  1868.  
  1869.             Zdarzenie(6);
  1870.             GTA.Native.Function.Call("STOP_PTFX", myPtfx);
  1871.             GTA.Native.Function.Call("REMOVE_PTFX", myPtfx);
  1872.             timerChallenge = 60;
  1873.             challengeRun = true;
  1874.             challengeNr2.Start();
  1875.             timerDraw.Start();
  1876.            
  1877.             //cutsceneNr1.Start();
  1878.             //CutScene1_Challenge1();
  1879.         }
  1880.         private void FirstMission_Challenge2(object sender, EventArgs e)
  1881.         {
  1882.             PlayerIsAlive();
  1883.             if (!(Player.Character.isInVehicle())) zadanieCheck[3] = false;
  1884.             if (GTA.Native.Function.Call<bool>("HAS_OBJECT_BEEN_DAMAGED_BY_CHAR", lodzikCh2, Player.Character))
  1885.             {
  1886.                
  1887.                 GTA.Native.Function.Call<int>("START_PTFX", "dest_food_debris", lodzikCh2.Position.X + 0.1F, lodzikCh2.Position.Y, lodzikCh2.Position.Z, 0, 0, 0, 1.0);
  1888.                 lodzikCh2.NoLongerNeeded();
  1889.                 lodzikCh2.Delete();
  1890.                 //GTA.Native.Function.Call("STOP_PTFX", myPtfx);
  1891.                 //GTA.Native.Function.Call("REMOVE_PTFX", myPtfx);
  1892.                 ileLodowDel = (byte)(ileLodowDel + 1);
  1893.                 if(ileLodowDel==1) Zdarzenie(7);
  1894.                 if (ileLodowDel == 2) Zdarzenie(8);
  1895.                 if (ileLodowDel == 3) Zdarzenie(9);
  1896.                 if (ileLodowDel == 4) Zdarzenie(10);
  1897.             }
  1898.         }
  1899.  
  1900.         private void Prepare_Challenge3()
  1901.         {
  1902.             prepareRing.Stop();
  1903.             SpecialCar_CHECK.Stop();
  1904.             startPed[2].Task.ClearSecondary();
  1905.             startPed[2].Task.ClearAllImmediately();
  1906.             Player.CanControlCharacter = false;
  1907.             //drawRedCircle.Visible = false;
  1908.             //Vector3 spawnpoint = new Vector3(-390.66F, 1180.09F, 14.18F);
  1909.             GTA.Native.Function.Call("SET_MISSION_FLAG", true);
  1910.             GTA.Native.Function.Call("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", new Model(0xb7bda30e), -528.0F, 1262.0F, 18.0F, 0, 0.0F);
  1911.             GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Get up fire extinguisher and extinguish fire!", 5000, 1);
  1912.             GTA.Native.Function.Call("CLEAR_AREA_OF_CARS", -537.7730F, 1260.8560F, 16.5451F, 15F);
  1913.             GTA.Native.Function.Call("CLEAR_AREA_OF_CHARS", -537.7730F, 1260.8560F, 16.5451F, 15F);
  1914.             GTA.Native.Function.Call("CLEAR_AREA_OF_OBJECTS", -537.7730F, 1260.8560F, 16.5451F, 15F);
  1915.             GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -537.7730F, 1260.8560F, 16.5451F, 15F);
  1916.             GTA.Native.Function.Call("REQUEST_MODEL", 0x145D8395);
  1917.             gasnica = World.CreateObject(0x145D8395, new Vector3(-537.7730F, 1260.8560F, 16.5451F));
  1918.             //GTA.Native.Function.Call("CLEAR_ROOM_FOR_OBJECT",gasnica);
  1919.             //GTA.Native.Function.Call("SET_OBJECT_VISIBLE",gasnica,true);
  1920.             gasnica.CurrentRoom = Room.FromString("R_ADFEDDD7_00013104");
  1921.             gasnica.FreezePosition = true;
  1922.             cutSceneCam = new Camera();
  1923.             cutSceneCam.FOV = 50F;
  1924.             cutSceneCam.LookAt(gasnica);
  1925.             cutSceneCam.Position = gasnica.GetOffsetPosition(new Vector3(1F,-4F,1.5F));
  1926.             cutSceneCam.Activate();
  1927.             Game.WaitInCurrentScript(3000);
  1928.             Player.CanControlCharacter = true;
  1929.             cutSceneCam.Deactivate();
  1930.             GTA.Native.Function.Call("SETTIMERC", 0);
  1931.             do{
  1932.                 Game.WaitInCurrentScript(1);
  1933.                 if (Player.Character.Position.DistanceTo(new Vector3(-537.7730F, 1260.8560F, 17.5451F)) < 1.0F)
  1934.                 {
  1935.                     GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Press " + GameKey.Action + " to pick up extinguisher!", 20, 1);
  1936.                     if (Game.isGameKeyPressed(GameKey.Action))
  1937.                     {
  1938.                         Player.Character.Task.TurnTo(gasnica.Position);
  1939.                         Game.WaitInCurrentScript(600);
  1940.                         string animacja = "swing_idle";
  1941.                         AnimationSet grupa_anim = new AnimationSet("amb@baseball");
  1942.                         string animacja2 = "use_vendmac";
  1943.                         AnimationSet grupa_anim2 = new AnimationSet("amb@arcade");
  1944.                         soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  1945.                         GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim.Name);
  1946.                         GTA.Native.Function.Call("REQUEST_ANIMS", grupa_anim2.Name);
  1947.                         Player.Character.FreezePosition = true;
  1948.                         Player.CanControlCharacter = false;
  1949.                         Player.Character.Animation.Play(grupa_anim2, animacja2, 1.0F);
  1950.                         Game.WaitInCurrentScript(100);
  1951.                         gasnica.FreezePosition = false;
  1952.                         GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim2.Name, animacja2, 0.60F);
  1953.                         Player.Character.Animation.Play(grupa_anim, animacja, 1.0F, AnimationFlags.Unknown06 | AnimationFlags.Unknown09 | AnimationFlags.Unknown11 | AnimationFlags.Unknown12);
  1954.                         //GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, animacja, grupa_anim.Name, 0.9F, 0, 0, 0, 1, 0);
  1955.                         Game.WaitInCurrentScript(100);
  1956.                         GTA.Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, grupa_anim.Name, animacja, 0.90F);
  1957.                         Game.WaitInCurrentScript(400);
  1958.                         GTA.Native.Function.Call("BLOCK_CHAR_VISEME_ANIMS", Player.Character, true);
  1959.                         GTA.Native.Function.Call("BLOCK_CHAR_AMBIENT_ANIMS", Player.Character, true);
  1960.                         GTA.Native.Function.Call("HIDE_CHAR_WEAPON_FOR_SCRIPTED_CUTSCENE", Player.Character, true);
  1961.                         GTA.Native.Function.Call("BLOCK_PED_WEAPON_SWITCHING", Player.Character, true);
  1962.                         GTA.Native.Function.Call("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", Player.Character, true);
  1963.                         soundID = GTA.Native.Function.Call<int>("GET_SOUND_ID");
  1964.                      //obiekt jakiś aby zablokować pójście gdy zostawi ogien na dole... Hmmm?
  1965.                         //GTA.Native.Function.Call("IS_PED_IN_CUTSCENE_BLOCKING_BOUNDS",Player.Character);
  1966.                         gasnica.AttachToPed(Player.Character, Bone.LeftHand, new Vector3(0F, 0.02F, 0.63F), new Vector3(3.15F, 0.0F, -1.65F));
  1967.                         Player.Character.FreezePosition = false;
  1968.                         Player.CanControlCharacter = true;
  1969.                         plomien[0] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -542.1921F, 1256.6660F, 20.5448F, 2, 5);
  1970.                         plomien[1] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -539.4823F, 1267.0840F, 24.5453F, 2, 5);
  1971.                         plomien[2] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1972.                         plomien[3] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -538.0640F, 1257.7440F, 33.7715F, 2, 5);
  1973.                         //aaaaa
  1974.                         /*
  1975.                         plomien[4] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1976.                         plomien[5] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1977.                         plomien[6] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1978.                         plomien[7] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1979.                         plomien[8] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1980.                         plomien[9] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1981.                         plomien[10] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1982.                         plomien[11] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1983.                         plomien[12] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1984.                         plomien[13] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1985.                         plomien[14] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1986.                         plomien[15] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1987.                         plomien[16] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1988.                         plomien[17] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1989.                         plomien[18] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1990.                         plomien[19] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1991.                         plomien[20] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1992.                         plomien[21] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1993.                         plomien[22] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1994.                         plomien[23] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1995.                         plomien[24] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1996.                         plomien[25] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1997.                         plomien[26] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1998.                         plomien[27] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  1999.                         plomien[28] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  2000.                         plomien[29] = GTA.Native.Function.Call<int>("START_SCRIPT_FIRE", -549.7076F, 1252.3270F, 29.5411F, 2, 5);
  2001.                          * */
  2002.                        
  2003.                         GTA.Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", "Press " + GameKey.Action + " to use !", 20, 1);
  2004.  
  2005. // TUTAJ OGNIE, tabelka 30 wymiarowa
  2006.                         break;
  2007.                     }
  2008.                 }
  2009.             }while(GTA.Native.Function.Call<int>("TIMERC")<20000);
  2010.             if (!(GTA.Native.Function.Call<Ped>("GET_PED_OBJECT_IS_ATTACHED_TO", gasnica) == Player.Character))
  2011.             {
  2012.                 gasnica.FreezePosition = false;
  2013.                 Challenge3_clear();
  2014.                 ClearAll();
  2015.             }
  2016.             else
  2017.             {
  2018.                 timerChallenge = 60;
  2019.                 challengeRun = true;
  2020.                
  2021.                 timerDraw.Start();
  2022.                 challengeNr3.Start();
  2023.             }
  2024.             //GTA.Native.Function.Call("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", new Model(0xb7bda30e), -528.0F, 1262.0F, 18.0F, 1, 0.0F);
  2025.         }
  2026.         private void FirstMission_Challenge3(object sender, EventArgs e)
  2027.         {
  2028.             byte control = 0;
  2029.             if (Game.isGameKeyPressed(GameKey.Action))
  2030.             {
  2031.                 if (it_WLACZONY)
  2032.                 {
  2033.                     it_WLACZONY = false;
  2034.                     GTA.Native.Function.Call("STOP_SOUND", soundID); // spr dzwiek czy nie koliduje z pipkiem od 10 sec
  2035.                     GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  2036.                     GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  2037.                     GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  2038.                     GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  2039.                     Game.WaitInCurrentScript(100);
  2040.                 }
  2041.                 else
  2042.                 {
  2043.                     if (gasnicaPojemnosc > 5)
  2044.                     {
  2045.                         GTA.Native.Function.Call("PLAY_SOUND_FROM_OBJECT", soundID, "BULLET_SPRAY_LOOP", gasnica);
  2046.                         PTFX_nr1 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "water_carwash_jets", gasnica, 0.15F, 0F, 0.66F, Player.Character.Direction.X + 90F, Player.Character.Direction.Y + 110F, Player.Character.Direction.Z, 1.0F);
  2047.                         PTFX_nr2 = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", "water_carwash_jets", gasnica, 0.16F, 0F, 0.66F, Player.Character.Direction.X + 90F, Player.Character.Direction.Y + 110F, Player.Character.Direction.Z, 1.0F);
  2048.                         it_WLACZONY = true;
  2049.                     }
  2050.                 }
  2051.             }
  2052.             if (it_WLACZONY)
  2053.             {
  2054.                 Game.Console.Print("GESTOSC: " + gasnicaPojemnosc);
  2055.                 if (gasnicaPojemnosc <= 5)
  2056.                 {
  2057.                     it_WLACZONY = false;
  2058.                     GTA.Native.Function.Call("STOP_SOUND", soundID);
  2059.                     GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  2060.                     GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  2061.                     GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  2062.                     GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  2063.                 }
  2064.                 if (gasnicaPojemnosc > 5)
  2065.                 {
  2066.                     Vector3 Gaszenie = Player.Character.GetOffsetPosition(new Vector3(0, 1.0F, -0.5F));
  2067.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", Gaszenie.X, Gaszenie.Y, Gaszenie.Z, 1.0F);
  2068.                     gasnicaPojemnosc = (byte)(gasnicaPojemnosc - 5);
  2069.                 }
  2070.             }
  2071.             Game.WaitInCurrentScript(100);
  2072.             if (GTA.Native.Function.Call<bool>("IS_SCRIPT_FIRE_EXTINGUISHED", plomien[0]) && zgaszony[0] == false)
  2073.             {
  2074.                 if (GTA.Native.Function.Call<int>("GET_NUMBER_OF_FIRES_IN_RANGE", -542.1921F, 1256.6660F, 20.5448F, 5.0F) == 0)
  2075.                 {
  2076.                     zgaszony[0] = true;
  2077.                     control = (byte)(control + 1);
  2078.                     timerChallenge = timerChallenge + 60;
  2079.                 }
  2080.             }
  2081.  
  2082.  
  2083.  
  2084.             //if (GTA.Native.Function.Call<bool>("IS_SCRIPT_FIRE_EXTINGUISHED", plomien[29]) && zgaszony[29] == false)
  2085.             if (GTA.Native.Function.Call<bool>("IS_SCRIPT_FIRE_EXTINGUISHED", plomien[3]) && zgaszony[3] == false)
  2086.             {
  2087. // tutaj sprawdzenie czy na pewno zgasil
  2088.                 // petla for dla poprzednich ogni
  2089.                 if (GTA.Native.Function.Call<int>("GET_NUMBER_OF_FIRES_IN_RANGE", -538.0640F, 1257.7440F, 33.7715F, 5.0F) == 0) // ostatni ogien
  2090.                 {
  2091.                 zgaszony[1] = true;
  2092.                 control = (byte)(control + 1);
  2093.                 Zdarzenie(11);
  2094.                 Challenge3_clear();
  2095.                 timerDraw.Stop();
  2096.                 challengeRun = false;
  2097.                 endChallenge = true;
  2098.                 GTA.Native.Function.Call("TRIGGER_MISSION_COMPLETE_AUDIO", 1);
  2099.                 endOfAll(2);
  2100.                 return;
  2101.                 }
  2102.                 /// Zabezpieczenie anty cheat:
  2103.                 /// jak suma kontrolna wiecej niz 1 to jest cheater
  2104.                 /// jak ostatni ogien zgasi nie bedac w poblizu = dodaj do sumy kontrolnej i tez wykryje cheatera
  2105.             }
  2106.             if (control > 1)
  2107.             {
  2108.                 Game.Console.Print("Ups, You used bug of ScriptHook or cheated. Challenge failed.");
  2109.                 Challenge3_clear();
  2110.                 ClearAll();
  2111.             }
  2112.         }
  2113.         private void Challenge3_clear()
  2114.         {
  2115.             GTA.Native.Function.Call("STOP_SOUND", soundID);
  2116.             GTA.Native.Function.Call("RELEASE_SOUND_ID", soundID);
  2117.             GTA.Native.Function.Call("STOP_PTFX", PTFX_nr1);
  2118.             GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr1);
  2119.             GTA.Native.Function.Call("STOP_PTFX", PTFX_nr2);
  2120.             GTA.Native.Function.Call("REMOVE_PTFX", PTFX_nr2);
  2121.             gasnica.Detach();
  2122.             gasnica.NoLongerNeeded();
  2123.             Player.Character.Task.ClearAll();
  2124.             Player.Character.Task.ClearSecondary();
  2125.             GTA.Native.Function.Call("BLOCK_CHAR_AMBIENT_ANIMS", Player.Character, false);
  2126.             GTA.Native.Function.Call("BLOCK_CHAR_VISEME_ANIMS", Player.Character, false);
  2127.             GTA.Native.Function.Call("BLOCK_PED_WEAPON_SWITCHING", Player.Character, false);
  2128.             GTA.Native.Function.Call("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", Player.Character, false);
  2129.             for (int numerOgnia = 0; numerOgnia < 30; numerOgnia++)
  2130.             {
  2131.                 if (GTA.Native.Function.Call<bool>("DOES_SCRIPT_FIRE_EXIST", plomien[numerOgnia]))
  2132.                 {
  2133.                     GTA.Native.Function.Call("REMOVE_SCRIPT_FIRE",plomien[numerOgnia]);
  2134.                     GTA.Native.Function.Call("EXTINGUISH_FIRE_AT_POINT", -537.7730F, 1260.8560F, 16.5451F, 3F);
  2135.                     // lista 30 ognisk i wyczyscic to
  2136.  
  2137.                 }
  2138.                 zgaszony[numerOgnia] = false;
  2139.             }
  2140.         }
  2141.         private void endOfAll(int numerNadpisu)
  2142.         {
  2143.            
  2144.             NadpisanieCodes(numerNadpisu);
  2145.            
  2146.             //specialCars[numerNadpisu]
  2147.             if(!(MissionBlip==null)) if(MissionBlip.Exists()) MissionBlip.Delete();
  2148.             MissionBlip = GTA.Blip.AddBlip(specialCars[numerNadpisu]);
  2149.             MissionBlip.Display = BlipDisplay.ArrowAndMap;
  2150.             MissionBlip.Color = BlipColor.White;
  2151.             MissionBlip.Icon = BlipIcon.Person_Unknown;
  2152.             MissionBlip.Scale = 2.2F;
  2153.             GTA.Native.Function.Call("FLASH_BLIP_ALT",MissionBlip, true);
  2154.             do
  2155.             {
  2156.                 smoothEnd = (byte)(smoothEnd+1);
  2157.                 Game.WaitInCurrentScript(2);
  2158.             } while (smoothEnd <= 124);
  2159.             Game.WaitInCurrentScript(100);
  2160.             using (Bitmap bmpScreenCapture = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
  2161.             {
  2162.                 using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmpScreenCapture))
  2163.                 {
  2164.                     makeScreen = true;
  2165.                     if (!(System.IO.Directory.Exists(Game.InstallFolder + "//scripts/RinepimChallenge/")))
  2166.                     {
  2167.                         System.IO.Directory.CreateDirectory(Game.InstallFolder + "//scripts/RinepimChallenge");
  2168.                     }
  2169.                     Game.WaitInCurrentScript(25);
  2170.                     string dataToday = string.Format("{0:yyyy-MM-dd_HH-mm}.jpg", DateTime.Now);
  2171.                     Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
  2172.                     System.Drawing.Graphics graphicScreen = System.Drawing.Graphics.FromImage(printscreen as Image);
  2173.                     graphicScreen.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
  2174.                     printscreen.Save(Game.InstallFolder + "//scripts/RinepimChallenge/Challenge1_" + dataToday, System.Drawing.Imaging.ImageFormat.Jpeg);
  2175.                     makeScreen = false;
  2176.                     Game.WaitInCurrentScript(4000);
  2177.                     do
  2178.                     {
  2179.                         smoothEnd = (byte)(smoothEnd -1);
  2180.                         Game.WaitInCurrentScript(2);
  2181.                     } while (smoothEnd >= 1);
  2182.                     endChallenge = false;
  2183.                     ClearAll();
  2184.                 }
  2185.             }
  2186.         }
  2187.         private void ClearAll()
  2188.         {
  2189.             if (!(lodzikCh2 == null))
  2190.             {
  2191.                 if (lodzikCh2.Exists())
  2192.                 {
  2193.                     lodzikCh2.NoLongerNeeded();
  2194.                     lodzikCh2.Delete();
  2195.                 }
  2196.             }
  2197.             if (!(arrayArrow[0] == null))
  2198.             {
  2199.                 arrayArrow[0].NoLongerNeeded();
  2200.                 arrayArrow[0].Delete();
  2201.             }
  2202.             if (!(arrayArrow[1] == null))
  2203.             {
  2204.                 arrayArrow[1].NoLongerNeeded();
  2205.                 arrayArrow[1].Delete();
  2206.             }
  2207.             if (!(arrayArrow[2] == null))
  2208.             {
  2209.                 arrayArrow[2].NoLongerNeeded();
  2210.                 arrayArrow[2].Delete();
  2211.             }
  2212.             Player.Character.WillFlyThroughWindscreen = true;
  2213.             if (!(goodCar == null))
  2214.             {
  2215.                 if (goodCar.Exists())
  2216.                 {
  2217.                     goodCar.DoorLock = DoorLock.None;
  2218.                     goodCar.NoLongerNeeded();
  2219.                 }
  2220.             }
  2221.             if (!(goodGuy == null))
  2222.             {
  2223.                 if (goodGuy.Exists())
  2224.                 {
  2225.                     goodGuy.NoLongerNeeded();
  2226.                     goodGuy.Delete();
  2227.                 }
  2228.             }
  2229.  
  2230.             for (int myNumber = 0; myNumber <= 2; myNumber++)
  2231.             {
  2232.                 if (!(startPed[myNumber] == null))
  2233.                 {
  2234.                     startPed[myNumber].Task.PlayAnimation(new AnimationSet("missroman6"), "partial_wave_a", 1.0F, AnimationFlags.Unknown11 | AnimationFlags.Unknown05 | AnimationFlags.Unknown09);
  2235.  
  2236.                     //GTA.Native.Function.Call("SET_CHAR_KEEP_TASK", startPed[0], true);
  2237.                 }
  2238.             }
  2239.             startPed[0].Heading = 220F;
  2240.             startPed[1].Heading = 264.72F;
  2241.             startPed[2].Heading = 292.31F;
  2242.             for (int myNumber = 0; myNumber <= 1; myNumber++)
  2243.             {
  2244.                 zadanieCheck[myNumber] = false;
  2245.             }
  2246.             if (!(crashFlat == null))
  2247.             {
  2248.                 if (crashFlat.Exists())
  2249.                 {
  2250.                     crashFlat.NoLongerNeeded();
  2251.                 }
  2252.             }
  2253.             if (!(MissionBlip == null))
  2254.             {
  2255.                 if (MissionBlip.Exists())
  2256.                 {
  2257.                     MissionBlip.Delete();
  2258.                 }
  2259.             }
  2260.             drawRedCircle.Visible = false;
  2261.             challengeRun = false;
  2262.             if (!(cutSceneCam == null))
  2263.             {
  2264.                 if (cutSceneCam.Exists())
  2265.                 {
  2266.                     cutSceneCam.FOV = 15;
  2267.                 }
  2268.             }
  2269.             timerChallenge = 0;
  2270.             gasnicaPojemnosc = 255;
  2271.             timerAll = 0;
  2272.             ileLodowDel = 0;
  2273.             prepareRing.Start();
  2274.             timerDraw.Stop();
  2275.             //cutsceneNr1.Stop();
  2276.             challengeNr2.Stop();
  2277.             challengeNr3.Stop();
  2278.             challengeNr1_first.Stop();
  2279.             challengeNr1_second.Stop();
  2280.             SpecialCar_CHECK.Start();
  2281.             GTA.Native.Function.Call("SET_MISSION_FLAG", false);
  2282.              
  2283.         }
  2284.      }
  2285. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement