예제 #1
0
        public KillerConf(int TimeOut, KillMode Mode, int Repeat, KillActionType Action = KillActionType.KILL_USING_BOTH_RANDOMLY, KillVictimType VictimType = KillVictimType.KILL_RANDOMLY_BOTH)
        {
            timeout = TimeOut;
            mode    = Mode;
            repeat  = Repeat;

            action     = Action;
            victimtype = VictimType;
        }
예제 #2
0
 public virtual bool IsKillable(KillMode killMode)
 {
     if (hasShield && killMode == KillMode.SHOOT)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #3
0
        void ExecuteKill(KillMode killMode)
        {
            Ped playerPed = Game.Player.Character;

            Ped[] nearbyPeds = GTA.World.GetNearbyPeds(playerPed, _KILL_RADIUS);
            foreach (Ped p in nearbyPeds)
            {
                // dont kill friendly peds, players, or peds in player's vehicle
                if (IsPedFriendly(p) || p.IsPlayer || (playerPed.IsInVehicle() && p.IsInVehicle(playerPed.CurrentVehicle)))
                {
                    continue;
                }
                if (p.IsAlive)
                {
                    switch (killMode)
                    {
                    case KillMode.KillAll:
                        p.Kill();
                        break;

                    case KillMode.ExplodeAll:
                        KillPedWithExplosion(playerPed, p, Vector3.Zero, 17, 8f, 0f);
                        break;

                    case KillMode.SafeKill:
                        Relationship rel = p.GetRelationshipWithPed(playerPed);
                        if (!p.IsInVehicle() && !p.IsGettingIntoAVehicle && IsPedEnemyOrNeutral(p))
                        {
                            //KillPedWithExplosion(playerPed, p, new Vector3(0, 0, 0.5f), 14, 1f, 0f);
                            KillPedWithStunGun(playerPed, p, 200);
                        }
                        break;

                    case KillMode.Disarm:
                        p.Weapons.RemoveAll();
                        break;
                    }
                }
            }
        }
예제 #4
0
 private bool CheckForKillableEnemy(IEnemyController controller, KillMode killMode)
 {
     return(controller.IsKillable(killMode));
 }
예제 #5
0
        public KillerConf(int TimeOut, KillMode Mode, int Repeat, KillActionType Action = KillActionType.KILL_USING_BOTH_RANDOMLY, KillVictimType VictimType = KillVictimType.KILL_RANDOMLY_BOTH)
        {
            timeout = TimeOut;
            mode = Mode;
            repeat = Repeat;

            action = Action;
            victimtype = VictimType;
        }
예제 #6
0
 /// <summary>
 /// Kill the process of office
 /// </summary>
 /// <param name="type">The type of office: excel or word</param>
 /// <param name="mode">The mode of kill: confirm or not</param>
 /// <returns>The count of processes have been killed </returns>
 public static int Kill(OfficeType type, KillMode mode)
 {
     int killcount = 0;
     foreach (Process process in Process.GetProcesses())
     {
         if (string.Compare(process.ProcessName, type.ToString(), true) == 0)
         {
             if (mode == KillMode.Confirm)
             {
                 if (MessageBox.Show(string.Format("End {0} process:{1} ?", process.ProcessName, process.MainWindowTitle)
                     , "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                 {
                     continue;
                 }
             }
             try
             {
                 process.Kill();
                 killcount++;
             }
             catch (Exception e)
             {
                 MessageBox.Show(string.Format("{0} can not be stoped:\n{1}", process.ProcessName, e.Message)
                     , "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     return killcount;
 }