Exemplo n.º 1
0
        // Start tick process
        public static void onTick(object sender, EventArgs e)
        {
            iCurrentGameTime = Game.GameTime;
            iElapsedGameTime = iCurrentGameTime - iLastGameTime;
            iLastGameTime    = iCurrentGameTime;

            Game.Player.Character.Euphoria.StaggerFall.AlwaysBendForwards = true;

            // Check wantedLevel settings
            Common.wantedLevel(Common.neverWanted);

            // Day 1 options
            if (currentDay == 1)
            {
                // TODO: Has player arrived at junkYard
                // TODO: Trigger objective message (find trashTruck)

                // Is player trying to enter the locked trashTruck
                var trashTruckFound = Function.Call <bool>(Hash.IS_PED_TRYING_TO_ENTER_A_LOCKED_VEHICLE, Game.Player.Character);
                if (trashTruckFound && currentStage == 1)
                {
                    Day1.Day1Stage2();
                }
                // Have the trashTruckKeys been found?
                var trashTruckKeysExists = Function.Call <bool>(Hash.DOES_ENTITY_EXIST, Day1.trashTruckKeys);
                if (trashTruckKeysExists && currentStage == 2)
                {
                    if (Game.Player.Character.IsNearEntity(Day1.trashTruckKeys, new Vector3(1, 1, 1)))
                    {
                        Day1.Day1Stage3();
                    }
                }
                // Has the trashTruck been destroyed
                var trashTruckDestroyed = Function.Call <bool>(Hash.IS_ENTITY_DEAD, Day1.trashTruck);
                if (trashTruckDestroyed && currentStage <= 5)
                {
                    missionFailed("The ~b~Trash truck~s~ has been ~r~destroyed~s~!", currentDay, 0);
                }
                // Is player in trashTruck
                if (player.CurrentVehicle == Day1.trashTruck && currentStage == 3)
                {
                    Day1.Day1Stage4();
                }
                // Has player left trashTruck
                if (player.CurrentVehicle != Day1.trashTruck && currentStage == 4)
                {
                    // Reset to stage 3
                    Day1.Day1Stage3();
                    // Spawn trashTruck blip
                    Common.SpawnVehicleBlip(Day1.trashTruck, BlipSprite.GarbageTruck, 21, true);
                    // Display new mission objective
                    UI.ShowSubtitle("Get back into the ~b~Trash truck~s~.", 15000);
                    Common.runDebug();
                }
                // Make sure dogs always attack
                if (Day1.guardDog1Spawned && currentStage <= 4)
                {
                    Common.runToPlayer(Day1.guardDog1);
                }
                if (Day1.guardDog2Spawned && currentStage <= 4)
                {
                    Common.runToPlayer(Day1.guardDog2);
                }
            }
        }
Exemplo n.º 2
0
 public static void startDay()
 {
     // Run the Day 1 script
     Day1.Day1Stage1();
     // TODO : Track and start the next uncompleted day in the series!
 }