コード例 #1
0
        public void dtest(Client player)
        {
            DMVTest test = new DMVTest(Player.PlayerData[player]);

            API.triggerClientEvent(player, "load_test_interface");
            test.testVehicle = API.createVehicle(VehicleHash.Elegy, new Vector3(-315.8801, 6249.22, 30.89409), new Vector3(2.262521, 2.527319, 56.63427), 0, 0);
            API.setPlayerIntoVehicle(player, test.testVehicle, -1);
            test.testType    = (int)DrivingTestTypes.Car;
            test.checkpoints = carTestTestCheckpoints;
            test.speedLimits = carTestTestSpeeds;
            activeTests.Add(test);
            test.BeginTest();
        }
コード例 #2
0
        public void InitTest(Client player, int type)
        {
            DMVTest test = new DMVTest(Player.PlayerData[player])
            {
                testType = type
            };

            if (test.testType == 1 || test.testType == 2 || test.testType == 3)
            {
                API.triggerClientEvent(player, "load_test_interface");
            }

            VehicleHash?model    = null;
            Vector3     spawnLoc = null;

            if (type == 1)
            {
                Random rand = new Random();
                int    r    = rand.Next(testCars.Count);
                model    = testCars[r];
                spawnLoc = new Vector3(-342.2152, 6245.498, 30.98962);
            }
            else if (type == 2)
            {
                model    = VehicleHash.Sanchez;
                spawnLoc = new Vector3(-342.2152, 6245.498, 30.98962);
            }
            else if (type == 3)
            {
                model    = VehicleHash.Boxville;
                spawnLoc = new Vector3(-342.2152, 6245.498, 30.98962);
            }
            else if (type == 4)
            {
                model    = VehicleHash.Maverick;
                spawnLoc = new Vector3(1725.108, 3260.298, 41.77298);
            }
            else if (type == 5)
            {
                model    = VehicleHash.Vestra;
                spawnLoc = new Vector3(1725.108, 3260.298, 41.77298);
            }
            else if (type == 6)
            {
                model    = VehicleHash.Dinghy;
                spawnLoc = new Vector3(-1601.602, 5259.89, 0.1100717);
            }

            Vehicle testVeh = new Vehicle()
            {
                Model  = (int)model,
                Color1 = "1",
                Color2 = "1",
                Entity = API.createVehicle((VehicleHash)model, spawnLoc, new Vector3(0, 0, 0), 0, 0)
            };

            test.testVehicle = testVeh;
            Vehicle.VehicleData.Add(testVeh.Entity, testVeh);

            if (type == 1 || type == 2 || type == 3)
            {
                test.checkpoints = carTestCheckpoints;
                test.speedLimits = carTestSpeeds;
            }
            else if (type == 4)
            {
                test.checkpoints = heliCheckpoints;
                test.speedLimits = null;
            }
            else if (type == 5)
            {
                test.checkpoints = planeCheckpoints;
                test.speedLimits = null;
            }
            else if (type == 6)
            {
                test.checkpoints = boatCheckpoints;
                test.speedLimits = null;
            }

            activeTests.Add(test);
            API.setPlayerIntoVehicle(player, test.testVehicle.Entity, -1);
            test.BeginTest();
        }