Esempio n. 1
0
        public void Execute(IRocketPlayer rCaller, string[] Command)
        {
            UnturnedPlayer uPlayer = (UnturnedPlayer)rCaller;

            if (Command.Length > 0)
            {
                UnturnedChat.Say(uPlayer, Syntax, Color.red); return;
            }

            UtilPlayer utilPlayer = uPlayer.GetComponent <UtilPlayer>();

            if (VehicleTeleporter.Instance.HasVehicles(uPlayer.CSteamID) > 0)
            {
                int vehicleCount = 0;
                foreach (InteractableVehicle Vehicle in utilPlayer.vehicleList)
                {
                    vehicleCount++;
                    UnturnedChat.Say(uPlayer, $"[{vehicleCount}/{utilPlayer.vehicleList.Count}] {Vehicle.asset.vehicleName}", Color.yellow);
                }
                return;
            }
            else
            {
                UnturnedChat.Say(uPlayer, "You do not have any locked vehicles!", Color.red);
                return;
            }
        }
Esempio n. 2
0
        public void Execute(IRocketPlayer rCaller, string[] Command)
        {
            UnturnedPlayer uPlayer = (UnturnedPlayer)rCaller;

            if (Command.Length > 1 || Command.Length == 0)
            {
                UnturnedChat.Say(uPlayer, Syntax, Color.red); return;
            }

            UtilPlayer utilPlayer = uPlayer.GetComponent <UtilPlayer>();

            if (VehicleTeleporter.Instance.HasVehicles(uPlayer.CSteamID) > 0)
            {
                if (Regex.IsMatch(Command[0], @"^\d+$"))
                {
                    List <InteractableVehicle> playerVehicles = utilPlayer.vehicleList;

                    if (int.Parse(Command[0]) <= playerVehicles.Count)
                    {
                        InteractableVehicle desiredVehicle = playerVehicles[int.Parse(Command[0]) - 1];

                        uPlayer.Teleport(new Vector3(desiredVehicle.transform.position.x, desiredVehicle.transform.position.y + 3, desiredVehicle.transform.position.z), uPlayer.Rotation);
                        UnturnedChat.Say(uPlayer, $"You have teleported to your {desiredVehicle.asset.vehicleName}!", Color.yellow);
                        playerVehicles.Remove(desiredVehicle);
                    }
                    else
                    {
                        UnturnedChat.Say(uPlayer, $"Please select a number between 1 and {playerVehicles.Count}.", Color.red);
                        return;
                    }
                }
                else
                {
                    UnturnedChat.Say(uPlayer, Syntax, Color.red);
                    return;
                }
            }
            else
            {
                UnturnedChat.Say(uPlayer, "You do not have any locked vehicles!", Color.red);
            }
        }
Esempio n. 3
0
        public void Execute(IRocketPlayer rCaller, string[] Command)
        {
            UnturnedPlayer uPlayer = (UnturnedPlayer)rCaller;

            if (Command.Length == 0 || Command.Length > 1)
            {
                UnturnedChat.Say(uPlayer, Syntax, Color.red); return;
            }

            UtilPlayer utilPlayer = uPlayer.GetComponent <UtilPlayer>();

            if (VehicleTeleporter.Instance.HasVehicles(uPlayer.CSteamID) > 0)
            {
                if (Regex.IsMatch(Command[0], @"^\d+$"))
                {
                    List <InteractableVehicle> playerVehicles = utilPlayer.vehicleList;

                    if (int.Parse(Command[0]) <= playerVehicles.Count)
                    {
                        InteractableVehicle desiredVehicle = playerVehicles[int.Parse(Command[0]) - 1];
                        uPlayer.GiveVehicle(desiredVehicle.id);
                        InteractableVehicle newVehicle = VehicleManager.vehicles[VehicleManager.vehicles.Count - 1];
                        RetrieveVehicle(desiredVehicle, newVehicle, uPlayer);
                        UnturnedChat.Say(uPlayer, $"You have teleported your {desiredVehicle.asset.vehicleName} to you!", Color.yellow);
                    }
                    else
                    {
                        UnturnedChat.Say(uPlayer, $"Please select a number between 1 and {playerVehicles.Count}.", Color.red);
                        return;
                    }
                }
                else
                {
                    UnturnedChat.Say(uPlayer, Syntax, Color.red);
                    return;
                }
            }
            else
            {
                UnturnedChat.Say(uPlayer, "You do not have any locked vehicles!", Color.red);
            }
        }