示例#1
0
        public static void SpawnCar(uint CarHash, Vector3 position, Vector3 rotation, uint driverClass = 3, uint customization = 0, uint AIRelated = 0, uint importanceRelated = 2)
        {
            //0x06465EB2 - hash
            IntPtr posV      = Vector3c.Allocate(position);
            IntPtr rotV      = Vector3c.Allocate(rotation);
            IntPtr vehParams = AllocateVehicleParams(CarHash, posV, rotV, driverClass, customization, AIRelated, importanceRelated);

            MWDBG.mWnd.AppendLog("Position = 0x" + posV.ToString("X4"));
            MWDBG.mWnd.AppendLog("Rotation = 0x" + rotV.ToString("X4"));
            MWDBG.mWnd.AppendLog("vehParams = 0x" + vehParams.ToString("X4"));
            MWDBG.mWnd.AppendLog("    ");
            MWDBG.mWnd.AppendLog("rot[0] from mem: " + MWDBG.readMem <float>(rotV));
            MWDBG.mWnd.AppendLog("rot[1] from mem: " + MWDBG.readMem <float>(rotV + 4));
            MWDBG.mWnd.AppendLog("rot[2] from mem: " + MWDBG.readMem <float>(rotV + 4 + 4));
            MWDBG.mWnd.AppendLog("    ");
            MWDBG.mWnd.AppendLog("mem vehP[0]: 0x" + MWDBG.readMem <uint>(vehParams).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[1]: 0x" + MWDBG.readMem <uint>(vehParams + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[2]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[3]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4 + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[4]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4 + 4 + 4).ToString("X4"));

            //MWDBG.m[(IntPtr)0x689820, false].Execute(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Cdecl, vehParams, 0x0A6B47FAC);
        }
示例#2
0
 private void CarSpawnOk_Click(object sender, RoutedEventArgs e)
 {
     CarSpawnerClass.SpawnCar(0x06465EB2, Vector3c.GetVector3(0, 0, 0), Vector3c.GetVector3(0, -1, 0));
     SetActiveGrid(GridLog);
 }