Advertisement
Guest User

Hipiecommunist zombie script

a guest
Jun 24th, 2011
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.68 KB | None | 0 0
  1. // HippieCommunist ZombieZ
  2.  
  3. using System;
  4. using System.Windows.Forms;
  5. using GTA;
  6.  
  7. namespace Zomb
  8. {
  9.  
  10.     // ### makes ZombieZ!
  11.  
  12.     public class Zomb : Script
  13.     {
  14.  
  15.         public Zomb()
  16.         {
  17.             this.Tick += new EventHandler(this.ScriptCommunicationExample2_Tick);
  18.             Interval = Settings.GetValueInteger("INTERVAL", "SETTINGS", 200);
  19.             Wait(0);
  20.         }
  21.  
  22.         private int Ra(int min, int max)
  23.         {
  24.             Random random = new Random();
  25.             return random.Next(min, max);
  26.         }
  27.         bool Ison = false;
  28.  
  29.         int r;
  30.  
  31.  
  32.         private void ScriptCommunicationExample2_Tick(object sender, EventArgs e)
  33.         {
  34.             //    Wait(0);
  35.  
  36.  
  37.  
  38.             if (Ison == true)
  39.             {
  40.                 if (!Player.Character.isAlive)
  41.                 {
  42.  
  43.                     Ison = false; int rand = Ra(0, 6); GTA.Native.Function.Call("FORCE_WEATHER_NOW", rand); Game.DisplayText("INFECTION STOPPED...");
  44.                     GTA.Native.Function.Call("SET_MAX_WANTED_LEVEL", 6);
  45.                     GTA.Native.Function.Call("DONT_DISPATCH_COPS_FOR_PLAYER", Player, 0);
  46.  
  47.                 }
  48.                 else
  49.                 {
  50.                     int r = Ra(0, 65);
  51.                     /*if (r == 2)
  52.                     {
  53.                         Wait(0);
  54.                         Vehicle x = null;
  55.                         int a = Ra(0, 26);
  56.                         int bb = Ra(-40, 40);
  57.                         Vector3 ppp = Player.Character.GetOffsetPosition(new Vector3(bb, 30.0f, -40.0f));
  58.                         if (a == 0) { x = GTA.World.CreateVehicle(0x45D56ADA, ppp); }
  59.                         else if (a == 1) { x = GTA.World.CreateVehicle(0x7A61B330, ppp); }
  60.                         else if (a == 2) { x = GTA.World.CreateVehicle(0x32B91AE8, ppp); }
  61.                         else if (a == 3) { x = GTA.World.CreateVehicle(0xD577C962, ppp); }
  62.                         else if (a == 4) { x = GTA.World.CreateVehicle(0x73920F8E, ppp); }
  63.                         else if (a == 5) { x = GTA.World.CreateVehicle(0x45D56ADA, ppp); }
  64.                         else if (a == 6) { x = GTA.World.CreateVehicle(0x50B0215A, ppp); }
  65.                         else if (a == 7) { x = GTA.World.CreateVehicle(0x8EB78F5A, ppp); }
  66.                         else if (a == 8) { x = GTA.World.CreateVehicle(0xCD935EF9, ppp); }
  67.                         else if (a == 9) { x = GTA.World.CreateVehicle(0x72435A19, ppp); }
  68.                         else if (a == 10) { x = GTA.World.CreateVehicle(0x31F0B376, ppp); }
  69.                         else if (a == 11) { x = GTA.World.CreateVehicle(0x78D70477, ppp); }
  70.                         else if (a == 12) { x = GTA.World.CreateVehicle(0x1149422F, ppp); }
  71.                         else if (a == 13) { x = GTA.World.CreateVehicle(0x1517D4D9, ppp); }
  72.                         else if (a == 14) { x = GTA.World.CreateVehicle(0x73920F8E, ppp); }
  73.                         else if (a == 15) { x = GTA.World.CreateVehicle(0x17DF5EC2, ppp); }
  74.                         else if (a == 16) { x = GTA.World.CreateVehicle(0x78D70477, ppp); }
  75.                         else if (a == 17) { x = GTA.World.CreateVehicle(0xCD935EF9, ppp); }
  76.                         else if (a == 18) { x = GTA.World.CreateVehicle(0x1149422F, ppp); }
  77.                         else if (a == 19) { x = GTA.World.CreateVehicle(0x8B13F083, ppp); }
  78.                         else if (a == 20) { x = GTA.World.CreateVehicle(0x50B0215A, ppp); }
  79.                         else if (a == 21) { x = GTA.World.CreateVehicle(0x68E27CB6, ppp); }
  80.                         else if (a == 22) { x = GTA.World.CreateVehicle(0x08DE2A8B, ppp); }
  81.                         else if (a == 23) { x = GTA.World.CreateVehicle(0x21EEE87D, ppp); }
  82.                         else if (a == 24) { x = GTA.World.CreateVehicle(0x22C16A2F, ppp); }
  83.                         else if (a == 25) { x = GTA.World.CreateVehicle(0x809AA4CB, ppp); }
  84.  
  85.  
  86.                         Wait(0);
  87.                         if (x != null && x.Exists())
  88.                         {
  89.                             x.Health = -1000; x.PetrolTankHealth = -0.1F;
  90.  
  91.  
  92.                             GTA.Native.Function.Call("SET_CAR_COORDINATES", x, x.Position.X, x.Position.Y, x.Position.Z + Ra(10, 350));
  93.                             x.Heading = Ra(0, 359);
  94.                             Wait(0);
  95.                             x.ApplyForce(new Vector3(100.0F, 200.0F, -200000.58F));
  96.                             Wait(0);
  97.                             x.ApplyForce(new Vector3(500.0F, 200.0F, -20000.58F));
  98.                             Wait(0);
  99.                             x.NoLongerNeeded();
  100.                         }
  101.                     }*/
  102.                     Vehicle v = null;
  103. //                    v = GTA.World.GetClosestVehicle(Player.Character.Position.Around(35.0f), 125.0F); // no car is drivable
  104.     v = GTA.World.GetClosestVehicle(Player.Character.Position.Around(60.0f), 35.0F); // some cars are drivable (player current car wont be touched)
  105.                     if (v != null && v.Exists() && v.EngineHealth > 0.0F)
  106.                     {
  107.                         v.HazardLightsOn = true;
  108.                         v.EngineHealth = 0.0F;
  109.  
  110.                         r = Ra(0, 4);
  111.                         if (r == 2) { v.PetrolTankHealth = -0.1F; }
  112.                         Wait(0); v.NoLongerNeeded();
  113.                     }
  114.  
  115.                     GTA.Native.Function.Call("SET_MAX_WANTED_LEVEL", 0);
  116.                     GTA.Native.Function.Call("ALTER_WANTED_LEVEL", Player, 0);
  117.                     GTA.Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player);
  118.  
  119.                     GTA.World.PedDensity = 5.0F;
  120.                     GTA.World.CarDensity = 0.0F;
  121.                     GTA.Native.Function.Call("Request_Anims", "amb@drunk");
  122.  
  123.                     AnimationFlags animflags = AnimationFlags.Unknown11 | AnimationFlags.Unknown09;
  124.                     AnimationSet anims = new AnimationSet("amb@drunk");
  125.  
  126.                     GTA.Ped[] pedArray = GTA.World.GetPeds(Player.Character.Position.Around(9.0f), 455.9F, 40);
  127.  
  128.                     foreach (GTA.Ped Pede in pedArray)
  129.                     {
  130.                         if (!Pede.Exists() || Pede == null || Pede.isRequiredForMission || !Player.Character.isAlive || GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", Pede) ||
  131.  
  132.     Pede.isGettingIntoAVehicle || Pede.isRagdoll ||
  133.  
  134.      !Pede.isAlive || Pede == Player.Character)
  135.                         {
  136.                             continue;
  137.                         }
  138.  
  139.                         if (Pede.Exists() && Pede != null)
  140.                         {
  141.                 GTA.Native.Function.Call("SAY_AMBIENT_SPEECH", Pede, "MOAN", 1, 1, 2);
  142.                             if (Pede.isSittingInVehicle())
  143.                             {
  144.  
  145.                                 Pede.Task.LeaveVehicleImmediately(Pede.CurrentVehicle); Wait(0);
  146.                             }
  147.                             if (Pede.Exists() && Pede != null && GTA.Native.Function.Call<bool>("IS_CHAR_SITTING_IDLE", Pede))
  148.                             {
  149.                                 Pede.Euphoria.BodyBalance.Start(100); Wait(0);
  150.                             }
  151.                             if (Pede.Exists() && Pede != null)
  152.                             {
  153.                                 GTA.Native.Function.Call("SET_PED_DONT_DO_EVASIVE_DIVES", Pede, 1);
  154.                                 GTA.Native.Function.Call("SET_CHAR_SUFFERS_CRITICAL_HITS", Pede, 1);
  155.                                 Pede.AlwaysDiesOnLowHealth = true;
  156.                 GTA.Native.Function.Call("SET_CHAR_MONEY",Pede,0);
  157.                                 Pede.Health = 600;
  158.                                 Pede.MakeProofTo(false, false, false, true, false);
  159.  
  160.                                 r = Ra(0, 4);
  161.  
  162.                                 if ((r == 1) && Pede.Exists() && Pede != null && !GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Pede, "amb@drunk", "bum_fight") && !GTA.Native.Function.Call<bool>
  163.  
  164. ("IS_CHAR_GETTING_UP", Pede) && !Pede.isSittingInVehicle())
  165.                                 {
  166.                                     Pede.Task.PlayAnimation(anims, "bum_fight", 10.0F, animflags);
  167.                                 }
  168.  
  169.                                 Pede.DuckWhenAimedAtByGroupMember = false;
  170.                                 Pede.ChangeRelationship(RelationshipGroup.Player, Relationship.Hate);
  171.                                 Pede.Weapons.RemoveAll();
  172.                                 //Pede.CancelAmbientSpeech();
  173.                 Pede.Voice = "M_ZOMBIE";
  174.                                 Pede.SetPathfinding(true, true, true);
  175.                                 Pede.RelationshipGroup = RelationshipGroup.Player;
  176.                                 Pede.Task.FightAgainst(Player.Character);
  177.                                 Pede.Task.GoTo(Player.Character.Position, true);
  178.                                 //Wait(0);
  179.                                 GTA.Native.Function.Call("REQUEST_ANIMS", "move_injured_lower");
  180.                             }
  181.                             if (Pede.Exists() && Pede != null)
  182.                             {
  183.                                 GTA.Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Pede, "move_injured_lower"); GTA.Native.Function.Call("Set_Char_Move_Anim_Speed_Multiplier", Pede, 1.6f);
  184.  
  185.                          
  186.                                 if (Pede.Exists() && Pede != null)
  187.                                 {
  188.                                     float vx = Pede.Velocity.X, vy = Pede.Velocity.Y;
  189.                                     vx = vx * vx; vy = vy * vy;
  190.  
  191.                                     if (Pede.Exists() && Pede != null && (vx < 0.001F) && (vy < 0.001F))// && (vx > 0.00001F) && (vy > 0.00001F)
  192.                                     {
  193.                                         GTA.Native.Function.Call("TASK_CLIMB", Pede, 3);
  194.                                         Wait(0);
  195.                                     }
  196.                                 }
  197.                             }
  198.                         }
  199.                         if (Pede.Exists() && Pede != null && (!Pede.isRagdoll) && !GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Pede) && Pede.isAliveAndWell && Pede.Position.DistanceTo
  200.  
  201. (Player.Character.Position) <=
  202.  
  203.     1.2f)
  204.                         {
  205.                             Pede.PreventRagdoll = true;
  206.                             if (Pede.Exists() && Pede != null && (!Pede.isRagdoll) && (!Player.Character.isRagdoll) && Player.Character.isAlive && !GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Pede,
  207.  
  208. "amb@drunk", "bum_fight") && !
  209.  
  210.      GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Pede))
  211.                                 Pede.Task.PlayAnimation(anims, "bum_fight", 10.0F, animflags);
  212.  
  213.                             Wait(400);
  214.                             Player.Character.Euphoria.BodyBalance.Start(700);
  215.                             if (Pede.Position.X < Player.Character.Position.X) { Player.Character.ApplyForce(new Vector3(3.45F, 0.0F, 0.0f)); }
  216.                             else { Player.Character.ApplyForce(new Vector3(-3.45F, 0.0F, 0.0f)); }
  217.                             if (Pede.Position.Y < Player.Character.Position.Y) { Player.Character.ApplyForce(new Vector3(0.0F, 3.45F, 0.0f)); }
  218.                             else { Player.Character.ApplyForce(new Vector3(0.0F, -3.45F, 0.0f)); }
  219.                             Player.Character.ApplyForce(new Vector3(0.0F, 0.0F, 0.8f), new Vector3(0.0F, 0.0F, -0.8f));
  220.  
  221.                             Wait(100);
  222.  
  223.                             Player.Character.Health -= 24;
  224.                             Pede.PreventRagdoll = false;
  225.  
  226.                             //  Wait(0);
  227.                         }
  228.                     }
  229.                 }
  230.                 //                if (!GTA.Native.Function.Call<bool>("Is_Char_In_Area_2D", Player.Character, 358.4987, 437.2099, 600.0576, -115.1860))
  231.  
  232.             }
  233.             else
  234.             {
  235.                 GTA.Native.Function.Call("DRAW_LIGHT_WITH_RANGE", 468.7595, 391.0586, 8.2811, 250, 20, 20, 9.0F, 95.0F);
  236.  
  237.  
  238.                 if (GTA.Native.Function.Call<bool>("Is_Char_In_Area_2D", Player.Character, 467.7190, 390.7162, 470.0016, 391.3876) || (isKeyPressed(Settings.GetValueKey("Key", Keys.F8))))
  239.                 {
  240.                     Ison = true;
  241.                     GTA.Native.Function.Call("Do_Screen_Fade_Out", 650);
  242.                     Wait(2000);
  243.                     int r = Ra(6, 8);
  244.                     GTA.Native.Function.Call("FORCE_WEATHER_NOW", r); GTA.Native.Function.Call("SET_TIME_OF_DAY", 0);
  245.                     GTA.Native.Function.Call("Do_Screen_Fade_In", 1650);
  246.                     Game.DisplayText("INFECTION STARTED!", 5000);
  247.  
  248.  
  249.                 }
  250.             }
  251.  
  252.         }
  253.     }
  254.  
  255. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement