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); }
private static async Task TimerAfk() { await Delay(1000 * 60 * 1); Main.UpdateDiscordStatus(User.GetPlayerVirtualWorld() != 0 ? "В помещении" : UI.GetPlayerZoneName()); if (User.Data.sell_car_time > 0) { User.Data.sell_car_time--; Client.Sync.Data.Set(User.GetServerId(), "sell_car_time", User.Data.sell_car_time); } if (AfkLastPos == GetEntityCoords(GetPlayerPed(-1), true)) { if (!User.IsRpAnim && new PlayerList().Count() > (Main.MaxPlayers - 5) && !User.IsDead()) { Afk++; if (User.GetVipStatus() == "Hard") { switch (Afk) { case 25: Notification.SendWithTime("~r~Вас кикнет через 5 минут за AFK"); break; case 28: Notification.SendWithTime("~r~Вас кикнет через 2 минуты за AFK"); break; case 29: Notification.SendWithTime("~r~Вас кикнет через 1 минуту за AFK"); break; case 30: User.Kick(PlayerId(), "AFK 30m"); break; } } else if (User.GetVipStatus() == "Light" || User.GetVipStatus() == "YouTube") { switch (Afk) { case 15: Notification.SendWithTime("~r~Вас кикнет через 5 минут за AFK"); break; case 18: Notification.SendWithTime("~r~Вас кикнет через 2 минуты за AFK"); break; case 19: Notification.SendWithTime("~r~Вас кикнет через 1 минуту за AFK"); break; case 20: User.Kick(PlayerId(), "AFK 20m"); break; } } else { switch (Afk) { case 5: Notification.SendWithTime("~r~Вас кикнет через 5 минут за AFK"); break; case 8: Notification.SendWithTime("~r~Вас кикнет через 2 минуты за AFK"); break; case 9: Notification.SendWithTime("~r~Вас кикнет через 1 минуту за AFK"); break; case 10: User.Kick(PlayerId(), "AFK 10m"); break; } } } } else { Afk = 0; } AfkLastPos = GetEntityCoords(GetPlayerPed(-1), true); }