Jump to content

MTA Functions in SinglePlayer


Recommended Posts

I tried creating a vehicle. setting the player position works with GetPools()->PedFromRef(1)->SetPos

but GetPools()->AddVehicle(,1,1) crashes at this:

  
    DWORD dwReturn = 0; 
  
    // Set Variation 1 before creation. 
    MemSetFast( (void *)VAR_CVehicle_Variation1, ucVariation, 1 ); 
    MemSetFast( (void *)VAR_CVehicle_Variation2, ucVariation2, 1 ); 
     
    DWORD dwFunc = FUNC_CCarCtrlCreateCarForScript; 
    _asm 
    { 
        push    0           // its a mission vehicle 
        push    0 
        push    0 
        push    0           // spawn at 0,0,0 
        push    dwModelID    
        call    dwFunc 
        add     esp, 0x14 
        mov     dwReturn, eax 
    } 
  

at the add esp, 0x14 after call dwFunc call. Why is this happening?

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...