public static async void SendNotification(string title, string desc, string desc2 = "", string desc3 = "") { if (await Ctos.IsBlackout()) { return; } Notification.SendPictureToFraction(desc, "Диспетчер", title, "CHAR_CALL911", Notification.TypeChatbox, 2); Notification.SendPictureToFraction(desc, "Диспетчер", title, "CHAR_CALL911", Notification.TypeChatbox, 3); Notification.SendPictureToFraction(desc, "Диспетчер", title, "CHAR_CALL911", Notification.TypeChatbox, 16); Notification.SendPictureToFraction(desc, "Диспетчер", title, "CHAR_CALL911", Notification.TypeChatbox, 7); if (desc2 != "") { await Delay(100); Notification.SendToFraction(desc2, 2); Notification.SendToFraction(desc2, 3); Notification.SendToFraction(desc2, 16); Notification.SendToFraction(desc2, 7); } if (desc3 != "") { await Delay(100); Notification.SendToFraction(desc3, 2); Notification.SendToFraction(desc3, 3); Notification.SendToFraction(desc3, 16); Notification.SendToFraction(desc3, 7); } }
public static async void SendEms(string title, string desc, Vector3 pos, bool withCoord = true, bool isPlayer = false) { if (await Ctos.IsBlackout()) { return; } var zone = UI.GetPlayerZoneName(); var street = UI.GetPlayerStreetName(); if (isPlayer) { //var pos = GetEntityCoords(GetPlayerPed(-1), true); if (User.GetPlayerVirtualWorld() > 50000) { int vw = User.GetPlayerVirtualWorld() - 50000; foreach (var item in Stock.StockGlobalDataList) { if (item.id != vw) { continue; } pos = new Vector3(item.x, item.y, item.z); street = World.GetStreetName(pos); zone = World.GetZoneLocalizedName(pos); } } else if (User.GetPlayerVirtualWorld() > 0) { int vw = User.GetPlayerVirtualWorld(); foreach (var item in House.HouseGlobalDataList) { if (item.id != vw) { continue; } pos = new Vector3(item.x, item.y, item.z); street = World.GetStreetName(pos); zone = World.GetZoneLocalizedName(pos); } } else if (User.GetPlayerVirtualWorld() < 0) { var currentData = await Apartment.GetAllData(User.GetPlayerVirtualWorld() * -1); if (currentData.id > 0) { int i = currentData.build_id; pos = new Vector3((float)Apartment.BuildList[i, 0], (float)Apartment.BuildList[i, 1], (float)Apartment.BuildList[i, 2]); street = World.GetStreetName(pos); zone = World.GetZoneLocalizedName(pos); } } } string time = World.CurrentDayTime.Hours.ToString("D2") + ":" + World.CurrentDayTime.Minutes.ToString("D2"); Shared.TriggerEventToAllPlayers("ARP:AddDispatcherEms", title, desc, zone, street, time, pos.X, pos.Y, pos.Z, withCoord); }
public static async void DrawAdditionalHud() { if (!IsShowRadar && Screen.Hud.IsVisible) { BarTimerBar network = new BarTimerBar("Сеть"); network.BackgroundColor = UnknownColors.Black; network.Height = 5; if (await Ctos.IsBlackout()) { network.Percentage = 0; network.ForegroundColor = ColorRed900; } else { if (Ctos.UserNetwork * 100 > 100) { network.ForegroundColor = ColorBlue; } else if (Ctos.UserNetwork * 100 > 60) { network.ForegroundColor = ColorWhite; } else if (Ctos.UserNetwork * 100 > 40) { network.ForegroundColor = ColorAmber; } else if (Ctos.UserNetwork * 100 > 20) { network.ForegroundColor = ColorDeepOrange; } else if (Ctos.UserNetwork * 100 > 0) { network.ForegroundColor = ColorRed; } else if (Ctos.UserNetwork * 100 <= 0) { network.ForegroundColor = ColorRed900; } network.Percentage = Ctos.UserNetwork; //network.ForegroundColor = ColorGreen; } /*if (User.Data.water_level > 60) * network.ForegroundColor = UnknownColors.Green; * else if (User.Data.water_level > 40) * network.ForegroundColor = UnknownColors.Yellow; * else if (User.Data.water_level > 20) * network.ForegroundColor = UnknownColors.Orange; * else if (User.Data.water_level > 0) * network.ForegroundColor = UnknownColors.Red; * else if (User.Data.water_level <= 0) * network.ForegroundColor = UnknownColors.DarkRed;*/ /*BarTimerBar eat = new BarTimerBar("Сытость"); * eat.BackgroundColor = UnknownColors.Black; * eat.Percentage = User.Data.eat_level / 1000f; * eat.Height = 5; * * if (eat.Percentage >= 1) * eat.Percentage = 1; * * if (User.Data.eat_level > 1000) * eat.ForegroundColor = ColorBlue; * else if (User.Data.eat_level > 600) * eat.ForegroundColor = ColorWhite; * else if (User.Data.eat_level > 400) * eat.ForegroundColor = ColorAmber; * else if (User.Data.eat_level > 200) * eat.ForegroundColor = ColorDeepOrange; * else if (User.Data.eat_level > 0) * eat.ForegroundColor = ColorRed; * else if (User.Data.eat_level <= 0) * eat.ForegroundColor = ColorRed900; * * BarTimerBar drink = new BarTimerBar("Жажда"); * drink.BackgroundColor = UnknownColors.Black; * drink.Percentage = User.Data.water_level / 100f; * drink.Height = 5; * * if (drink.Percentage >= 1) * drink.Percentage = 1; * * if (User.Data.water_level > 100) * drink.ForegroundColor = ColorBlue; * else if (User.Data.water_level > 60) * drink.ForegroundColor = ColorWhite; * else if (User.Data.water_level > 40) * drink.ForegroundColor = ColorAmber; * else if (User.Data.water_level > 20) * drink.ForegroundColor = ColorDeepOrange; * else if (User.Data.water_level > 0) * drink.ForegroundColor = ColorRed; * else if (User.Data.water_level <= 0) * drink.ForegroundColor = ColorRed900;*/ /* * BarTimerBar fuel = new BarTimerBar("Топливо"); * fuel.BackgroundColor = UnknownColors.Black; * fuel.ForegroundColor = ColorWhite; * fuel.Percentage = 1; * fuel.Height = 10; * * if (fuel.Percentage >= 1) * fuel.Percentage = 1; * * var vehId = Vehicle.GetVehicleIdByNumber(Vehicle.GetVehicleNumber(GetVehiclePedIsUsing(PlayerPedId()))); * if (vehId != -1) * { * var fuelIndicator = Convert.ToInt32((Vehicle.VehicleInfoGlobalDataList[vehId].Fuel / Vehicle.VehicleInfoGlobalDataList[vehId].FullFuel) * 100); * if (fuelIndicator > 100) * fuel.ForegroundColor = ColorBlue; * else if (fuelIndicator > 60) * fuel.ForegroundColor = ColorWhite; * else if (fuelIndicator > 40) * fuel.ForegroundColor = ColorAmber; * else if (fuelIndicator > 20) * fuel.ForegroundColor = ColorDeepOrange; * else if (fuelIndicator > 0) * fuel.ForegroundColor = ColorRed; * else if (fuelIndicator <= 0) * fuel.ForegroundColor = ColorRed900; * * fuel.Percentage = fuelIndicator / 100f; * } */ /* * TimerBarPool = new TimerBarPool(); * TimerBarPool.Add(drink); * TimerBarPool.Add(eat);*/ /*if (User.Data.phone_code > 0) * TimerBarPool.Add(network);*/ /*TimerBarPool.Add(fuel); * TimerBarPool.Add(new TextTimerBar("Скорость", $"{GetCurrentSpeed()} MP/H"));*/ //TimerBarPool.Add(new TextTimerBar("Громкость", User.VoiceString)); TimerBarPool = new TimerBarPool(); if (Business.Taxi.IsFindNpc) { TimerBarPool.Add(new TextTimerBar("", "~b~Идёт поиск клиентов")); } } else { TimerBarPool = new TimerBarPool(); } }
public static async void GrabStock() { var playerPos = GetEntityCoords(GetPlayerPed(-1), true); for (int i = 0; i < GrabPosList.Length / 4; i++) { var pos = new Vector3((float)GrabPosList[i, 1], (float)GrabPosList[i, 2], (float)GrabPosList[i, 3]); if (Main.GetDistanceToSquared(playerPos, pos) > 5f) { continue; } if (Client.Sync.Data.HasLocally(User.GetServerId(), "HasGrab")) { return; } if (new PlayerList().Count() < 10) { Notification.SendWithTime("~r~Онлайн на сервере должен быть не менее 10 человек"); return; } if (Main.GetPlayerListOnRadius(6).Count < 2) { Notification.SendWithTime("~r~Для ограбления склада нужно 2 и более человек"); return; } if (Weather.Hour < 22 && Weather.Hour > 6) { Notification.SendWithTime("~r~Можно грабить с 22 до 6 утра."); return; } if (await Client.Sync.Data.Has(1000000, (string)GrabPosList[i, 0])) { Notification.SendWithTime("~r~Склад недавно грабили"); return; } Client.Sync.Data.SetLocally(User.GetServerId(), "HasGrab", true); User.Freeze(PlayerId(), true); User.PlayAnimation("anim@heists@money_grab@duffel", "loop", 9); User.IsBlockAnimation = true; await Delay(5000); if (!Client.Sync.Data.HasLocally(User.GetServerId(), "hasBuyMask")) { Notification.Send("~r~Вас заметила камера наблюдения"); User.AddWantedLevel(2, "Оргабление склада"); } Dispatcher.SendEms("Код 3", "Всем свободным патрулям, сработала сигнализация на складе"); await Delay(120000); User.IsBlockAnimation = false; User.Freeze(PlayerId(), false); User.StopAnimation(); Client.Sync.Data.Set(1000000, (string)GrabPosList[i, 0], true); Client.Sync.Data.Set(1000000, "Timer" + (string)GrabPosList[i, 0], 24); if (Main.GetDistanceToSquared(GetEntityCoords(GetPlayerPed(-1), true), pos) > 10f) { Client.Sync.Data.ResetLocally(User.GetServerId(), "HasGrab"); Notification.Send("~r~Вы слишком далеко от места ограбления"); return; } var rand = new Random(); int money = rand.Next(800, 1100); if (Client.Sync.Data.HasLocally(User.GetServerId(), "GrabCash")) { Client.Sync.Data.SetLocally(User.GetServerId(), "GrabCash", (int)Client.Sync.Data.GetLocally(User.GetServerId(), "GrabCash") + money); } else { Client.Sync.Data.SetLocally(User.GetServerId(), "GrabCash", money); } if (!await Ctos.IsBlackout()) { PedAi.SendCode(3, false); } await Delay(500); Client.Sync.Data.ResetLocally(User.GetServerId(), "HasGrab"); SetPlayerWantedLevel(PlayerId(), 2, false); Notification.Send("~y~Вы ограбили склад"); } }