Exemple #1
0
 public static void SaveClaimCheck(ClientInfo _cInfo, string _waypoint)
 {
     if (!Event.PlayersTeam.ContainsKey(_cInfo.playerId))
     {
         World                world                 = GameManager.Instance.World;
         EntityPlayer         _player               = world.Players.dict[_cInfo.entityId];
         Vector3              _position             = _player.GetPosition();
         int                  x                     = (int)_position.x;
         int                  y                     = (int)_position.y;
         int                  z                     = (int)_position.z;
         Vector3i             _vec3i                = new Vector3i(x, y, z);
         PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
         PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
         EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
         if (_owner == EnumLandClaimOwner.None)
         {
             SetPoint(_cInfo, _waypoint);
         }
         else
         {
             string _phrase586;
             if (!Phrases.Dict.TryGetValue(586, out _phrase586))
             {
                 _phrase586 = " you can only save a waypoint that is outside of a claimed space.";
             }
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase586 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
     }
     else
     {
         ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + ", you can not use waypoint commands while signed up for or in an event.[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
     }
 }
Exemple #2
0
        private static void FClaimCheck(ClientInfo _cInfo, string _waypoint)
        {
            World                world                 = GameManager.Instance.World;
            EntityPlayer         _player               = world.Players.dict[_cInfo.entityId];
            Vector3              _position             = _player.GetPosition();
            int                  x                     = (int)_position.x;
            int                  y                     = (int)_position.y;
            int                  z                     = (int)_position.z;
            Vector3i             _vec3i                = new Vector3i(x, y, z);
            PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
            PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
            EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);

            if (_owner == EnumLandClaimOwner.None)
            {
                FCommandCost(_cInfo, _waypoint, _player);
            }
            else
            {
                string _phrase576;
                if (!Phrases.Dict.TryGetValue(576, out _phrase576))
                {
                    _phrase576 = " you can only use a waypoint that is outside of a claimed space.";
                }
                ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase576 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
            }
        }
Exemple #3
0
        public static void CheckLP(ClientInfo _cInfo)
        {
            EntityPlayer player = PersistentOperations.GetEntityPlayer(_cInfo.entityId);

            if (player != null)
            {
                Vector3              position = player.GetPosition();
                int                  x        = (int)position.x;
                int                  y        = (int)position.y;
                int                  z        = (int)position.z;
                Vector3i             vector   = new Vector3i(x, y, z);
                PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
                PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(player.entityId);
                EnumLandClaimOwner   _owner = GameManager.Instance.World.GetLandClaimOwner(vector, _persistentPlayerData);
                if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally || _owner == EnumLandClaimOwner.None)
                {
                    if (CheckStuck(position.x, position.y, position.z))
                    {
                        TeleToSurface(_cInfo, player);
                    }
                    else
                    {
                        Phrases.Dict.TryGetValue("Stuck4", out string _phrase);
                        ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                    }
                }
                else
                {
                    Phrases.Dict.TryGetValue("Stuck2", out string _phrase);
                    ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                }
            }
        }
Exemple #4
0
        public static void CheckLP(ClientInfo _cInfo)
        {
            World                world                 = GameManager.Instance.World;
            EntityPlayer         _player               = world.Players.dict[_cInfo.entityId];
            Vector3              _position             = _player.GetPosition();
            int                  x                     = (int)_position.x;
            int                  y                     = (int)_position.y;
            int                  z                     = (int)_position.z;
            Vector3i             _vec3i                = new Vector3i(x, y, z);
            PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
            PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
            EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);

            if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally || _owner == EnumLandClaimOwner.None)
            {
                if (CheckStuck(_position.x, _position.y, _position.z))
                {
                    TeleToSurface(_cInfo, _player);
                }
                else
                {
                    Phrases.Dict.TryGetValue(554, out string _phrase554);
                    ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase554 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                }
            }
            else
            {
                Phrases.Dict.TryGetValue(552, out string _phrase552);
                ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase552 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
            }
        }
Exemple #5
0
 public static void CheckLocation(ClientInfo _cInfo, string _amount, int _exec)
 {
     if (Inside_Claim)
     {
         World                world                 = GameManager.Instance.World;
         EntityPlayer         _player               = world.Players.dict[_cInfo.entityId];
         Vector3              _position             = _player.GetPosition();
         int                  x                     = (int)_position.x;
         int                  y                     = (int)_position.y;
         int                  z                     = (int)_position.z;
         Vector3i             _vec3i                = new Vector3i(x, y, z);
         PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
         PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
         EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
         if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally)
         {
             if (_exec == 1)
             {
                 Deposit(_cInfo, _amount);
             }
             if (_exec == 2)
             {
                 Withdraw(_cInfo, _amount);
             }
             if (_exec == 3)
             {
                 WalletDeposit(_cInfo, _amount);
             }
             if (_exec == 4)
             {
                 WalletWithdraw(_cInfo, _amount);
             }
         }
         else
         {
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + " you can not use this command here.Stand in your own or a friend's claimed space.[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
     }
     else
     {
         if (_exec == 1)
         {
             Deposit(_cInfo, _amount);
         }
         if (_exec == 2)
         {
             Withdraw(_cInfo, _amount);
         }
         if (_exec == 3)
         {
             WalletDeposit(_cInfo, _amount);
         }
         if (_exec == 4)
         {
             WalletWithdraw(_cInfo, _amount);
         }
     }
 }
Exemple #6
0
        public static PersistentPlayerData GetPersistentPlayerDataFromEntityId(int _entityId)
        {
            PersistentPlayerList _persistentPlayerList = GameManager.Instance.persistentPlayers;

            if (_persistentPlayerList != null)
            {
                PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_entityId);
                if (_persistentPlayerData != null)
                {
                    return(_persistentPlayerData);
                }
            }
            return(null);
        }
Exemple #7
0
        private static bool Claimed(ClientInfo _cInfo, Vector3i _position)
        {
            PersistentPlayerList _persistentPlayerList = PersistentOperations.GetPersistentPlayerList();

            if (_persistentPlayerList != null)
            {
                PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_cInfo.entityId);
                EnumLandClaimOwner   _owner = GameManager.Instance.World.GetLandClaimOwner(_position, _persistentPlayerData);
                if (_owner == EnumLandClaimOwner.None)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #8
0
 public static void Exec1(ClientInfo _cInfo, EntityPlayer _player)
 {
     if (Inside_Claim)
     {
         World                world                 = GameManager.Instance.World;
         Vector3              _position             = _player.GetPosition();
         int                  x                     = (int)_position.x;
         int                  y                     = (int)_position.y;
         int                  z                     = (int)_position.z;
         Vector3i             _vec3i                = new Vector3i(x, y, z);
         PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
         PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
         EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
         if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally)
         {
             string _phrase781;
             if (!Phrases.Dict.TryGetValue(781, out _phrase781))
             {
                 _phrase781 = "saved your current bike for retrieval.";
             }
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase781 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             string _sql = string.Format("UPDATE Players SET bikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             SQL.FastQuery(_sql);
         }
         else
         {
             string _phrase780;
             if (!Phrases.Dict.TryGetValue(780, out _phrase780))
             {
                 _phrase780 = "you have not claimed this space or a friend. You can only save your bike inside a claimed space.";
             }
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase780 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
     }
     else
     {
         string _phrase781;
         if (!Phrases.Dict.TryGetValue(781, out _phrase781))
         {
             _phrase781 = "saved your current bike for retrieval.";
         }
         ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase781 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         string _sql = string.Format("UPDATE Players SET bikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
         SQL.FastQuery(_sql);
     }
 }
Exemple #9
0
        public static void CheckLP(ClientInfo _cInfo)
        {
            World                world                 = GameManager.Instance.World;
            EntityPlayer         _player               = world.Players.dict[_cInfo.entityId];
            Vector3              _position             = _player.GetPosition();
            int                  x                     = (int)_position.x;
            int                  y                     = (int)_position.y;
            int                  z                     = (int)_position.z;
            Vector3i             _vec3i                = new Vector3i(x, y, z);
            PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
            PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
            EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);

            if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally)
            {
                if (CheckStuck(_player))
                {
                    Exec(_cInfo, _player);
                }
                else
                {
                    string _phrase923;
                    if (!Phrases.Dict.TryGetValue(923, out _phrase923))
                    {
                        _phrase923 = "you do not seem to be stuck.";
                    }
                    ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase923 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                }
            }
            else
            {
                string _phrase921;
                if (!Phrases.Dict.TryGetValue(921, out _phrase921))
                {
                    _phrase921 = "you are outside of your claimed space or a friends. Command is unavailable.";
                }
                ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase921 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
            }
        }
Exemple #10
0
        public static void SaveVehicle(ClientInfo _cInfo, Entity _player, int _vehicle, int _vehicleId)
        {
            if (Inside_Claim)
            {
                World                world                 = GameManager.Instance.World;
                Vector3              _position             = _player.GetPosition();
                int                  x                     = (int)_position.x;
                int                  y                     = (int)_position.y;
                int                  z                     = (int)_position.z;
                Vector3i             _vec3i                = new Vector3i(x, y, z);
                PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
                PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
                EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
                if (!(_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally))
                {
                    string _phrase780;
                    if (!Phrases.Dict.TryGetValue(780, out _phrase780))
                    {
                        _phrase780 = "You have not claimed this space or a friend. You can only save your vehicle inside a claimed space.";
                    }
                    ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase780 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                    return;
                }
            }
            string _entityName = "", _vehicleName = "";

            if (_vehicle == 1)
            {
                _entityName  = "vehicleBicycle";
                _vehicleName = "bike";
            }
            else if (_vehicle == 2)
            {
                _entityName  = "vehicleMinibike";
                _vehicleName = "minibike";
            }
            else if (_vehicle == 3)
            {
                _entityName  = "vehicleMotorcycle";
                _vehicleName = "motorbike";
            }
            else if (_vehicle == 4)
            {
                _entityName  = "vehicle4x4Truck";
                _vehicleName = "jeep";
            }
            else if (_vehicle == 5)
            {
                _entityName  = "vehicleGyrocopter";
                _vehicleName = "gyro";
            }
            if (_player.AttachedToEntity.EntityClass.entityClassName.ToString() == _entityName)
            {
                if (_vehicle == 1)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].BikeId = _vehicleId;
                }
                else if (_vehicle == 2)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].MiniBikeId = _vehicleId;
                }
                else if (_vehicle == 3)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].MotorBikeId = _vehicleId;
                }
                else if (_vehicle == 4)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].JeepId = _vehicleId;
                }
                else if (_vehicle == 5)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].GyroId = _vehicleId;
                }
                PersistentContainer.Instance.Save();
                string _phrase781;
                if (!Phrases.Dict.TryGetValue(781, out _phrase781))
                {
                    _phrase781 = "Saved your current {Vehicle} for retrieval.";
                    _phrase781 = _phrase781.Replace("{Vehicle}", _vehicleName);
                }
                ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase781 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
            }
            else
            {
                string _phrase787;
                if (!Phrases.Dict.TryGetValue(787, out _phrase787))
                {
                    _phrase787 = "You are on the wrong vehicle to save it with this command. You are using a {Vehicle}.";
                }
                _phrase787 = _phrase787.Replace("{Vehicle}", _vehicleName);
                ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase787 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
            }
        }
 public static void Exec1(ClientInfo _cInfo, Entity _player, int _vehicle)
 {
     if (Inside_Claim)
     {
         World                world                 = GameManager.Instance.World;
         Vector3              _position             = _player.GetPosition();
         int                  x                     = (int)_position.x;
         int                  y                     = (int)_position.y;
         int                  z                     = (int)_position.z;
         Vector3i             _vec3i                = new Vector3i(x, y, z);
         PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
         PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
         EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
         if (_owner == EnumLandClaimOwner.Self || _owner == EnumLandClaimOwner.Ally)
         {
             string _vehicleName = "";
             string _messageName = "";
             if (_vehicle == 1)
             {
                 _vehicleName = "vehicleBicycle";
                 _messageName = "bike";
             }
             if (_vehicle == 2)
             {
                 _vehicleName = "vehicleMinibike";
                 _messageName = "minibike";
             }
             if (_vehicle == 3)
             {
                 _vehicleName = "vehicleMotorcycle";
                 _messageName = "motorbike";
             }
             if (_vehicle == 4)
             {
                 _vehicleName = "vehicle4x4Truck";
                 _messageName = "jeep";
             }
             if (_vehicle == 5)
             {
                 _vehicleName = "vehicleGyrocopter";
                 _messageName = "gyro";
             }
             if (_player.AttachedToEntity.EntityClass.entityClassName.ToString() == _vehicleName)
             {
                 string _phrase781;
                 if (!Phrases.Dict.TryGetValue(781, out _phrase781))
                 {
                     _phrase781 = " saved your current vehicle for retrieval.";
                 }
                 ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + _phrase781 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                 string _sql = "";
                 if (_vehicle == 1)
                 {
                     _sql = string.Format("UPDATE Vehicles SET bikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
                 }
                 if (_vehicle == 2)
                 {
                     _sql = string.Format("UPDATE Vehicles SET miniBikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
                 }
                 if (_vehicle == 3)
                 {
                     _sql = string.Format("UPDATE Vehicles SET motorBikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
                 }
                 if (_vehicle == 4)
                 {
                     _sql = string.Format("UPDATE Vehicles SET jeepId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
                 }
                 if (_vehicle == 5)
                 {
                     _sql = string.Format("UPDATE Vehicles SET gyroId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
                 }
                 SQL.FastQuery(_sql, "VehicleTeleport");
             }
             else
             {
                 string _phrase787;
                 if (!Phrases.Dict.TryGetValue(787, out _phrase787))
                 {
                     _phrase787 = " you are on the wrong vehicle to save it with this command. You are using a {Vehicle}.";
                 }
                 _phrase787 = _phrase787.Replace("{Vehicle}", _messageName);
                 ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + _phrase787 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             }
         }
         else
         {
             string _phrase780;
             if (!Phrases.Dict.TryGetValue(780, out _phrase780))
             {
                 _phrase780 = " you have not claimed this space or a friend. You can only save your vehicle inside a claimed space.";
             }
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + _phrase780 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
     }
     else
     {
         string _vehicleName = "";
         string _messageName = "";
         if (_vehicle == 1)
         {
             _vehicleName = "vehicleBicycle";
             _messageName = "bike";
         }
         if (_vehicle == 2)
         {
             _vehicleName = "vehicleMinibike";
             _messageName = "minibike";
         }
         if (_vehicle == 3)
         {
             _vehicleName = "vehicleMotorcycle";
             _messageName = "motorbike";
         }
         if (_vehicle == 4)
         {
             _vehicleName = "vehicle4x4Truck";
             _messageName = "jeep";
         }
         if (_vehicle == 5)
         {
             _vehicleName = "vehicleGyrocopter";
             _messageName = "gyro";
         }
         if (_player.AttachedToEntity.name == _vehicleName)
         {
             string _phrase781;
             if (!Phrases.Dict.TryGetValue(781, out _phrase781))
             {
                 _phrase781 = " saved your current vehicle for retrieval.";
             }
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + _phrase781 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             string _sql = "";
             if (_vehicle == 1)
             {
                 _sql = string.Format("UPDATE Vehicles SET bikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             }
             if (_vehicle == 2)
             {
                 _sql = string.Format("UPDATE Vehicles SET miniBikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             }
             if (_vehicle == 3)
             {
                 _sql = string.Format("UPDATE Vehicles SET motorBikeId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             }
             if (_vehicle == 4)
             {
                 _sql = string.Format("UPDATE Vehicles SET jeepId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             }
             if (_vehicle == 5)
             {
                 _sql = string.Format("UPDATE Vehicles SET gyroId = {0} WHERE steamid = '{1}'", _player.AttachedToEntity.entityId, _cInfo.playerId);
             }
             SQL.FastQuery(_sql, "VehicleTeleport");
         }
         else
         {
             string _phrase787;
             if (!Phrases.Dict.TryGetValue(787, out _phrase787))
             {
                 _phrase787 = " you are on the wrong vehicle to save it with this command. You are using a {Vehicle}.";
             }
             _phrase787 = _phrase787.Replace("{Vehicle}", _messageName);
             ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + LoadConfig.Chat_Response_Color + _phrase787 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
     }
 }
Exemple #12
0
        public static void SaveVehicle(ClientInfo _cInfo, Entity _player, int _vehicle, int _vehicleId)
        {
            if (Inside_Claim)
            {
                World                world                 = GameManager.Instance.World;
                Vector3              _position             = _player.GetPosition();
                int                  x                     = (int)_position.x;
                int                  y                     = (int)_position.y;
                int                  z                     = (int)_position.z;
                Vector3i             _vec3i                = new Vector3i(x, y, z);
                PersistentPlayerList _persistentPlayerList = GameManager.Instance.GetPersistentPlayerList();
                PersistentPlayerData _persistentPlayerData = _persistentPlayerList.GetPlayerDataFromEntityID(_player.entityId);
                EnumLandClaimOwner   _owner                = world.GetLandClaimOwner(_vec3i, _persistentPlayerData);
                if (!PersistentOperations.ClaimedByAllyOrSelf(_cInfo.playerId, _vec3i))
                {
                    Phrases.Dict.TryGetValue(491, out string _phrase491);
                    ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase491 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                    return;
                }
            }
            string _entityName = "", _vehicleName = "";

            if (_vehicle == 1)
            {
                _entityName  = "vehicleBicycle";
                _vehicleName = "bike";
            }
            else if (_vehicle == 2)
            {
                _entityName  = "vehicleMinibike";
                _vehicleName = "minibike";
            }
            else if (_vehicle == 3)
            {
                _entityName  = "vehicleMotorcycle";
                _vehicleName = "motorbike";
            }
            else if (_vehicle == 4)
            {
                _entityName  = "vehicle4x4Truck";
                _vehicleName = "jeep";
            }
            else if (_vehicle == 5)
            {
                _entityName  = "vehicleGyrocopter";
                _vehicleName = "gyro";
            }
            if (_player.AttachedToEntity.EntityClass.entityClassName.ToString() == _entityName)
            {
                if (_vehicle == 1)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].BikeId = _vehicleId;
                }
                else if (_vehicle == 2)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].MiniBikeId = _vehicleId;
                }
                else if (_vehicle == 3)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].MotorBikeId = _vehicleId;
                }
                else if (_vehicle == 4)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].JeepId = _vehicleId;
                }
                else if (_vehicle == 5)
                {
                    PersistentContainer.Instance.Players[_cInfo.playerId].GyroId = _vehicleId;
                }
                PersistentContainer.DataChange = true;
                Phrases.Dict.TryGetValue(492, out string _phrase492);
                _phrase492 = _phrase492.Replace("{Vehicle}", _vehicleName);
                ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase492 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
            }
            else
            {
                Phrases.Dict.TryGetValue(498, out string _phrase498);
                _phrase498 = _phrase498.Replace("{Vehicle}", _vehicleName);
                ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase498 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
            }
        }