public void AirdropAtPlayer(Player p, int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(p.Location);
     }
 }
 public void AirdropAt(float x, float y, float z, int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(new Vector3(x, y, z));
     }
 }
Example #3
0
 /// <summary>
 /// Calls an airdrop to the target vector 'rep' times.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="rep"></param>
 public void AirdropAtOriginal(Vector3 target, int rep = 1)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(target);
     }
 }
Example #4
0
 /// <summary>
 /// Calls an airdrop N times.
 /// </summary>
 /// <param name="rep"></param>
 public void Airdrop(int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         Vector3 rpog = SupplyDropZone.GetRandomTargetPos();
         SupplyDropZone.CallAirDropAt(rpog);
     }
 }
Example #5
0
        public void AirdropAtPlayer(Fougerite.Player p, int rep)
        {
            Contract.Requires(p != null);
            Contract.Requires(rep >= 0);

            for (int i = 0; i < rep; i++)
            {
                SupplyDropZone.CallAirDropAt(p.Location);
            }
        }
Example #6
0
        public void Airdrop(int rep)
        {
            System.Random rand = new System.Random();
            Vector3       rpog;

            for (int i = 0; i < rep; i++)
            {
                RandomPointOnGround(ref rand, out rpog);
                SupplyDropZone.CallAirDropAt(rpog);
            }
        }
Example #7
0
        public void AirdropAt(Vector3 target, int rep)
        {
            Vector3 original = target;

            System.Random rand = new System.Random();
            int           r, reset;

            r = reset = 20;
            for (int i = 0; i < rep; i++)
            {
                r--;
                if (r == 0)
                {
                    r      = reset;
                    target = original;
                }
                target.y = original.y + rand.Next(-5, 20) * 20;
                SupplyDropZone.CallAirDropAt(target);
                Jitter(ref target);
            }
        }
        void cmdChatBan(NetUser netuser, string command, string[] args)
        {
            if (!hasAccess(netuser, "canairdrop"))
            {
                SendReply(netuser, notAllowed); return;
            }

            // CALL 1 AIRDROP
            if (args.Length == 0)
            {
                SendReply(netuser, calledAirdrop); SupplyDropZone.CallAirDrop(); return;
            }


            // CANCEL ALL AIRDROPS
            if (args.Length == 1 && args[0].ToString() == "cancel")
            {
                int planenumber = 0;
                foreach (SupplyDropPlane plane in UnityEngine.Resources.FindObjectsOfTypeAll <SupplyDropPlane>())
                {
                    if (plane.gameObject.name == "C130")
                    {
                        continue;
                    }
                    planenumber++;
                    plane.NetDestroy();
                }
                SendReply(netuser, string.Format(cancelledAirdrop, planenumber.ToString()));
                return;
            }

            // DESTROY ALL SUPPLY CRATES
            if (args.Length == 1 && args[0].ToString() == "destroy")
            {
                int cratenumber = 0;
                foreach (SupplyCrate crate in UnityEngine.Resources.FindObjectsOfTypeAll <SupplyCrate>())
                {
                    if (crate.gameObject.name == "SupplyCrate")
                    {
                        continue;
                    }
                    cratenumber++;
                    NetCull.Destroy(crate.gameObject);
                }
                SendReply(netuser, string.Format(destroyedCrates, cratenumber.ToString()));
                return;
            }

            // CALL MASS AIRDROP
            int number;

            if (args.Length == 1 && int.TryParse(args[0], out number))
            {
                SendReply(netuser, string.Format(massAirdrop, number.ToString()));
                for (int i = 0; i < number; i++)
                {
                    SupplyDropZone.CallAirDrop();
                }
                return;
            }

            // CALL AN AIRDROP ON POSITION
            float x;
            float z;

            if (args.Length > 1 && float.TryParse(args[0], out x))
            {
                if (args.Length == 2)
                {
                    float.TryParse(args[1], out z);
                }
                else
                {
                    float.TryParse(args[2], out z);
                }

                if (z != default(float))
                {
                    cachedPos = new Vector3(x, 0f, z);
                    SupplyDropZone.CallAirDropAt(cachedPos);
                    SendReply(netuser, string.Format(airdropPos, cachedPos.ToString()));
                }
                return;
            }

            // CALL AN AIRDROP TO A PLAYER POSITION
            NetUser targetuser = rust.FindPlayer(args[0]);

            if (targetuser != null)
            {
                cachedPos = targetuser.playerClient.lastKnownPosition;
                if (cachedPos != default(Vector3))
                {
                    SupplyDropZone.CallAirDropAt(cachedPos);
                    SendReply(netuser, string.Format(airdropPlayer, cachedPos.ToString(), targetuser.playerClient.userName.ToString()));
                }
                return;
            }


            SendReply(netuser, wrongarguments);
        }
Example #9
0
 public void AirdropAtOriginal(Vector3 target, int rep = 1)
 {
     SupplyDropZone.CallAirDropAt(target);
 }