public void OnKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) foreach (var v in World.GetNearbyVehicles(Game.Player.Character.Position, 10)) v.Delete(); if (e.KeyCode == Keys.K) Function.Call(Hash.SET_TIME_SCALE, 1.0f); if (e.KeyCode == Keys.F3) Game.Player.Character.Position = _busPosition; if (e.KeyCode == Keys.J && _isTransitioning) { _driver.Delete(); Game.Player.Character.SetIntoVehicle(Game.Player.Character.CurrentVehicle, VehicleSeat.Driver); Function.Call(Hash.SET_TIME_SCALE, 1f); _isTransitioning = false; } if (e.KeyCode == Keys.F && World.GetDistance(Game.Player.Character.Position, _startPosition) < 2f && !_activateMod) { //Check for previous spawned busses foreach (var b in World.GetActiveBlips().Where(b => (b.Color == BlipColor.Blue))) b.Remove(); foreach ( var v in World.GetAllVehicles().Where(v => (v.GetPedOnSeat(VehicleSeat.Driver).Model == "A_C_Chimp"))) v.Delete(); _activateMod = true; _bus = World.CreateVehicle("Bus", _busPosition); _driver =_bus.CreatePedOnSeat(VehicleSeat.Driver, new Model("A_C_Chimp")); _busBlip = _bus.AddBlip(); _busBlip.Color = BlipColor.Blue; _busBlip.Name = "Bus"; _busBlip.ShowRoute = _busBlip.IsFriendly = true; } }
public static void Work() { if (IsWorking == false) { currentMoney = Game.Player.Money; Script.Wait(30); IsWorking = true; CustomPlayer.isWorking = true; GTA.Game.FadeScreenOut(1000); Script.Wait(1000); taxi1 = World.CreateVehicle(GTA.Native.VehicleHash.Taxi, new Vector3(-548f, 301f, 83f), 275f); Script.Wait(100); hours = Function.Call<int>(Hash.GET_CLOCK_HOURS); Script.Wait(30); Player.Character.SetIntoVehicle(taxi1, VehicleSeat.Driver); Script.Wait(1000); GTA.Game.FadeScreenIn(2000); Script.Wait(0); taxiblip = taxi1.AddBlip(); taxiblip.Sprite = BlipSprite.PersonalVehicleCar; taxiblip.Color = BlipColor.Yellow; CustomPlayer.sendMessage("Press " + Style.YELLOW + "[E]" + Style.NORMAL +" to start Taxi Missions, Return back to quit working!"); } else { Quit(); } }
protected override void populateDestructibleElements() { base.populateDestructibleElements(); vehicle = World.CreateVehicle(vehicleHash, position); vehicle.AddBlip(); vehicle.CurrentBlip.Sprite = BlipSprite.HelicopterAnimated; vehicle.CurrentBlip.Color = BlipColor.Green; vehicle.CurrentBlip.IsFlashing = true; vehicle.CurrentBlip.ShowRoute = true; }
//preparing public void prepare_mission(String _mission) { mission = _mission; bus_mod.mission = bus_mod.get_first_child();//reset list selection in menu if (_ped.Count > 1) { _ped.Clear(); //clear the ped list from previous version //when used ped.clear in _check() scripts stop working and got stuck in an infinite loop } try { //echo description string desc = get_desc(mission); List<string> sub_u = desc.Split('^').ToList(); for (int i = 0; i < sub_u.Count; i++) { UI.ShowSubtitle(sub_u[i], 4000); Script.Wait(4000); } try { generate_ped(get_ped_number());//pass add_invi();//god } catch (Exception) { UI.ShowSubtitle("GENERATE_PED_ERROR"); } add_ped_blip();//blip add_destination_blip();//dest add_ped_blip_sprite(BlipSprite.Friend);//spr try { coach = GTA.World.CreateVehicle(new Model(get_veh_hash("vehicle", 0)), new Vector3(get_co("vehicle", 0, 'x'), get_co("vehicle", 0, 'y'), get_co("vehicle", 0, 'z')), get_co("vehicle", 0, 't'));//creating our veh coach.AddBlip(); coach.CurrentBlip.Sprite = BlipSprite.Cab; coach.CurrentBlip.ShowRoute = true; coach.IsInvincible = true;//to prevent damage and mission auto-cancel before arriving } catch (Exception) { UI.ShowSubtitle("VEHICLE_ERROR"); } } catch (Exception) { UI.ShowSubtitle("PREPARE_MISSION_ERROR"); } add_relationship();//relationship }
private void prepare_veh() { try { veh = GTA.World.CreateVehicle(new Model(get_string(0)), new Vector3(get_co("vehicle", 'x'), get_co("vehicle", 'y'), get_co("vehicle", 'z')), get_co("vehicle", 't'));//creating our veh veh.AddBlip(); veh.CurrentBlip.Sprite = BlipSprite.Cab; veh.CurrentBlip.ShowRoute = true; veh.IsInvincible = true; } catch (Exception) { UI.ShowSubtitle("VEHICLE_ERROR"); } }