public static void TakeMoneyOcean() { int money = Count; /* * if (User.Data.skill_builder >= 2 && User.Data.skill_builder < 4) * money = money * 2; * else if (User.Data.skill_builder >= 4 && User.Data.skill_builder < 6) * money = money * 3; * else if (User.Data.skill_builder >= 6 && User.Data.skill_builder < 8) //надо сделать когда будут навыки добавлены * money = money * 4; * else if (User.Data.skill_builder >= 8 && User.Data.skill_builder < 10) * money = money * 5; * else if (User.Data.skill_builder >= 10) * money = money * 6; * else */ money = money * 3; money = money * User.Bonus; User.AddCashMoney(money); Coffer.RemoveMoney(money); Count = 0; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_118", $"{money:#,#}")); }
public static void DeleteVeh(int money, int vehicle) { var veh = new CitizenFX.Core.Vehicle(NetToVeh(vehicle)); var vehId = Managers.Vehicle.GetVehicleIdByNumber(GetVehicleNumberPlateText(veh.Handle)); if (Main.GetDistanceToSquared(GetEntityCoords(GetPlayerPed(-1), true), GrSixMenuPos) > 50) { Notification.SendWithTime("~y~Транспорт можно сдать только на базе"); User.SetWaypoint(-42, -664); return; } if (User.CanOpenVehicle(vehId, veh.Handle)) { Notification.SendWithTime("~g~Вы сдали автомобиль "); Coffer.RemoveMoney(4500); Notification.SendWithTime($"~q~Вы окончили маршрут день и заработали: ${money}"); User.AddMoney(money + 4500); Main.FindNearestVehicle().Delete(); Characher.UpdateCloth(false); TriggerServerEvent("ARP:GrSix:ResetMoneyInCar", veh.NetworkId); MoneyInCar = 0; } else { Notification.SendWithTime("Не вы арендовали, не вам сдавать."); return; } }
public static void TakeMoney() { int money = Count; if (User.Data.skill_scrap >= 4 && User.Data.skill_scrap < 6) { money = money * 2; } else if (User.Data.skill_scrap >= 6 && User.Data.skill_scrap < 8) { money = money * 3; } else if (User.Data.skill_scrap >= 8 && User.Data.skill_scrap < 20) { money = money * 4; } else if (User.Data.skill_scrap >= 20) { money = money * 5; } money = money * User.Bonus; User.AddCashMoney(money); Coffer.RemoveMoney(money); Count = 0; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_118", $"{money:#,#}")); }
public static async void SellStock(StockInfoGlobalData h) { if (Screen.LoadingPrompt.IsActive) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_34")); return; } Client.Sync.Data.ShowSyncMessage = false; Screen.LoadingPrompt.Show("Обработка запроса, подождите"); await User.GetAllData(); var hData = await GetAllData(h.id); var playerId = User.GetServerId(); if (hData.id == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_35")); return; } if (User.Data.stock_id == 0) { Notification.SendWithTime("~r~У Вас нет недвижимости"); return; } Client.Sync.Data.Set(playerId, "stock_id", 0); await Delay(200); if (await Client.Sync.Data.Get(playerId, "stock_id") != 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_32")); return; } var nalog = hData.price * (100 - Coffer.GetNalog()) / 100; User.AddMoney(nalog); Coffer.RemoveMoney(nalog); Main.SaveLog("BuySellStock", $"[SELL] {User.Data.id} {User.Data.rp_name} | {nalog} | {User.Data.stock_id}"); User.Data.stock_id = 0; Notification.SendWithTime($"~g~{Coffer.GetNalog()}%\n~s~Получено: ~g~${nalog:#,#}"); TriggerServerEvent("ARP:UpdateStockInfo", "", 0, hData.id); User.SaveAccount(); MenuList.HideMenu(); await User.GetAllData(); Screen.LoadingPrompt.Hide(); Client.Sync.Data.ShowSyncMessage = true; }
public static void TakeMoney() { int money = Count * 3 * User.Bonus; User.AddCashMoney(money); Coffer.RemoveMoney(money); Count = 0; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_118", $"{money:#,#}")); }
public static async void Sell(int bId) { if (Screen.LoadingPrompt.IsActive) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_34")); return; } Client.Sync.Data.ShowSyncMessage = false; Screen.LoadingPrompt.Show(Lang.GetTextToPlayer("_lang_36")); CurrentData = await GetAllData(bId); if (CurrentData.id == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_35")); return; } if (User.Data.business_id == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_37")); return; } Sync.Data.Set(User.GetServerId(), "business_id", 0); await Delay(200); if (await Sync.Data.Get(User.GetServerId(), "business_id") != 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_32")); return; } var nalog = CurrentData.price * (100 - Coffer.GetNalog()) / 100; Main.SaveLog("BuySellBizz", $"[SELL] {User.Data.id} {User.Data.rp_name} | {nalog} | {User.Data.business_id}"); User.AddBankMoney(nalog); Coffer.RemoveMoney(nalog); User.Data.business_id = 0; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_38", nalog)); Sync.Data.Set(-20000 + bId, "user_id", 0); Sync.Data.Set(-20000 + bId, "user_name", ""); User.SaveAccount(); Save(CurrentData.id); Screen.LoadingPrompt.Hide(); Client.Sync.Data.ShowSyncMessage = true; }