/// <summary> /// Создает лидера клана /// </summary> private void CreateLeader(ClanInfo clanInfo) { var ped = _pointCreator.CreatePed( clanInfo.LeaderHash, clanInfo.LeaderName, clanInfo.LeaderPosition, clanInfo.LeaderRotation, clanInfo.LeaderMarker, Colors.VividCyan ); if (clanInfo.ClanId == 3) { var bitches = API.createPed(PedHash.Tanisha, new Vector3(-124.01, -642.23, 168.82), 0); API.setEntityRotation(bitches, new Vector3(0.00, 0.00, 41.92)); } ped.ColShape.onEntityEnterColShape += (shape, entity) => { PlayerHelper.ProcessAction(entity, player => { if (!HasRight(player, clanInfo.ClanId, ClanRank.Lowest)) { return; } API.triggerClientEvent( player, ServerEvent.SHOW_CLAN_LEADER_MENU, (int)clanInfo.ClanId, ClanMissionManager.GetMissionVotes(clanInfo.ClanId), ClanManager.GetAuthority(clanInfo.ClanId) ); }); }; ped.ColShape.onEntityExitColShape += (shape, entity) => { var player = API.getPlayerFromHandle(entity); API.triggerClientEvent(player, ServerEvent.HIDE_CLAN_LEADER_MENU); }; }
/// <summary> /// Создать продавца /// </summary> private void CreateSeller(ClothesShopModel shop) { var seller = _pointCreator.CreatePed(shop.Seller, "Продавец", shop.SellerPosition, shop.SellerRotation, shop.MarkerPosition, Colors.VividCyan); seller.ColShape.onEntityEnterColShape += (shape, entity) => OnPlayerComeToSeller(entity, shop); seller.ColShape.onEntityExitColShape += OnPlayerAwayFromSeller; }
/// <summary> /// Создает медсестру /// </summary> private void CreateNurse(int dimension) { var ped = _pointCreator.CreatePed(PedHash.Soucentmc01AFM, "Медсестра", _nursePosition, _nurseRotation, _nurseMarker, Colors.VividCyan, dimension); ped.ColShape.onEntityEnterColShape += PlayerComeToNurse; ped.ColShape.onEntityExitColShape += PlayerAwayFromNurse; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var point = _pointCreator.CreatePed( PedHash.PrologueHostage01, "Рыбак Сьюзен", MainPosition.FishingVillage, new Vector3(0.00, 0.00, -51.61), new Vector3(1300.68, 4321.40, 37.35), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Инициализировать заправку внутри /// </summary> private void InitializeInside(FillingModel station) { var pedPositions = PositionConverter.ToListVector3(station.NpcPositions); var ped = _pointCreator.CreatePed(PedHash.GuadalopeCutscene, "Продавец", pedPositions[0], pedPositions[1], pedPositions[2], Colors.VividCyan); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToSeller(entity, station.Id, station.District); ped.ColShape.onEntityExitColShape += PlayerComeAwayFromSeller; }
/// <summary> /// Инициализировать магазин внутри /// </summary> private void InitializeInside(ShopModel shop) { var pedPositions = PositionConverter.ToListVector3(shop.NpcPositions); var ped = _pointCreator.CreatePed(PedHash.Sweatshop01SFY, "Продавец", pedPositions[0], pedPositions[1], pedPositions[2], Colors.VividCyan); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToSeller(entity, shop.District); ped.ColShape.onEntityExitColShape += PlayerComeAwayFromSeller; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var pedMarkerPos = new Vector3(-509.62, -954.46, 22.79); var point = _pointCreator.CreatePed( PedHash.Dockwork01SMM, "Прораб Стивен", MainPosition.Building, new Vector3(0, 0, -149.1), pedMarkerPos, Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var ped = _pointCreator.CreatePed( PedHash.Ammucity01SMY, "Эвакуаторщик Джереми", MainPosition.ParkingFine, new Vector3(0.00, 0.00, -126.44), new Vector3(408.57, -1624.97, 28.39), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, PlayerComeToNpc); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, PlayerAwayFromNpc); }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var ped = _pointCreator.CreatePed( PedHash.Gardener01SMM, "Прораб Боб", MainPosition.TextileMill, new Vector3(0, 0, -90), new Vector3(770.95, -1318.42, 25.33), Colors.Yellow ); ped.ColShape.onEntityEnterColShape += OnEntityEnterColShape; ped.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var ped = _pointCreator.CreatePed( PedHash.BurgerDrug, NAME, MainPosition.Bistro, new Vector3(0.00, 0.00, 52.77), new Vector3(154.27, -1431.29, 28.36), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += PlayerComeToNpc; ped.ColShape.onEntityExitColShape += PlayerAwayFromNpc; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var point = _pointCreator.CreatePed( PedHash.Dockwork01SMY, "Прораб Джон", MainPosition.ScrapMetalDump, new Vector3(0, 0, -15), new Vector3(-426.54, -1719.75, 18.28), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { _pointCreator.CreateBlip(MainPosition.BusDriver, 513, 47, name: "Автобусный парк"); var point = _pointCreator.CreatePed( PedHash.ONeil, "Онэил", MainPosition.BusDriver, new Vector3(0, 0, -100), new Vector3(46.5, -843.66, 29.97), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var point = _pointCreator.CreatePed( PedHash.Cop01SFY, "Офицер Сара", new Vector3(440.98, -979.0, 30.69), new Vector3(0, 0, 178.9), new Vector3(441.03, -981.27, 29.79), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var point = _pointCreator.CreatePed( PedHash.Andreas, "Инспектор Андреас", new Vector3(1156.85, -3198.15, -39.01), new Vector3(0.00, 0.00, -87.29), new Vector3(1157.65, -3198.13, -39.81), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var npc = _pointCreator.CreatePed( PedHash.Farmer01AMM, "Фермер Роберт", MainPosition.Farm, new Vector3(0.00, 0.00, 42.24), new Vector3(2931.27, 4625.05, 47.82), Colors.VividCyan ); npc.ColShape.onEntityEnterColShape += OnEntityEnterColShape; npc.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { _pointCreator.CreateBlip(MainPosition.TaxiDriver, 56, 46, name: "Таксопарк"); var point = _pointCreator.CreatePed( PedHash.ArmLieut01GMM, "Луи", MainPosition.TaxiDriver, new Vector3(0, 0, 80), new Vector3(211.36, -808.47, 29.93), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += OnEntityEnterColShape; point.ColShape.onEntityExitColShape += OnEntityExitColShape; }
/// <summary> /// Создает нпс во всех аэропортах /// </summary> private void CreateNpcs() { foreach (var npcData in AirPortData.Npcs) { _pointCreator.CreateBlip(npcData.Position, 572, 53, name: "Работа лётчиком"); var npc = _pointCreator.CreatePed(npcData.Hash, npcData.Name, npcData.Position, npcData.Rotation, npcData.MarkerPosition, Colors.VividCyan); npc.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToNpc(entity, npcData.Contracts); npc.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.HIDE_PILOT_MENU)); } }
/// <summary> /// Создать продавца /// </summary> private void CreateSeller(VehicleShowroomModel showroom) { var name = showroom.Type == ShowroomType.Cheap ? "Саймон" : "Консультант"; var seller = _pointCreator.CreatePed( showroom.Seller, name, showroom.SellerPosition, showroom.SellerRotation, showroom.SellerMarkerPosition, Colors.VividCyan ); seller.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToSeller(entity, showroom); seller.ColShape.onEntityExitColShape += PlayerAwayFromSeller; }
/// <summary> /// Создать нпс парковки /// </summary> public void Initialize() { _pointCreator.CreateBlip(MainPosition.Parking, 524, 41, name: "Главная парковка"); var ped = _pointCreator.CreatePed( PedHash.TrafficWarden, "Парковщик Себастьян", MainPosition.Parking, new Vector3(0.00, 0.00, 84.02), new Vector3(-346.20, -822.24, 30.64), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, PlayerComeToNpc); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, PlayerAwayFromNpc); }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { _pointCreator.CreateBlip(MainPosition.Race, 315, 69, name: "Гонки"); var ped = _pointCreator.CreatePed( PedHash.Bevhills02AMM, "Пол", MainPosition.Race, new Vector3(0.00, 0.00, -33.72), new Vector3(-1650.48, -957.17, 6.79), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToNpc(entity); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.HIDE_RACE_MENU)); }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { _pointCreator.CreateBlip(MainPosition.StreetFights, 311, 49, name: "Уличные драки"); var ped = _pointCreator.CreatePed( PedHash.StrPunk02GMY, "Тайлер", MainPosition.StreetFights, new Vector3(0.00, 0.00, 84.50), new Vector3(-22.78, -1228.62, 28.43), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.SHOW_FIGHT_MENU, StreetFights.Members.Count)); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.HIDE_FIGHT_MENU)); }
/// <summary> /// Создает точки доставки /// </summary> public void CreatePoints() { var deliveryPoints = BistroPositionsGetter.DeliveryPoints; for (var num = 0; num < deliveryPoints.Count; num++) { var point = deliveryPoints[num]; var shape = API.createSphereColShape(point.Point, 1.5f); var ped = _pointCreator.CreatePed(point.Hash, point.PedPosition, point.PedRotation); shape.onEntityEnterColShape += (colShape, entity) => PlayerComeToPoint(colShape, entity, ped, point.IsMale); shape.onEntityExitColShape += (colShape, entity) => PlayerAwayFromPoint(colShape, entity, ped); shape.setData(POINT_NUMBER_KEY, num); } }
/// <summary> /// Инициализирует квест /// </summary> public override void Initialize() { ClientEventHandler.Add(ClientEvent.FINISH_DRUG_DELIVERY_POINT, OnFinishDelivery); foreach (var npc in DrugDealers.Npcs) { _pointCreator.CreatePed(npc.Hash, npc.Position, npc.Rotation); var shape = API.createCylinderColShape(npc.ShapePosition, 1.5f, 2f); shape.setData(SHAPE_INDEX, npc.Index); shape.onEntityEnterColShape += (colShape, entity) => ProcessShapeEvent(shape, entity, player => player.setSyncedData(ON_TARGET_POINT, true)); shape.onEntityExitColShape += (colShape, entity) => ProcessShapeEvent(shape, entity, player => player.resetSyncedData(ON_TARGET_POINT)); } }
/// <summary> /// Инизиализировать морской торговый порт /// </summary> public override void Initialize() { foreach (var truckerNpc in TruckersDataGetter.TruckerNpcs) { _pointCreator.CreateBlip(truckerNpc.Position, 477, 21, name: "Грузоперевозка"); var ped = _pointCreator.CreatePed( truckerNpc.Hash, truckerNpc.Name, truckerNpc.Position, truckerNpc.Rotation, truckerNpc.MarkerPosition, Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToNpc(entity, truckerNpc.Contracts); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerAwayFromNpc(entity); } CreateTrucks(); _truckersManager.Initialize(); }
/// <summary> /// Создать нпс /// </summary> public void Initialize() { var npcs = GetNpcsPositions(); foreach (var npc in npcs) { _pointCreator.CreateBlip(npc.Position, 512, 9, name: "Аренда скутеров"); var point = _pointCreator.CreatePed( PedHash.ChiGoon01GMM, "Аренда скутеров", npc.Position, npc.Rotation, npc.MarkerPosition.Add(new Vector3(0, 0, 0.1f)), Colors.VividCyan ); point.ColShape.onEntityEnterColShape += (shape, entity) => { OnEntityEnterColShape(entity, npc.ScooterPosition, npc.ScooterRotation, npc.District); }; point.ColShape.onEntityExitColShape += OnEntityExitColShape; } }
/// <summary> /// Инизиализировать место /// </summary> public override void Initialize() { ClientEventHandler.Add(ClientEvent.BUY_WEAPON, BuyWeapon); ClientEventHandler.Add(ClientEvent.BUY_AMMO, BuyAmmo); foreach (var shop in AmmuNationData.Shops) { _pointCreator.CreateBlip(shop.LeftDoorPosition, 110, 45, name: shop.Name); var leftDoodId = _doormanager.Register(97297972, shop.LeftDoorPosition); var rightDoorId = _doormanager.Register(-8873588, shop.RightDoorPosition); _doormanager.SetDoorState(leftDoodId, false, 1); _doormanager.SetDoorState(rightDoorId, false, 1); var seller = _pointCreator.CreatePed( PedHash.Ammucity01SMY, "Продавец", shop.SellerPosition, shop.SellerRotation, shop.Marker, Colors.VividCyan ); seller.ColShape.onEntityEnterColShape += (shape, entity) => PlayerComeToSeller(entity, shop.District); seller.ColShape.onEntityExitColShape += PlayerAwayFromSeller; } }
/// <summary> /// Инизиализировать место прыжков с парашютом /// </summary> public override void Initialize() { var position = new Vector3(-75.68, -826.21, 326.18); _pointCreator.CreateBlip(position, 377, 63, scale: 1.3f, name: "Прыжок с парашютом"); CreateEnters(); var ped = _pointCreator.CreatePed( PedHash.ExArmy01, NAME, position, new Vector3(0.00, 0.00, -15.22), new Vector3(-75.47, -825.44, 325.18), Colors.VividCyan ); ped.ColShape.onEntityEnterColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.SHOW_PARACHUTE_MENU) ); ped.ColShape.onEntityExitColShape += (shape, entity) => PlayerHelper.ProcessAction(entity, player => API.triggerClientEvent(player, ServerEvent.HIDE_PARACHUTE_MENU) ); ClientEventHandler.Add(ClientEvent.BUY_PARACHUTE, BuyParachute); }