using Rust; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Oxide.Core; using Oxide.Core.Configuration; using Oxide.Core.Libraries.Covalence; using Oxide.Core.Plugins; using Oxide.Game.Rust.Cui; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using UnityEngine; #region Changelogs and ToDo /*============================================================================================================== * * 2.0.1 : - Added the vehicle.1mod.taxi. * 2.0.2 : - Added Support for HumanNPC. * - garage or garage ui commands both can be used. * - Added chatmessage and permissions to use npc shops. * - Tab buttons now are outside main UI screen. * 2.0.3 : - Added option to use a backgroundimage true/false * - Added Camper Module * - Cleanup and regions * - Repositioned the Modules in the UI (needs more work) * - Fixed Closing UI on Module/Parts tabs when plugin reloads * - Fixed Closing UI on Module/Parts tabs when player dies * - Fixed Closing UI on Module/Parts tabs when player disconnects * - Fixed Free UI Bannertext position if having the Free permission assigned. * 2.0.4 - Patched using offsets to keep screen ratios and scaling * ==============================================================================================================*/ #endregion namespace Oxide.Plugins { [Info("Garage", "Krungh Crow", "2.0.4")] [Description("Spawn Modular cars and all parts")] class Garage : CovalencePlugin { [PluginReference] Plugin ServerRewards, Kits, Economics , HumanNPC; #region Variables Dictionary CoolDowns = new Dictionary(); const string GarageUse_Perm = "garage.use"; const string NoCooldown_Perm = "garage.nocooldown"; const string NoCost_Perm = "garage.nocost"; const string NPC_Perm = "garage.usenpc"; bool UseNPCBool; //car and Chassis prefabs const string Chas2 = "assets/content/vehicles/modularcar/car_chassis_2module.entity.prefab"; const string Chas3 = "assets/content/vehicles/modularcar/car_chassis_3module.entity.prefab"; const string Chas4 = "assets/content/vehicles/modularcar/car_chassis_4module.entity.prefab"; const string Car2 = "assets/content/vehicles/modularcar/2module_car_spawned.entity.prefab"; const string Car3 = "assets/content/vehicles/modularcar/3module_car_spawned.entity.prefab"; const string Car4 = "assets/content/vehicles/modularcar/4module_car_spawned.entity.prefab"; #endregion #region Configuration void Init() { if (!LoadConfigVariables()) { Puts("Config file issue detected. Please delete file, or check syntax and fix."); return; } permission.RegisterPermission(GarageUse_Perm, this); permission.RegisterPermission(NoCooldown_Perm, this); permission.RegisterPermission(NoCost_Perm, this); permission.RegisterPermission(NPC_Perm, this); UseNPCBool = configData.Npcs.UseNPC; } private ConfigData configData; class ConfigData { //general settings public int Cooldown = 300; public bool BuildingSpawn = false; //currency req settings [JsonProperty(PropertyName = "NPC Vendor settings")] public NPC Npcs = new NPC(); [JsonProperty(PropertyName = "Use ServerRewards")] public bool UseServerRewards { get; set; } = true; [JsonProperty(PropertyName = "Use Economics")] public bool UseEconomics { get; set; } = true; /* [JsonProperty(PropertyName = "Use Currency")] public bool UseCurrency { get; set; } = true; [JsonProperty(PropertyName = "Currency (ItemID)")] public int CurrencyItemID { get; set; } = -932201673; [JsonProperty(PropertyName = "Currency (Item Shortname)")] public string CurrencyItemName { get; set; } = "scrap"; */ // text and button colors [JsonProperty(PropertyName = "Garage shop Title")] public string GarageTitle { get; set; } = "Garage By Krungh Crow"; [JsonProperty(PropertyName = "Garage Text color (RGBA)")] public string GarageTextClr { get; set; } = "1 1 1 0.90"; [JsonProperty(PropertyName = "Button color (RGBA)")] public string BtnClr { get; set; } = "0.2 0.6 0.86 0.90"; [JsonProperty(PropertyName = "Button text color (RGBA)")] public string BtnTextClr { get; set; } = "1 1 1 0.90"; [JsonProperty(PropertyName = "Menu Button color (RGBA)")] public string MenuBtnClr { get; set; } = "0.0 0.0 0.0 0.0"; [JsonProperty(PropertyName = "Close Button color (RGBA)")] public string BtnCloseClr { get; set; } = "0.0 0.0 0.0 0.0"; [JsonProperty(PropertyName = "Close Button Text color (RGBA)")] public string BtnCloseTextClr { get; set; } = "1 1 1 0.90"; [JsonProperty(PropertyName = "Button Lift color (RGBA)")] public string BtnLiftClr { get; set; } = "0.2 0.6 0.86 0.90"; [JsonProperty(PropertyName = "Button Lift Text color (RGBA)")] public string BtnLiftTextClr { get; set; } = "1 1 1 0.90"; // main background image url [JsonProperty(PropertyName = "Use Background Image")] public bool UseBackgroundImage { get; set; } = true; [JsonProperty(PropertyName = "Garage shop Background Image Url")] public string BackgroundImage { get; set; } = "https://i.ibb.co/zbg5271/garageuibackground.png"; [JsonProperty(PropertyName = "Garage shop Background Transparancy (0-1)")] public double BckgrndAlpha { get; set; } = 0.9; // page button image url [JsonProperty(PropertyName = "Main page button icon Image Url")] public string MainPageIcon { get; set; } = "https://i.ibb.co/jzDbx1r/main-page.png"; [JsonProperty(PropertyName = "Modules page button icon Image Url")] public string ModulesPageIcon { get; set; } = "https://i.ibb.co/NK94JF8/modules-empty-icon.png"; [JsonProperty(PropertyName = "Parts page button icon Image Url")] public string PartsPageIcon { get; set; } = "https://i.ibb.co/9HJZn18/car-parts-empty-icon.png"; [JsonProperty(PropertyName = "Close button icon Image Url")] public string ClosePageIcon { get; set; } = "https://i.ibb.co/x8t0Lq4/close-button.png"; // kits image icon url prices and ID's [JsonProperty(PropertyName = "Kits text color (RGBA)")] public string BtnTextKitClr { get; set; } = "1 1 1 0.90"; [JsonProperty(PropertyName = "Kit 1 (kit Title)")] public string CarKitTitle1 { get; set; } = "Carkit 1 description"; [JsonProperty(PropertyName = "Kit 1 (Icon Url)")] public string Kit1Image { get; set; } = "https://i.ibb.co/y8HH02h/carkitblack.png"; [JsonProperty(PropertyName = "Kit 1 (kit name ID)")] public string Kit1Command { get; set; } = "car1"; [JsonProperty(PropertyName = "Kit 1 (Price)")] public int CostKit1 { get; set; } = 0; [JsonProperty(PropertyName = "Kit 2 (kit Title)")] public string CarKitTitle2 { get; set; } = "Carkit 2 description"; [JsonProperty(PropertyName = "Kit 2 (Icon Url)")] public string Kit2Image { get; set; } = "https://i.ibb.co/znytJJg/carkitblue.png"; [JsonProperty(PropertyName = "Kit 2 (kit name ID)")] public string Kit2Command { get; set; } = "car2"; [JsonProperty(PropertyName = "Kit 2 (Price)")] public int CostKit2 { get; set; } = 0; [JsonProperty(PropertyName = "Kit 3 (kit Title)")] public string CarKitTitle3 { get; set; } = "Carkit 3 description"; [JsonProperty(PropertyName = "Kit 3 (Icon Url)")] public string Kit3Image { get; set; } = "https://i.ibb.co/wcRWGfv/carkityellow.png"; [JsonProperty(PropertyName = "Kit 3 (kit name ID)")] public string Kit3Command { get; set; } = "car3"; [JsonProperty(PropertyName = "Kit 3 (Price)")] public int CostKit3 { get; set; } = 0; [JsonProperty(PropertyName = "Kit 4 (kit Title)")] public string CarKitTitle4 { get; set; } = "Carkit 4 description"; [JsonProperty(PropertyName = "Kit 4 (Icon Url)")] public string Kit4Image { get; set; } = "https://i.ibb.co/JBmNcC0/carkitpink.png"; [JsonProperty(PropertyName = "Kit 4 (kit name ID)")] public string Kit4Command { get; set; } = "car4"; [JsonProperty(PropertyName = "Kit 4 (Price)")] public int CostKit4 { get; set; } = 0; [JsonProperty(PropertyName = "Kit 5 (kit Title)")] public string CarKitTitle5 { get; set; } = "Carkit 5 description"; [JsonProperty(PropertyName = "Kit 5 (Icon Url)")] public string Kit5Image { get; set; } = "https://i.ibb.co/R3SXcvY/carkitred.png"; [JsonProperty(PropertyName = "Kit 5 (kit name ID)")] public string Kit5Command { get; set; } = "car5"; [JsonProperty(PropertyName = "Kit 5 (Price)")] public int CostKit5 { get; set; } = 0; [JsonProperty(PropertyName = "Kit 6 (kit Title)")] public string CarKitTitle6 { get; set; } = "Carkit 6 description"; [JsonProperty(PropertyName = "Kit 6 (Icon Url)")] public string Kit6Image { get; set; } = "https://i.ibb.co/Fs0VqDQ/carkitgreen.png"; [JsonProperty(PropertyName = "Kit 6 (kit name ID)")] public string Kit6Command { get; set; } = "car6"; [JsonProperty(PropertyName = "Kit 6 (Price)")] public int CostKit6 { get; set; } = 0; //item prices and image cfg [JsonProperty(PropertyName = "Lift (Icon Url)")] public string LiftImage { get; set; } = "https://i.ibb.co/Sfd2kxH/modularcarlift.png"; [JsonProperty(PropertyName = "Lift (Button Text)")] public string LiftBttnTXT { get; set; } = "Get A lift"; [JsonProperty(PropertyName = "lift (Price)")] public int CostLift { get; set; } = 2500; [JsonProperty(PropertyName = "Simple Cockpit (Image Url)")] public string SimpleCockpitLogo { get; set; } = "https://i.ibb.co/tcg16yg/vehicle-1mod-cockpit.png"; [JsonProperty(PropertyName = "Simple Cockpit (Price)")] public int CostModCockpit { get; set; } = 1000; [JsonProperty(PropertyName = "Armored Cockpit (Image Url)")] public string ArmoredCockpitLogo { get; set; } = "https://i.ibb.co/SPvDV9c/vehicle-1mod-cockpit-armored.png"; [JsonProperty(PropertyName = "Armored Cockpit (Price)")] public int CostModCockpitArmored { get; set; } = 1500; [JsonProperty(PropertyName = "Cockpit+Engine (Image Url)")] public string EngineCockpitLogo { get; set; } = "https://i.ibb.co/TtLNz4G/vehicle-1mod-cockpit-with-engine.png"; [JsonProperty(PropertyName = "Cockpit+Engine (Price)")] public int CostModCockpitEngine { get; set; } = 1250; [JsonProperty(PropertyName = "Large Fuell Tank (Image Url)")] public string LargeFuellTankLogo { get; set; } = "https://i.ibb.co/2YSbbRD/vehicle-2mod-fuel-tank.png"; [JsonProperty(PropertyName = "Large Fuelltank (Price)")] public int CostModFuelltank { get; set; } = 1000; [JsonProperty(PropertyName = "Engine (Image Url)")] public string EngineLogo { get; set; } = "https://i.ibb.co/1dzkVVV/vehicle-1mod-engine.png"; [JsonProperty(PropertyName = "Engine (Price)")] public int CostModEngine { get; set; } = 1250; [JsonProperty(PropertyName = "Short Flatbed (Image Url)")] public string ShortFlatbedLogo { get; set; } = "https://i.ibb.co/s62zLrg/vehicle-1mod-flatbed.png"; [JsonProperty(PropertyName = "Short Flatbed (Price)")] public int CostSingleFlatbed { get; set; } = 1000; [JsonProperty(PropertyName = "Long Flatbed (Image Url)")] public string LongFlatbedLogo { get; set; } = "https://i.ibb.co/VNMpXtp/vehicle-2mod-flatbed.png"; [JsonProperty(PropertyName = "Long Flatbed (Price)")] public int CostDualFlatbed { get; set; } = 1250; [JsonProperty(PropertyName = "Passenger Module (Image Url)")] public string PassengersLogo { get; set; } = "https://i.ibb.co/3cBtXSL/vehicle-2mod-passengers.png"; [JsonProperty(PropertyName = "Passenger Module (Price)")] public int CostPassengers { get; set; } = 1500; [JsonProperty(PropertyName = "Rear Seat (Image Url)")] public string RearseatLogo { get; set; } = "https://i.ibb.co/KLJsdXQ/vehicle-1mod-rear-seats.png"; [JsonProperty(PropertyName = "Rear Seat (Price)")] public int CostRearSeat { get; set; } = 1250; [JsonProperty(PropertyName = "Storage Module Image Url")] public string StorageLogo { get; set; } = "https://i.ibb.co/BN2qFzp/vehicle-1mod-storage.png"; [JsonProperty(PropertyName = "Storage Module (Price RP")] public int CostStorage { get; set; } = 1500; [JsonProperty(PropertyName = "Armored Passenger Module (Image Url)")] public string ArmoredPassModuleLogo { get; set; } = "https://rustlabs.com/img/items180/vehicle.1mod.passengers.armored.png"; [JsonProperty(PropertyName = "Armored Passenger Module (Price)")] public int CostModPassModuleArmored { get; set; } = 1500; [JsonProperty(PropertyName = "Taxi Module (Image Url)")] public string TaxiModuleLogo { get; set; } = "https://i.ibb.co/HCLzx2S/vehicle-1mod-taxi.png"; [JsonProperty(PropertyName = "Taxi Module (Price)")] public int CostModTaxi { get; set; } = 1500; [JsonProperty(PropertyName = "Camper Module (Image Url)")] public string CamperModuleLogo { get; set; } = "https://i.ibb.co/kQN6XQC/vehicle-2mod-camper.png"; [JsonProperty(PropertyName = "Camper Module (Price)")] public int CostModCamper { get; set; } = 2000; [JsonProperty(PropertyName = "Pistons Icon Url")] public string PistonImage { get; set; } = "https://i.ibb.co/2qh1Q0G/pistons.png"; [JsonProperty(PropertyName = "LQ Piston (Price)")] public int CostLowPiston { get; set; } = 500; [JsonProperty(PropertyName = "MQ Piston (Price)")] public int CostMedPiston { get; set; } = 750; [JsonProperty(PropertyName = "HQ Piston (Price)")] public int CostHighPiston { get; set; } = 1000; [JsonProperty(PropertyName = "Crankshafts Icon Url")] public string CrankshaftImage { get; set; } = "https://i.ibb.co/THY34QF/cranks.png"; [JsonProperty(PropertyName = "LQ Crankshaft (Price)")] public int CostLowCrank { get; set; } = 500; [JsonProperty(PropertyName = "MQ Crankshaft (Price)")] public int CostMedCrank { get; set; } = 750; [JsonProperty(PropertyName = "HQ Crankshaft (Price)")] public int CostHighCrank { get; set; } = 1000; [JsonProperty(PropertyName = "Sparkplugs Icon Url")] public string SparkplugImage { get; set; } = "https://i.ibb.co/YQ3g4sf/plugs.png"; [JsonProperty(PropertyName = "LQ Sparkplug (Price)")] public int CostLowPlug { get; set; } = 500; [JsonProperty(PropertyName = "MQ Sparkplug (Price)")] public int CostMedPlug { get; set; } = 750; [JsonProperty(PropertyName = "HQ Sparkplug (Price)")] public int CostHighPlug { get; set; } = 1000; [JsonProperty(PropertyName = "Valves Icon Url")] public string ValvesImage { get; set; } = "https://i.ibb.co/qkYPV9R/valves.png"; [JsonProperty(PropertyName = "LQ Valve (Price)")] public int CostLowValve { get; set; } = 500; [JsonProperty(PropertyName = "MQ Valve (Price)")] public int CostMedValve { get; set; } = 750; [JsonProperty(PropertyName = "HQ Valve (Price)")] public int CostHighValve { get; set; } = 1000; [JsonProperty(PropertyName = "Carburetor Icon Url")] public string CarbsImage { get; set; } = "https://i.ibb.co/Wk9yQqz/carbs.png"; [JsonProperty(PropertyName = "LQ Carburetor (Price)")] public int CostLowCarb { get; set; } = 500; [JsonProperty(PropertyName = "MQ Carburetor (Price)")] public int CostMedCarb { get; set; } = 750; [JsonProperty(PropertyName = "HQ Carburetor (Price)")] public int CostHighCarb { get; set; } = 1000; // car and chasis Settings [JsonProperty(PropertyName = "Small Chassis (image Url)")] public string Chas2Image { get; set; } = "https://i.ibb.co/VMbLdzN/chas2.png"; [JsonProperty(PropertyName = "Small Chassis (Price)")] public int CostChas2 { get; set; } = 2500; [JsonProperty(PropertyName = "Medium Chassis (image Url)")] public string Chas3Image { get; set; } = "https://i.ibb.co/q0QRcqn/chas3.png"; [JsonProperty(PropertyName = "Medium Chassis (Price)")] public int CostChas3 { get; set; } = 3500; [JsonProperty(PropertyName = "Large Chassis (image Url)")] public string Chas4Image { get; set; } = "https://i.ibb.co/164Fxxs/chas4.png"; [JsonProperty(PropertyName = "Large Chassis (Price)")] public int CostChas4 { get; set; } = 4500; [JsonProperty(PropertyName = "Small Car (image Url)")] public string Car2Image { get; set; } = "https://i.ibb.co/Tk38DWd/howard-schechtman-car1.jpg"; [JsonProperty(PropertyName = "Small Car (Price)")] public int CostCar2 { get; set; } = 5000; [JsonProperty(PropertyName = "Nedium Car (image Url)")] public string Car3Image { get; set; } = "https://i.ibb.co/vJWGtcw/howard-schechtman-car2.jpg"; [JsonProperty(PropertyName = "Medium Car (Price)")] public int CostCar3 { get; set; } = 7500; [JsonProperty(PropertyName = "Large Car (image Url)")] public string Car4Image { get; set; } = "https://i.ibb.co/zXpDRht/howard-schechtman-car3.jpg"; [JsonProperty(PropertyName = "Large Car (Price)")] public int CostCar4 { get; set; } = 10000; } class NPC { [JsonProperty(PropertyName = "Use NPC shop")] public bool UseNPC = false; [JsonProperty(PropertyName = "NPC Id's")] public List NPCID = new List(); } private bool LoadConfigVariables() { try { configData = Config.ReadObject(); } catch { return false; } SaveConf(); return true; } protected override void LoadDefaultConfig() { Puts("Creating new config file."); configData = new ConfigData(); SaveConf(); } void SaveConf() => Config.WriteObject(configData, true); #endregion #region LanguageAPI protected override void LoadDefaultMessages() { lang.RegisterMessages(new Dictionary { ["OnlyNPC"] = "The garage is only available at the Garage NPC in Town", ["NoPermission"] = "You do not have permission to use that command!", ["InvalidInput"] = "Please enter a valid command!", ["IndoorsBlocked"] = "You cannot spawn indoors only outside!", ["Info"] = "\n\n/garage ui : to open the Garage Shop.\n/givelift to buy a lift directly", ["Cooldown"] = "You are still on a cooldown!", ["Lift"] = "You just recieved a lift!", ["BoughtSmallCar"] = "You just Bought a Small Car, Have fun!", ["BoughtMediumCar"] = "You just Bought a Medium Car, Have fun!", ["BoughtlargeCar"] = "You just Bought a Large Car, Have fun!", ["BoughtSmallChas"] = "You just Bought a Small Chassis, Have fun!", ["BoughtMediumChas"] = "You just Bought a Medium Chassis, Have fun!", ["BoughtlargeChas"] = "You just Bought a Large Chassis, Have fun!", ["FreeCar"] = "You just Got a free Car, Have fun!", ["FreeChas"] = "You just Got a free Chassis, Have fun!", ["Nokit"] = "No kit has been assigned!", ["ReceivedCockpit"] = "You just recieved a simple cockpit!", ["ReceivedCockpitArmored"] = "You just recieved a Armored Cockpit!", ["ReceivedCockpitEngine"] = "You just recieved a Cockpit with a Engine attached!", ["ReceivedFuelltank"] = "You just recieved a empty Large Fuelltank!", ["ReceivedEngine"] = "You just recieved a Engine Module!", ["ReceivedSingleFlatbed"] = "You just recieved a short Flatbed Module!", ["ReceivedDualFlatbed"] = "You just recieved a Long Flatbed Module!", ["ReceivedPassengers"] = "You just recieved a Passenger Module!", ["ReceivedRearseat"] = "You just recieved a Rear Seat Module!", ["ReceivedStoragemodule"] = "You just recieved a Storage Module!", ["ReceivedArmoredPasmodule"] = "You just recieved a Passengers Armored Module!", ["ReceivedTaximodule"] = "You just recieved a Taxi Module!", ["ReceivedCamper"] = "You just recieved a Camper Module!", ["ReceivedLowPart"] = "You just recieved a Low quality engine part!", ["ReceivedMedPart"] = "You just recieved a Medium quality engine part!", ["ReceivedHighPart"] = "You just recieved a High quality engine part!", ["Spawned"] = "You spawned a {0}!", ["NoBallance"] = "You Dont have enough points!", ["NotSet"] = "This currency is not set to true or not installed on this server!", ["Prefix"] = "[Garage] ", ["UIFreeBanner"] = "For having Permission ,You get Items for Free " }, this); } #endregion #region Commands Main [Command("garage")] private void Spawn(IPlayer player, string command, string[] args) { if (player.IsServer) { return; } string prefix = lang.GetMessage("Prefix", this, player.Id); string infos = lang.GetMessage("Info", this, player.Id); if (args.Length < 1) { if (permission.UserHasPermission(player.Id, GarageUse_Perm)) { GarageUI(player.Object as BasePlayer); return; } else { player.Message(prefix + lang.GetMessage("OnlyNPC", this, player.Id)); return; } } switch (args[0]) { case "ui": { if (permission.UserHasPermission(player.Id, GarageUse_Perm)) { GarageUI(player.Object as BasePlayer); break; } else { player.Message(prefix + lang.GetMessage("OnlyNPC", this, player.Id)); break; } } case "info": { player.Reply(prefix + lang.GetMessage("Version : V" + this.Version.ToString() + " By : " + this.Author.ToString(), this, player.Id) + infos); break; } default: player.Reply(prefix + lang.GetMessage("InvalidInput", this, player.Id)); break; } } #endregion #region CUI #region UI Close void Unload() { foreach (BasePlayer player in BasePlayer.activePlayerList) { DestroyMenu(player); DestroyMenu1(player); DestroyMenu2(player); } } void OnPlayerDisconnected(BasePlayer player) { DestroyMenu(player); DestroyMenu1(player); DestroyMenu2(player); } void OnPlayerDeath(BasePlayer player, HitInfo info) { DestroyMenu(player); DestroyMenu1(player); DestroyMenu2(player); } void DestroyMenu(BasePlayer player)=> CuiHelper.DestroyUi(player, "GarageUI"); void DestroyMenu1(BasePlayer player)=> CuiHelper.DestroyUi(player, "GarageUI1"); void DestroyMenu2(BasePlayer player)=> CuiHelper.DestroyUi(player, "GarageUI2"); #endregion #region Main page void GarageUI(BasePlayer player) { DestroyMenu(player); var elements = new CuiElementContainer(); var mainName = elements.Add(new CuiPanel { Image = { Color = $"0.1 0.1 0.1 0.2", Material = "assets/content/ui/uibackgroundblur.mat" }, RectTransform = { AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = $"-450 -255", OffsetMax = $"450 275" }, CursorEnabled = true, FadeOut = 0.1f }, "Overlay", "GarageUI"); if (configData.UseBackgroundImage == true) { elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.BackgroundImage}", Color = string.Format($"1 1 1 {configData.BckgrndAlpha}"), FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = $"0 0", AnchorMax = $"1 1" } } }); } elements.Add(new CuiLabel { Text = { Text = $"{configData.GarageTitle}",Color = $"{configData.GarageTextClr}", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.95", AnchorMax = "1 1" } }, mainName); // cars and chasis Small elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Chas2Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.075 0.700", AnchorMax = "0.175 0.875" } } }); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Car2Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.525 0.700", AnchorMax = "0.625 0.875" } } }); elements.Add(new CuiButton { Button = { Command = "GiveChas2", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.075 0.600", AnchorMax = "0.175 0.675" }, Text = { Text = $"Small Chassis\nOccasion for ${configData.CostChas2}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiButton { Button = { Command = "Givecar2", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.525 0.600", AnchorMax = "0.625 0.675" }, Text = { Text = $"Small Car\nOccasion for ${configData.CostCar2}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); //cars and chassis Medium elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Chas3Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.225 0.700", AnchorMax = "0.325 0.875" } } }); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Car3Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.675 0.700", AnchorMax = "0.775 0.875" } } }); elements.Add(new CuiButton { Button = { Command = "GiveChas3", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.225 0.600", AnchorMax = "0.325 0.675" }, Text = { Text = $"Medium Chassis\nOccasion for ${configData.CostChas3}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiButton { Button = { Command = "Givecar3", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.675 0.600", AnchorMax = "0.775 0.675" }, Text = { Text = $"Medium Car\nOccasion for ${configData.CostCar3}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); //cars and chassis Large elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Chas4Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.375 0.700", AnchorMax = "0.475 0.875" } } }); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Car4Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.825 0.700", AnchorMax = "0.925 0.875" } } }); elements.Add(new CuiButton { Button = { Command = "GiveChas4", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.375 0.600", AnchorMax = "0.475 0.675" }, Text = { Text = $"Large Chassis\nOccasion for ${configData.CostChas4}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiButton { Button = { Command = "Givecar4", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.825 0.600", AnchorMax = "0.925 0.675" }, Text = { Text = $"Large Car\nOccasion for ${configData.CostCar4}", Color = $"{configData.BtnTextClr}", FontSize = 11, Align = TextAnchor.MiddleCenter } }, mainName); // kit 1 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit1Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.075 0.175", AnchorMax = "0.175 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle1}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.075 0.175", AnchorMax = "0.175 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit1", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.075 0.125", AnchorMax = "0.175 0.175" }, Text = { Text = $"Get for ${configData.CostKit1}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); //kit 2 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit2Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.225 0.175", AnchorMax = "0.325 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle2}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.225 0.175", AnchorMax = "0.325 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit2", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.225 0.125", AnchorMax = "0.325 0.175" }, Text = { Text = $"Get for ${configData.CostKit2}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); //kit 3 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit3Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.375 0.175", AnchorMax = "0.475 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle3}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.375 0.175", AnchorMax = "0.475 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit3", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.375 0.125", AnchorMax = "0.475 0.175" }, Text = { Text = $"Get for ${configData.CostKit3}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); //kit 4 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit4Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.525 0.175", AnchorMax = "0.625 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle4}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.525 0.175", AnchorMax = "0.625 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit4", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.525 0.125", AnchorMax = "0.625 0.175" }, Text = { Text = $"Get for ${configData.CostKit4}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); //kit 5 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit5Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.675 0.175", AnchorMax = "0.775 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle5}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.675 0.175", AnchorMax = "0.775 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit5", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.675 0.125", AnchorMax = "0.775 0.175" }, Text = { Text = $"Get for ${configData.CostKit5}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); //kit 6 elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.Kit6Image}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.825 0.175", AnchorMax = "0.925 0.375" } } }); elements.Add(new CuiLabel { Text = { Text = $"{configData.CarKitTitle6}", Color = "1 1 1 0.90", FontSize = 12, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.825 0.175", AnchorMax = "0.925 0.225" } }, mainName); elements.Add(new CuiButton { Button = { Command = "CarKit6", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.825 0.125", AnchorMax = "0.925 0.175" }, Text = { Text = $"Get for ${configData.CostKit6}", Color = $"{configData.BtnTextKitClr}", FontSize = 14, Align = TextAnchor.MiddleCenter } }, mainName); // Welcome player message elements.Add(new CuiLabel { Text = { Text = $"welcome {player.displayName}",Color = $"{configData.GarageTextClr}", FontSize = 18 , Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0", AnchorMax = "1 0.05" } }, mainName); // version number elements.Add(new CuiLabel { Text = { Text = $"Version : V{this.Version.ToString()}",Color = $"{configData.GarageTextClr}", FontSize = 11 , Align = TextAnchor.MiddleRight }, RectTransform = { AnchorMin = "0.80 0.0", AnchorMax = "0.99 0.05" } }, mainName); // close and page buttons elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.MainPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" } } }); elements.Add(new CuiButton { Button = { Command = "Garagepage1", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" }, Text = { Text = "Main", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.ModulesPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" } } }); elements.Add(new CuiButton { Button = { Command = "Garagepage2", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" }, Text = { Text = "Modules", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.PartsPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" } } }); elements.Add(new CuiButton { Button = { Command = "Garagepage3", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" }, Text = { Text = "Parts", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName); elements.Add(new CuiElement { Parent = "GarageUI", Components = { new CuiRawImageComponent { Url = $"{configData.ClosePageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" } } }); elements.Add(new CuiButton { Button = { Command = "GarageClose1", Color = $"{configData.BtnCloseClr}" }, RectTransform = { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" }, Text = { Text = "Leave", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName); // if Nocost if (permission.UserHasPermission(player.UserIDString, NoCost_Perm)) { elements.Add(new CuiLabel { Text = { Text = lang.GetMessage("UIFreeBanner", this), Color = "1 1 1 0.90", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.05", AnchorMax = "1 0.09" } }, mainName); } CuiHelper.AddUi(player, elements); } #endregion #region Vehicle Modules void GarageUI1(BasePlayer player) { DestroyMenu(player); var elements1 = new CuiElementContainer(); var mainName1 = elements1.Add(new CuiPanel { Image = { Color = $"0.1 0.1 0.1 0.2", Material = "assets/content/ui/uibackgroundblur.mat" }, RectTransform = { AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = $"-450 -255", OffsetMax = $"450 275" }, CursorEnabled = true, FadeOut = 0.1f }, "Overlay", "GarageUI1"); if (configData.UseBackgroundImage == true) { elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.BackgroundImage}", Color = string.Format($"1 1 1 {configData.BckgrndAlpha}"), FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = $"0 0", AnchorMax = $"1 1" } } }); } elements1.Add(new CuiLabel { Text = { Text = $"{configData.GarageTitle}",Color = $"{configData.GarageTextClr}", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.95", AnchorMax = "1 1" } }, mainName1); #region First row // First row modules : simple cockpit elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.SimpleCockpitLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.025 0.700", AnchorMax = "0.125 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Simple Cockpit", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.025 0.66", AnchorMax = "0.125 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modcockpit", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.025 0.60", AnchorMax = "0.125 0.65" }, Text = { Text = $"Buy for ${configData.CostModCockpit}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules: armored cockpit elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.ArmoredCockpitLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.150 0.700", AnchorMax = "0.250 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Armored Cockpit", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.150 0.66", AnchorMax = "0.250 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modcockpitarmored", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.150 0.60", AnchorMax = "0.250 0.65" }, Text = { Text = $"Buy for ${configData.CostModCockpitArmored}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules : engine cockpit elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.EngineCockpitLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.275 0.700", AnchorMax = "0.375 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Engine Cockpit", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.275 0.66", AnchorMax = "0.375 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModCockpitEngine", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.275 0.60", AnchorMax = "0.375 0.65" }, Text = { Text = $"Buy for ${configData.CostModCockpitEngine}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules : Large Fuell Tank elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.LargeFuellTankLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.400 0.700", AnchorMax = "0.500 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Large Fuell Tank", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.400 0.66", AnchorMax = "0.500 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModFuelltank", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.400 0.60", AnchorMax = "0.500 0.65" }, Text = { Text = $"Buy for ${configData.CostModFuelltank}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules: Engine elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.EngineLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.525 0.700", AnchorMax = "0.625 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Engine", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.525 0.66", AnchorMax = "0.625 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModEngine", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.525 0.60", AnchorMax = "0.625 0.65" }, Text = { Text = $"Buy for ${configData.CostModEngine}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules : Short flatbed module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.ShortFlatbedLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.650 0.700", AnchorMax = "0.750 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Short Flatbed", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.650 0.66", AnchorMax = "0.750 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modsingleflatbed", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.650 0.60", AnchorMax = "0.750 0.65" }, Text = { Text = $"Buy for ${configData.CostSingleFlatbed}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // First row modules : Caravan module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.LongFlatbedLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.775 0.700", AnchorMax = "0.875 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Long Flatbed", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.775 0.66", AnchorMax = "0.875 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "moddualflatbed", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.775 0.60", AnchorMax = "0.875 0.65" }, Text = { Text = $"Buy for ${configData.CostDualFlatbed}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // Second row modules : Taxi Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.TaxiModuleLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.900 0.700", AnchorMax = "0.995 0.875" } } }); elements1.Add(new CuiLabel { Text = { Text = "Taxi Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.900 0.66", AnchorMax = "0.995 0.71" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModTaxi", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.900 0.60", AnchorMax = "0.995 0.65" }, Text = { Text = $"Buy for ${configData.CostModTaxi}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); #endregion #region Second row // Second row modules : Camper Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.CamperModuleLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.025 0.28", AnchorMax = "0.125 0.455" } } }); elements1.Add(new CuiLabel { Text = { Text = "Camper Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.025 0.23", AnchorMax = "0.125 0.28" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modcamper", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.025 0.17", AnchorMax = "0.125 0.22" }, Text = { Text = $"Buy for ${configData.CostModCamper}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // Second row modules : Passenger Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.PassengersLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.150 0.28", AnchorMax = "0.250 0.455" } } }); elements1.Add(new CuiLabel { Text = { Text = "Passenger Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.150 0.23", AnchorMax = "0.250 0.28" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modpassenger", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.150 0.17", AnchorMax = "0.250 0.22" }, Text = { Text = $"Buy for ${configData.CostPassengers}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // Second row modules : Rearseat Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.RearseatLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.275 0.28", AnchorMax = "0.375 0.455" } } }); elements1.Add(new CuiLabel { Text = { Text = "Rearseat Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.275 0.23", AnchorMax = "0.375 0.28" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "modrearseat", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.275 0.17", AnchorMax = "0.375 0.22" }, Text = { Text = $"Buy for ${configData.CostRearSeat}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // Second row modules : Storage Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.StorageLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.400 0.28", AnchorMax = "0.500 0.455" } } }); elements1.Add(new CuiLabel { Text = { Text = "Storage Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.400 0.23", AnchorMax = "0.500 0.28" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModStorage", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.400 0.17", AnchorMax = "0.500 0.22" }, Text = { Text = $"Buy for ${configData.CostStorage}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // Second row modules : Armored Passengers Module elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.ArmoredPassModuleLogo}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.525 0.28", AnchorMax = "0.625 0.455" } } }); elements1.Add(new CuiLabel { Text = { Text = "Armored Passengers Module", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.525 0.23", AnchorMax = "0.625 0.28" } }, mainName1); elements1.Add(new CuiButton { Button = { Command = "ModPasArmored", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.525 0.17", AnchorMax = "0.625 0.22" }, Text = { Text = $"Buy for ${configData.CostModPassModuleArmored}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); #endregion // Welcome player message elements1.Add(new CuiLabel { Text = { Text = $"welcome {player.displayName}",Color = $"{configData.GarageTextClr}", FontSize = 18 , Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0", AnchorMax = "1 0.05" } }, mainName1); // version number elements1.Add(new CuiLabel { Text = { Text = $"Version : V{this.Version.ToString()}",Color = $"{configData.GarageTextClr}", FontSize = 11 , Align = TextAnchor.MiddleRight }, RectTransform = { AnchorMin = "0.80 0.0", AnchorMax = "0.99 0.05" } }, mainName1); // close and page buttons elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.MainPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" } } }); elements1.Add(new CuiButton { Button = { Command = "Garagepage1", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" }, Text = { Text = "Main", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.ModulesPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" } } }); elements1.Add(new CuiButton { Button = { Command = "Garagepage2", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" }, Text = { Text = "Modules", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.PartsPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" } } }); elements1.Add(new CuiButton { Button = { Command = "Garagepage3", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" }, Text = { Text = "Parts", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); elements1.Add(new CuiElement { Parent = "GarageUI1", Components = { new CuiRawImageComponent { Url = $"{configData.ClosePageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" } } }); elements1.Add(new CuiButton { Button = { Command = "GarageClose1", Color = $"{configData.BtnCloseClr}" }, RectTransform = { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" }, Text = { Text = "Leave", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName1); // if Nocost if (permission.UserHasPermission(player.UserIDString, NoCost_Perm)) { elements1.Add(new CuiLabel { Text = { Text = lang.GetMessage("UIFreeBanner", this), Color = "1 1 1 0.90", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.05", AnchorMax = "1 0.09" } }, mainName1); } CuiHelper.AddUi(player, elements1); } #endregion #region Engine Parts void GarageUI2(BasePlayer player) { DestroyMenu(player); var elements2 = new CuiElementContainer(); var mainName2 = elements2.Add(new CuiPanel { Image = { Color = $"0.1 0.1 0.1 0.2", Material = "assets/content/ui/uibackgroundblur.mat" }, RectTransform = { AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = $"-450 -255", OffsetMax = $"450 275" }, CursorEnabled = true, FadeOut = 0.1f }, "Overlay", "GarageUI2"); if (configData.UseBackgroundImage == true) { elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.BackgroundImage}", Color = string.Format($"1 1 1 {configData.BckgrndAlpha}"), FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = $"0 0", AnchorMax = $"1 1" } } }); } elements2.Add(new CuiLabel { Text = { Text = $"{configData.GarageTitle}",Color = $"{configData.GarageTextClr}", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.95", AnchorMax = "1 1" } }, mainName2); { // Pistons elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.PistonImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.05 0.54", AnchorMax = "0.20 0.84" } } }); elements2.Add(new CuiLabel { Text = { Text = "Pistons", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.05 0.48", AnchorMax = "0.20 0.53" } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartLowPiston", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.05 0.42", AnchorMax = "0.20 0.47" }, Text = { Text = $"Low Q Piston ${configData.CostLowPiston}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartMedPiston", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.05 0.36", AnchorMax = "0.20 0.41" }, Text = { Text = $"Med Q Piston ${configData.CostMedPiston}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartHighPiston", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.05 0.30", AnchorMax = "0.20 0.35" }, Text = { Text = $"High Q Piston ${configData.CostHighPiston}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); // Crankshafts elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.CrankshaftImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.225 0.54", AnchorMax = "0.375 0.84" } } }); elements2.Add(new CuiLabel { Text = { Text = "Crankshaft", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.225 0.48", AnchorMax = "0.375 0.53" } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartLowCrank", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.225 0.42", AnchorMax = "0.375 0.47" }, Text = { Text = $"Low Q Crankshaft ${configData.CostLowCrank}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartMedCrank", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.225 0.36", AnchorMax = "0.375 0.41" }, Text = { Text = $"Med Q Crankshaft ${configData.CostMedCrank}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartHighCrank", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.225 0.30", AnchorMax = "0.375 0.35" }, Text = { Text = $"High Q Crankshaft ${configData.CostHighCrank}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); // Sparkplugs elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.SparkplugImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.400 0.54", AnchorMax = "0.550 0.84" } } }); elements2.Add(new CuiLabel { Text = { Text = "Sparkplugs", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.400 0.48", AnchorMax = "0.550 0.53" } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartLowPlug", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.400 0.42", AnchorMax = "0.550 0.47" }, Text = { Text = $"Low Q Sparkplug ${configData.CostLowPlug}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartMedPlug", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.400 0.36", AnchorMax = "0.550 0.41" }, Text = { Text = $"Med Q Sparkplug ${configData.CostMedPlug}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartHighPlug", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.400 0.30", AnchorMax = "0.550 0.35" }, Text = { Text = $"High Q Sparkplug ${configData.CostHighPlug}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); // Valves elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.ValvesImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.575 0.54", AnchorMax = "0.725 0.84" } } }); elements2.Add(new CuiLabel { Text = { Text = "Valves", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.575 0.48", AnchorMax = "0.725 0.53" } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartLowValve", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.575 0.42", AnchorMax = "0.725 0.47" }, Text = { Text = $"Low Q Valve ${configData.CostLowValve}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartMedValve", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.575 0.36", AnchorMax = "0.725 0.41" }, Text = { Text = $"Med Q Valve ${configData.CostMedValve}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartHighValve", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.575 0.30", AnchorMax = "0.725 0.35" }, Text = { Text = $"High Q Valve ${configData.CostHighValve}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); // Carburetors elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.CarbsImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.750 0.54", AnchorMax = "0.900 0.84" } } }); elements2.Add(new CuiLabel { Text = { Text = "Carburetors", Color = "1 1 1 0.90", FontSize = 11, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0.750 0.48", AnchorMax = "0.900 0.53" } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartLowCarb", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.750 0.42", AnchorMax = "0.900 0.47" }, Text = { Text = $"Low Q Carburetor ${configData.CostLowCarb}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartMedCarb", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.750 0.36", AnchorMax = "0.900 0.41" }, Text = { Text = $"Med Q Carburetor ${configData.CostMedCarb}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiButton { Button = { Command = "PartHighCarb", Color = $"{configData.BtnClr}" }, RectTransform = { AnchorMin = "0.750 0.30", AnchorMax = "0.900 0.35" }, Text = { Text = $"High Q Carburetor ${configData.CostHighCarb}", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); //lift elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.LiftImage}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "0.500 0.050", AnchorMax = "0.650 0.30" } } }); elements2.Add(new CuiButton { Button = { Command = "GiveLift", Color = $"{configData.BtnLiftClr}" }, RectTransform = { AnchorMin = "0.325 0.100", AnchorMax = "0.475 0.200" }, Text = { Text = $"{configData.LiftBttnTXT} ${configData.CostLift}", Color = $"{configData.BtnLiftTextClr}", FontSize = 16, Align = TextAnchor.MiddleCenter } }, mainName2);} // Welcome player message elements2.Add(new CuiLabel { Text = { Text = $"welcome {player.displayName}",Color = $"{configData.GarageTextClr}", FontSize = 18 , Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0", AnchorMax = "1 0.05" } }, mainName2); // version number elements2.Add(new CuiLabel { Text = { Text = $"Version : V{this.Version.ToString()}",Color = $"{configData.GarageTextClr}", FontSize = 11 , Align = TextAnchor.MiddleRight }, RectTransform = { AnchorMin = "0.80 0.0", AnchorMax = "0.99 0.05" } }, mainName2); // close and page buttons elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.MainPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" } } }); elements2.Add(new CuiButton { Button = { Command = "Garagepage1", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.760", AnchorMax = "1.07 0.880" }, Text = { Text = "Main", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.ModulesPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" } } }); elements2.Add(new CuiButton { Button = { Command = "Garagepage2", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.605", AnchorMax = "1.07 0.725" }, Text = { Text = "Modules", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.PartsPageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" } } }); elements2.Add(new CuiButton { Button = { Command = "Garagepage3", Color = $"{configData.MenuBtnClr}" }, RectTransform = { AnchorMin = "1 0.450", AnchorMax = "1.07 0.570" }, Text = { Text = "Parts", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); elements2.Add(new CuiElement { Parent = "GarageUI2", Components = { new CuiRawImageComponent { Url = $"{configData.ClosePageIcon}", FadeIn = 0f }, new CuiRectTransformComponent { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" } } }); elements2.Add(new CuiButton { Button = { Command = "GarageClose1", Color = $"{configData.BtnCloseClr}" }, RectTransform = { AnchorMin = "1 0.295", AnchorMax = "1.07 0.415" }, Text = { Text = "Leave", FontSize = 12, Align = TextAnchor.MiddleCenter } }, mainName2); // if Nocost if (permission.UserHasPermission(player.UserIDString, NoCost_Perm)) { elements2.Add(new CuiLabel { Text = { Text = lang.GetMessage("UIFreeBanner", this), Color = "1 1 1 0.90", FontSize = 18, Align = TextAnchor.MiddleCenter }, RectTransform = { AnchorMin = "0 0.05", AnchorMax = "1 0.09" } }, mainName2); } CuiHelper.AddUi(player, elements2); } #endregion #region internal UI commands [Command("GarageClose")] private void GarageClose(IPlayer player, string command, string[] args) { if (player == null) return; DestroyMenu(player.Object as BasePlayer); } [Command("Garagepage1")] private void Garagepage1(IPlayer player, string command, string[] args) { if (player == null) return; DestroyMenu1(player.Object as BasePlayer); DestroyMenu2(player.Object as BasePlayer); GarageUI(player.Object as BasePlayer); } [Command("Garagepage2")] private void Garagepage2(IPlayer player, string command, string[] args) { if (player == null) return; DestroyMenu(player.Object as BasePlayer); DestroyMenu1(player.Object as BasePlayer); GarageUI1(player.Object as BasePlayer); } [Command("Garagepage3")] private void Garagepage3(IPlayer player, string command, string[] args) { if (player == null) return; DestroyMenu1(player.Object as BasePlayer); DestroyMenu2(player.Object as BasePlayer); GarageUI2(player.Object as BasePlayer); } [Command("GarageClose1")] private void GarageClose1(IPlayer player, string command, string[] args) { if (player == null) return; DestroyMenu(player.Object as BasePlayer); DestroyMenu1(player.Object as BasePlayer); DestroyMenu2(player.Object as BasePlayer); } #endregion #endregion #region commands int #region car Kits [Command("CarKit1")]//Kit 1 private void CarKit1(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit1Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit1Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit1 ({configData.Kit1Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit1) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit1, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit1Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit1 ({configData.Kit1Command}) for {configData.CostKit1} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit1 ({configData.Kit1Command}) for {configData.CostKit1} RP but was {configData.CostKit1 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit1) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit1 ({configData.Kit1Command}) for {configData.CostKit1} Eco but was {configData.CostKit1 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit1)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit1Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit1 ({configData.Kit1Command}) for {configData.CostKit1} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit3 ({configData.Kit1Command}) with eco or rp points , but this/these is/are deactivated", this); } } [Command("CarKit2")]//Kit 2 private void CarKit2(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit2Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit2Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit3 ({configData.Kit2Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit2) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit2, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit2Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit2 ({configData.Kit2Command}) for {configData.CostKit2} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit2 ({configData.Kit2Command}) for {configData.CostKit2} RP but was {configData.CostKit2 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit2) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit2 ({configData.Kit2Command}) for {configData.CostKit2} Eco but was {configData.CostKit2 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit2)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit2Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit3 ({configData.Kit2Command}) for {configData.CostKit2} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit3 ({configData.Kit2Command}) with eco or rp points , but this/these is/are deactivated", this); } } [Command("CarKit3")]//Kit 3 private void CarKit3(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit3Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit3Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit3 ({configData.Kit3Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit3) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit3, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit3Command}"); LogToFile("Kits" ,$"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit3 ({configData.Kit3Command}) for {configData.CostKit3} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits" ,$"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit3 ({configData.Kit3Command}) for {configData.CostKit3} RP but was {configData.CostKit3 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit3) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits" ,$"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit3 ({configData.Kit3Command}) for {configData.CostKit3} Eco but was {configData.CostKit3 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit3)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit3Command}"); LogToFile("Kits" ,$"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit3 ({configData.Kit3Command}) for {configData.CostKit3} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits" ,$"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit3 ({configData.Kit3Command}) with eco or rp points , but this/these is/are deactivated", this); } } [Command("CarKit4")]//Kit 4 private void CarKit4(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit4Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit4Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit3 ({configData.Kit4Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit4) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit4, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit4Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit4 ({configData.Kit4Command}) for {configData.CostKit4} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit4 ({configData.Kit4Command}) for {configData.CostKit4} RP but was {configData.CostKit4 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit4) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit3 ({configData.Kit4Command}) for {configData.CostKit4} Eco but was {configData.CostKit4 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit4)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit4Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit3 ({configData.Kit4Command}) for {configData.CostKit4} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit3 ({configData.Kit4Command}) with eco or rp points , but this/these is/are deactivated", this); } } [Command("CarKit5")]//Kit 5 private void CarKit5(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit5Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit5Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit5 ({configData.Kit5Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit5) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit5, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit5Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit5 ({configData.Kit5Command}) for {configData.CostKit5} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit5 ({configData.Kit5Command}) for {configData.CostKit5} RP but was {configData.CostKit5 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit5) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit5 ({configData.Kit5Command}) for {configData.CostKit5} Eco but was {configData.CostKit5 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit5)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit5Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit5 ({configData.Kit5Command}) for {configData.CostKit5} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit5 ({configData.Kit5Command}) with eco or rp points , but this/these is/are deactivated", this); } } [Command("CarKit6")]//Kit 6 private void CarKit6(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); object checkKit = Kits?.CallHook("GetKitInfo", configData.Kit6Command); if (checkKit == null) { player.Message(prefix + lang.GetMessage("Nokit", this, player.Id)); return; } if (permission.UserHasPermission(player.Id, NoCost_Perm)) { plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit6Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free kit6 ({configData.Kit6Command}) for having the Nocost permission", this); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostKit6) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostKit6, null); plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit6Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought kit6 ({configData.Kit6Command}) for {configData.CostKit6} points", this); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit6 ({configData.Kit6Command}) for {configData.CostKit6} RP but was {configData.CostKit6 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostKit6) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy kit6 ({configData.Kit6Command}) for {configData.CostKit6} Eco but was {configData.CostKit6 - Economics.Call("Balance", player.Id)} Eco short", this); return; } else { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostKit6)) plyr.SendConsoleCommand("chat.say", $"/kit {configData.Kit6Command}"); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a kit6 ({configData.Kit6Command}) for {configData.CostKit6} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Kits", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to Buy kit6 ({configData.Kit6Command}) with eco or rp points , but this/these is/are deactivated", this); } } #endregion #region Chassis [Command("GiveChas2")]//Small Chassis private void GiveChas2(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Chassis for ${configData.CostChas2} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Chassis for ${configData.CostChas2} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Chas2); } player.Message(prefix + lang.GetMessage("FreeChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Small Chassis for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostChas2) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostChas2, null); { SpawnEntity(player, Chas2); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Small Chassis for {configData.CostChas2} RP", this); player.Message(prefix + lang.GetMessage("BoughtSmallChas", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Chassis for {configData.CostChas2} RP but was {configData.CostChas2 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostChas2) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Chassis for {configData.CostChas2} Eco but was {configData.CostChas2 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostChas2)) { SpawnEntity(player, Chas2); } player.Message(prefix + lang.GetMessage("BoughtSmallChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Small Chassis for {configData.CostChas2} Eco", this); DestroyMenu(plyr); } } } } [Command("GiveChas3")]//Medium Chassis private void GiveChas3(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Chassis for ${configData.CostChas3} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Chassis for ${configData.CostChas3} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Chas3); } player.Message(prefix + lang.GetMessage("FreeChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Small Chassis for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostChas3) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostChas3, null); { SpawnEntity(player, Chas3); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Medium Chassis for {configData.CostChas3} RP", this); player.Message(prefix + lang.GetMessage("BoughtMediumChas", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Chassis for {configData.CostChas3} RP but was {configData.CostChas3 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostChas3) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Chassis for {configData.CostChas3} Eco but was {configData.CostChas3 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostChas3)) { SpawnEntity(player, Chas3); } player.Message(prefix + lang.GetMessage("BoughtMediumChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Medium Chassis for {configData.CostChas3} Eco", this); DestroyMenu(plyr); } } } } [Command("GiveChas4")]//Large Chassis private void GiveChas4(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Chassis for ${configData.CostChas4} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Chassis for ${configData.CostChas4} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Chas4); } player.Message(prefix + lang.GetMessage("FreeChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Large Chassis for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostChas4) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostChas4, null); { SpawnEntity(player, Chas4); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Large Chassis for {configData.CostChas4} RP", this); player.Message(prefix + lang.GetMessage("BoughtLargeChas", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Chassis for {configData.CostChas4} RP but was {configData.CostChas4 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostChas4) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Chassis for {configData.CostChas4} Eco but was {configData.CostChas4 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostChas4)) { SpawnEntity(player, Chas4); } player.Message(prefix + lang.GetMessage("BoughtLargeChas", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Large Chassis for {configData.CostChas4} Eco", this); DestroyMenu(plyr); } } } } #endregion #region Cars [Command("Givecar2")]//Small car private void Givecar2(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Car for ${configData.CostCar2} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Car for ${configData.CostCar2} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Car2); } player.Message(prefix + lang.GetMessage("FreeCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Small Car for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostCar2) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostCar2, null); { SpawnEntity(player, Car2); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Small Car for {configData.CostCar2} RP", this); player.Message(prefix + lang.GetMessage("BoughtSmallCar", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Car for {configData.CostCar2} RP but was {configData.CostCar2 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostCar2) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Small Car for {configData.CostCar2} Eco but was {configData.CostCar2 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostCar2)) { SpawnEntity(player, Car2); } player.Message(prefix + lang.GetMessage("BoughtSmallCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Small Car for {configData.CostCar2} Eco", this); DestroyMenu(plyr); } } } } [Command("Givecar3")]//Medium car private void Givecar3(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Car for ${configData.CostCar3} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Car for ${configData.CostCar3} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Car3); } player.Message(prefix + lang.GetMessage("FreeCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Medium Car for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostCar3) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostCar3, null); { SpawnEntity(player, Car3); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Medium Car for {configData.CostCar3} RP", this); player.Message(prefix + lang.GetMessage("BoughtMediumCar", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Car for {configData.CostCar3} RP but was {configData.CostCar3 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostCar3) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Medium Car for {configData.CostCar3} Eco but was {configData.CostCar3 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostCar3)) { SpawnEntity(player, Car3); } player.Message(prefix + lang.GetMessage("BoughtMediumCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Medium Car for {configData.CostCar3} Eco", this); DestroyMenu(plyr); } } } } [Command("Givecar4")]//Large Car private void Givecar4(IPlayer player, string command, string[] args) { BasePlayer PlayerObject = player.Object as BasePlayer; BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); if (CoolDowns.ContainsKey(player.Id)) { player.Message(prefix + lang.GetMessage("Cooldown", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Car for ${configData.CostCar4} but was still on cooldown", this); return; } if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { player.Message(prefix + lang.GetMessage("IndoorsBlocked", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Car for ${configData.CostCar4} but was Inside", this); } else { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { { SpawnEntity(player, Car4); } player.Message(prefix + lang.GetMessage("FreeCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Large Car for having the Nocost permission", this); DestroyMenu(plyr); } else if (configData.UseServerRewards == true && ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostCar4) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostCar4, null); { SpawnEntity(player, Car4); } LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Large Car for {configData.CostCar4} RP", this); player.Message(prefix + lang.GetMessage("BoughtlargeCar", this, player.Id)); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Car for {configData.CostCar4} RP but was {configData.CostCar4 - ServerRewards.Call("CheckPoints", player.Id)} RP short", this); } } else if (configData.UseEconomics == true && Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostCar4) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to Buy a Large Car for {configData.CostCar4} Eco but was {configData.CostCar4 - (double)Economics?.Call("Balance", player.Id)} Eco short", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostCar4)) { SpawnEntity(player, Car4); } player.Message(prefix + lang.GetMessage("BoughtlargeCar", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Large Car for {configData.CostCar4} Eco", this); DestroyMenu(plyr); } } } } #endregion #region Lift [Command("GiveLift")]//lift private void GiveLift(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { Item lift = ItemManager.CreateByName("modularcarlift"); lift.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("Lift", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Lift for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLift) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLift, null); { Item lift = ItemManager.CreateByName("modularcarlift"); lift.MoveToContainer(plyr.inventory.containerMain); } player.Message(prefix + lang.GetMessage("Lift", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Lift for {configData.CostLift} RP", this); DestroyMenu(plyr); } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to buy a Lift for {configData.CostLift} RP but didnt have enough points", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Lift with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLift) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Tryed to buy a Lift for {configData.CostLift} Eco but didnt have enough points", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLift)) { Item lift = ItemManager.CreateByName("modularcarlift"); lift.MoveToContainer(plyr.inventory.containerMain); } player.Message(prefix + lang.GetMessage("Lift", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Lift for {configData.CostLift} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Lift with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Lift but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } #endregion #region Modules [Command("ModCamper")]//Camper Module private void ModCamper(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodcamper = ItemManager.CreateByName("vehicle.2mod.camper"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodcamper.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCamper", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Camper Module for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModCamper) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModCamper, null); { vehiclemodcamper.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCamper", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Camper Module for {configData.CostModCamper} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Camper Module for {configData.CostModCamper} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Camper Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModCamper) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Camper Module for {configData.CostModCamper} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModCamper)) { vehiclemodcamper.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCamper", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Camper Module for {configData.CostModCamper} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Camper Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Camper Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModCockpit")]//Simple Cockpit private void ModCockpit(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodcockpit = ItemManager.CreateByName("vehicle.1mod.cockpit"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodcockpit.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpit", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Simple cockpit for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModCockpit) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModCockpit, null); { vehiclemodcockpit.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpit", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a simple cockpit for {configData.CostModCockpit} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a simple cockpit for {configData.CostModCockpit} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Simple Cockpit with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModCockpit) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a simple cockpit for {configData.CostModCockpit} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModCockpit)) { vehiclemodcockpit.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpit", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a simple cockpit for {configData.CostModCockpit} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Simple Cockpit with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Simple cockpit but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModCockpitArmored")]//Armored cockpit private void ModCockpitArmored(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodcockpitarmored = ItemManager.CreateByName("vehicle.1mod.cockpit"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodcockpitarmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitArmored", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Armored cockpit for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModCockpitArmored) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModCockpitArmored, null); { vehiclemodcockpitarmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitArmored", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Armored cockpit for {configData.CostModCockpitArmored} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored cockpit for {configData.CostModCockpitArmored} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Cockpit with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModCockpitArmored) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored cockpit for {configData.CostModCockpitArmored} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModCockpitArmored)) { vehiclemodcockpitarmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitArmored", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Armored cockpit for {configData.CostModCockpitArmored} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Cockpit with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Armored cockpit but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModCockpitEngine")]//Cockpit with engine private void ModCockpitEngine(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodcockpitEngine = ItemManager.CreateByName("vehicle.1mod.cockpit.with.engine"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodcockpitEngine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Engine cockpit for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModCockpitEngine) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModCockpitEngine, null); { vehiclemodcockpitEngine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Engine cockpit for {configData.CostModCockpitEngine} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine cockpit for {configData.CostModCockpitEngine} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine Cockpit with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModCockpitEngine) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine cockpit for {configData.CostModCockpitEngine} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModCockpitEngine)) { vehiclemodcockpitEngine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedCockpitEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Engine cockpit for {configData.CostModCockpitEngine} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine Cockpit with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Engine cockpit but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModFuelltank")]//FuellTank private void ModFuelltank(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodfuelltank = ItemManager.CreateByName("vehicle.2mod.fuel.tank"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodfuelltank.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedFuelltank", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free FuellTank for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModFuelltank) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModFuelltank, null); { vehiclemodfuelltank.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedFuelltank", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a FuellTank for {configData.CostModFuelltank} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a FuellTank for {configData.CostModFuelltank} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a FuellTank with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModFuelltank) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a FuellTank for {configData.CostModFuelltank} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModFuelltank)) { vehiclemodfuelltank.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedFuelltank", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a FuellTank for {configData.CostModFuelltank} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a FuellTank with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free FuellTank but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModEngine")]//Engine private void ModEngine(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partengine = ItemManager.CreateByName("vehicle.1mod.engine"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partengine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Engine for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModEngine) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModEngine, null); { partengine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Engine for {configData.CostModEngine} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine for {configData.CostModEngine} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModEngine) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine for {configData.CostModEngine} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModEngine)) { partengine.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedEngine", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Engine for {configData.CostModEngine} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Engine with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Engine but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModSingleFlatbed")]//Short Flatbed private void ModSingleFlatbed(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodshortflatbed = ItemManager.CreateByName("vehicle.1mod.flatbed"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodshortflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedSingleFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free short Fatbed for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostSingleFlatbed) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostSingleFlatbed, null); { vehiclemodshortflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedSingleFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a short Fatbed for {configData.CostSingleFlatbed} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a short Flatbed for {configData.CostSingleFlatbed} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a short Flatbed with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostSingleFlatbed) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a short Flatbed for {configData.CostSingleFlatbed} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostSingleFlatbed)) { vehiclemodshortflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedSingleFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a short Flatbed for {configData.CostSingleFlatbed} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a short Flatbed with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free short Flatbed but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModDualFlatbed")]//Long Flatbed Module for RP private void ModDualFlatbed(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodlongflatbed = ItemManager.CreateByName("vehicle.2mod.flatbed"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodlongflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedDualFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free long Fatbed for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostDualFlatbed) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostDualFlatbed, null); { vehiclemodlongflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedDualFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a long Fatbed for {configData.CostDualFlatbed} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a long Flatbed for {configData.CostDualFlatbed} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a long Flatbed with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostDualFlatbed) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a long Flatbed for {configData.CostDualFlatbed} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostDualFlatbed)) { vehiclemodlongflatbed.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedDualFlatbed", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a long Flatbed for {configData.CostDualFlatbed} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a long Flatbed with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free long Flatbed but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModPassenger")]//Passangers module for RP private void ModPassenger(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodpassenger = ItemManager.CreateByName("vehicle.2mod.passengers"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodpassenger.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedPassengers", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free long Fatbed for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostPassengers) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostPassengers, null); { vehiclemodpassenger.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedPassengers", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a long Fatbed for {configData.CostPassengers} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Passengers Module for {configData.CostPassengers} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Passengers Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostPassengers) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Passengers Module for {configData.CostPassengers} Eco but didnt had enough", this); return; } else if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostPassengers)) { vehiclemodpassenger.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedPassengers", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Passengers Module for {configData.CostPassengers} Eco", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Passengers Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Passengers Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModRearseat")]//Rearseat Module for RP private void ModRearseat(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodrearseat = ItemManager.CreateByName("vehicle.1mod.rear.seats"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodrearseat.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedRearseat", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Rearseat Module for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostRearSeat) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostRearSeat, null); { vehiclemodrearseat.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedRearseat", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Rearseat Module for {configData.CostRearSeat} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Rearseat Module for {configData.CostRearSeat} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Rearseat Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostRearSeat) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Rearseat Module for {configData.CostRearSeat} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostRearSeat)) { vehiclemodrearseat.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedRearseat", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Rearseat Module for {configData.CostRearSeat} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Rearseat Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Rearseat Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModStorage")]//Storage Module for RP private void ModStorage(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodStorage = ItemManager.CreateByName("vehicle.1mod.storage"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodStorage.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedStoragemodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Storage Module for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostStorage) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostStorage, null); { vehiclemodStorage.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedStoragemodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Storage Module for {configData.CostStorage} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Storage Module for {configData.CostStorage} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Storage Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostStorage) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Storage Module for {configData.CostStorage} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostStorage)) { vehiclemodStorage.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedStoragemodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Storage Module for {configData.CostStorage} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Storage Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Storage Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModPasArmored")]//Armored Passengers Module for RP private void ModPasArmored(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodPasArmored = ItemManager.CreateByName("vehicle.1mod.passengers.armored"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodPasArmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedArmoredPasmodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Armored Passengers Module for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModPassModuleArmored) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModPassModuleArmored, null); { vehiclemodPasArmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedArmoredPasmodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Armored Passengers Module for {configData.CostModPassModuleArmored} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Passengers Module for {configData.CostModPassModuleArmored} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Passengers Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModPassModuleArmored) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Passengers Module for {configData.CostModPassModuleArmored} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModPassModuleArmored)) { vehiclemodPasArmored.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedArmoredPasmodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Armored Passengers Module for {configData.CostModPassModuleArmored} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Armored Passengers Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Armored Passengers Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("ModTaxi")]//Armored Passengers Module for RP private void ModTaxi(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item vehiclemodTaxi = ItemManager.CreateByName("vehicle.1mod.taxi"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { vehiclemodTaxi.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedTaximodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Taxi Module for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostModTaxi) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostModTaxi, null); { vehiclemodTaxi.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedTaximodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Taxi Module for {configData.CostModTaxi} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Taxi Module for {configData.CostModTaxi} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Taxi Module with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostModTaxi) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Taxi Module for {configData.CostModTaxi} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostModTaxi)) { vehiclemodTaxi.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedTaximodule", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Taxi Module for {configData.CostModTaxi} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Taxi Module with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Taxi Module but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } #endregion #region Engine Parts [Command("PartLowPiston")]//low Q piston for RP private void PartLowPiston(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partpiston = ItemManager.CreateByName("piston1"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partpiston.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Low Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLowPiston) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLowPiston, null); { partpiston.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Piston for {configData.CostLowPiston} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston for {configData.CostLowPiston} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLowPiston) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston for {configData.CostLowPiston} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLowPiston)) { partpiston.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Piston for {configData.CostLowPiston} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Low Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartMedPiston")]//Med Q Piston for RP private void PartMedPiston(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partpiston2 = ItemManager.CreateByName("piston2"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partpiston2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Med Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostMedPiston) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostMedPiston, null); { partpiston2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Piston for {configData.CostMedPiston} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston for {configData.CostMedPiston} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostMedPiston) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston for {configData.CostMedPiston} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostMedPiston)) { partpiston2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Piston for {configData.CostMedPiston} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Med Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartHighPiston")]//HQ piston for RP private void PartHighPiston(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partpiston3 = ItemManager.CreateByName("piston3"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partpiston3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free High Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostHighPiston) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostHighPiston, null); { partpiston3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Piston for {configData.CostHighPiston} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston for {configData.CostHighPiston} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostHighPiston) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston for {configData.CostHighPiston} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostHighPiston)) { partpiston3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Piston for {configData.CostHighPiston} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free High Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartLowCrank")] private void PartLowCrank(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcrankshaft1 = ItemManager.CreateByName("crankshaft1"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcrankshaft1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Low Quality Crankshaft for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLowCrank) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLowCrank, null); { partcrankshaft1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Crankshaft for {configData.CostLowCrank} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Crankshaft for {configData.CostLowCrank} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Crankshaft with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLowCrank) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Crankshaft for {configData.CostLowCrank} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLowCrank)) { partcrankshaft1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Crankshaft for {configData.CostLowCrank} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Crankshaft with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Low Quality Crankshaft but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartMedCrank")] private void PartMedCrank(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcrankshaft2 = ItemManager.CreateByName("crankshaft2"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcrankshaft2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Med Quality Crankshaft for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostMedCrank) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostMedCrank, null); { partcrankshaft2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Crankshaft for {configData.CostMedCrank} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Crankshaft for {configData.CostMedCrank} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Crankshaft with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostMedCrank) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Crankshaft for {configData.CostMedCrank} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostMedCrank)) { partcrankshaft2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Crankshaft for {configData.CostMedCrank} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Crankshaft with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Med Quality Crankshaft but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartHighCrank")]//HQ crankshaft for RP private void PartHighCrank(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcrankshaft3 = ItemManager.CreateByName("crankshaft3"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcrankshaft3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free High Quality Crankshaft for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostHighCrank) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostHighCrank, null); { partcrankshaft3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Crankshaft for {configData.CostHighCrank} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Crankshaft for {configData.CostHighCrank} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Crankshaft with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostHighCrank) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Crankshaft for {configData.CostHighCrank} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostHighCrank)) { partcrankshaft3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Crankshaft for {configData.CostHighCrank} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Crankshaft with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free High Quality Crankshaft but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartLowPlug")]//low quality sparkplug for RP private void PartLowPlug(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partplug1 = ItemManager.CreateByName("sparkplug1"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partplug1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Low Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLowPlug) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLowPlug, null); { partplug1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Piston for {configData.CostLowPlug} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston for {configData.CostLowPlug} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLowPlug) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston for {configData.CostLowPlug} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLowPlug)) { partplug1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Piston for {configData.CostLowPlug} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Low Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartMedPlug")]//Medium quality sparkplug for RP private void PartMedPlug(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partplug2 = ItemManager.CreateByName("sparkplug2"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partplug2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Med Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostMedPlug) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostMedPlug, null); { partplug2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Piston for {configData.CostMedPlug} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston for {configData.CostMedPlug} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostMedPlug) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston for {configData.CostMedPlug} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostMedPlug)) { partplug2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Piston for {configData.CostMedPlug} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Med Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartHighPlug")]//HQ sparkplug for RP private void PartHighPlug(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partplug3 = ItemManager.CreateByName("sparkplug3"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partplug3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free High Quality Piston for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostHighPlug) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostHighPlug, null); { partplug3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Piston for {configData.CostHighPlug} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston for {configData.CostHighPlug} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostHighPlug) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston for {configData.CostHighPlug} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostHighPlug)) { partplug3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Piston for {configData.CostHighPlug} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Piston with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free High Quality Piston but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartLowValve")]//LQ valve for RP private void PartLowValve(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partvalve1 = ItemManager.CreateByName("valve1"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partvalve1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Low Quality Valve for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLowValve) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLowValve, null); { partvalve1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Valve for {configData.CostLowValve} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Valve for {configData.CostLowValve} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Valve with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLowValve) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Valve for {configData.CostLowValve} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLowValve)) { partvalve1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Valve for {configData.CostLowValve} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Valve with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Low Quality Valve but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartMedValve")]//Medium Q Valve for RP private void PartMedValve(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partvalve2 = ItemManager.CreateByName("valve2"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partvalve2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Med Quality Valve for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostMedValve) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostMedValve, null); { partvalve2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Valve for {configData.CostMedValve} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Valve for {configData.CostMedValve} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Valve with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostMedValve) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Valve for {configData.CostMedValve} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostMedValve)) { partvalve2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Valve for {configData.CostMedValve} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Valve with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Med Quality Valve but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartHighValve")]//HQ valve For RP private void PartHighValve(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partvalve3 = ItemManager.CreateByName("valve3"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partvalve3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free High Quality Valve for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostHighValve) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostHighValve, null); { partvalve3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Valve for {configData.CostHighValve} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Valve for {configData.CostHighValve} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Valve with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostHighValve) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Valve for {configData.CostHighValve} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostHighValve)) { partvalve3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Valve for {configData.CostHighValve} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Valve with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free High Quality Valve but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartLowCarb")]//LQ carburetor for RP private void PartLowCarb(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcarb1 = ItemManager.CreateByName("carburetor1"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcarb1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Low Quality Carburetor for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostLowCarb) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostLowCarb, null); { partcarb1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Carburetor for {configData.CostLowCarb} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Carburetor for {configData.CostLowCarb} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Carburetor with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostLowCarb) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Carburetor for {configData.CostLowCarb} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostLowCarb)) { partcarb1.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedLowPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Low Quality Carburetor for {configData.CostLowCarb} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Low Quality Carburetor with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Low Quality Carburetor but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartMedCarb")]//Medium Quality carburetor for RP private void PartMedCarb(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcarb2 = ItemManager.CreateByName("carburetor2"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcarb2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free Med Quality Carburetor for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostMedCarb) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostMedCarb, null); { partcarb2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Carburetor for {configData.CostMedCarb} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Carburetor for {configData.CostMedCarb} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Carburetor with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostMedCarb) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Carburetor for {configData.CostMedCarb} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostMedCarb)) { partcarb2.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedMedPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a Med Quality Carburetor for {configData.CostMedCarb} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a Med Quality Carburetor with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free Med Quality Carburetor but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } [Command("PartHighCarb")]//HQ Carburetor for RP private void PartHighCarb(IPlayer player, string command, string[] args) { BasePlayer plyr = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); Item partcarb3 = ItemManager.CreateByName("carburetor3"); { if (permission.UserHasPermission(player.Id, NoCost_Perm)) { partcarb3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} got a Free High Quality Carburetor for having the Nocost permission", this); } else if (configData.UseServerRewards == true) { if (ServerRewards == true) { int points = ServerRewards.Call("CheckPoints", player.Id); if (points >= configData.CostHighCarb) { ServerRewards?.Call("TakePoints", player.Id, (int)configData.CostHighCarb, null); { partcarb3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Carburetor for {configData.CostHighCarb} RP", this); } } else { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Carburetor for {configData.CostHighCarb} RP but didnt had enough", this); } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Carburetor with RP points , but this is deactivated", this); } } else if (configData.UseEconomics == true) { if (Economics == true) { double points = (double)Economics?.Call("Balance", player.Id); if (points < configData.CostHighCarb) { player.Message(prefix + lang.GetMessage("NoBallance", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Carburetor for {configData.CostHighCarb} Eco but didnt had enough", this); return; } { if ((bool)Economics?.Call("Withdraw", player.Id, (double)configData.CostHighCarb)) { partcarb3.MoveToContainer(plyr.inventory.containerMain); player.Message(prefix + lang.GetMessage("ReceivedHighPart", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} Bought a High Quality Carburetor for {configData.CostHighCarb} Eco", this); } } } else { player.Message(prefix + lang.GetMessage("NotSet", this, player.Id)); LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to buy a High Quality Carburetor with Eco points , but this is deactivated", this); } } else { LogToFile("Sales", $"{DateTime.Now:h:mm:ss tt}] {player.Id} {player.Name} tryed to get a Free High Quality Carburetor but found a glitch or had no permission!!!!!", this); player.Message(prefix + lang.GetMessage("NoPermission", this, player.Id)); } } } #endregion #endregion #region Functions void OnUseNPC(BasePlayer npc, BasePlayer player, Vector3 destination) { if (configData.Npcs.NPCID != null && configData.Npcs.NPCID.Contains(npc.UserIDString) && UseNPCBool) { if (permission.UserHasPermission(player.UserIDString, NPC_Perm)) { GarageUI(player); } } } void SpawnEntity(IPlayer player, string entity_name) { BasePlayer PlayerObject = player.Object as BasePlayer; string prefix = lang.GetMessage("Prefix", this, player.Id); #region Cooldown if (!player.HasPermission(NoCooldown_Perm)) { if (CoolDowns.ContainsKey(player.Id)) { player.Reply(prefix + lang.GetMessage("Cooldown", this, player.Id)); return; } else { string id = player.Id; Timer Cooldown = timer.Once(Convert.ToInt32(Config["Cooldown"]), () => { CoolDowns.Remove(id); }); CoolDowns.Add(id, Cooldown); } } #endregion #region Building Check if (!(bool)Config["BuildingSpawn"] & !PlayerObject.IsOutside()) { return; } #endregion #region Raycast Vector3 ViewAdjust = new Vector3(0f, 1.5f, 0f); Vector3 position = PlayerObject.transform.position + ViewAdjust + Vector3.forward * 5f;//set to 3 as minimum it will spawn wright next to you(5 is safe) Vector3 rotation = Quaternion.Euler(PlayerObject.serverInput.current.aimAngles) * Vector3.forward; int range = 30; RaycastHit hit; if (!Physics.Raycast(position, rotation, out hit, range)) { return; } #endregion #region Actual Spawning BaseEntity Entity = GameManager.server.CreateEntity(entity_name, hit.point); if (Entity) { Entity.Spawn(); } #endregion } #endregion } }