예제 #1
0
bool CClientDFF::ReplacePedModel(RpClump* pClump, ushort usModel, bool bAlphaTransparency)
{
    // Stream out all the weapon models with matching ID.
    // Streamer will stream them back in async after a frame
    // or so.
    m_pManager->GetPedManager()->RestreamPeds(usModel);

    // Grab the model info for that model and replace the model
    CModelInfo* pModelInfo = g_pGame->GetModelInfo(usModel);
    pModelInfo->SetCustomModel(pClump);

    pModelInfo->SetAlphaTransparencyEnabled(bAlphaTransparency);

    // Remember that we've replaced that weapon model
    m_Replaced.push_back(usModel);

    // Success
    return true;
}
예제 #2
0
bool CClientDFF::ReplaceVehicleModel(RpClump* pClump, ushort usModel, bool bAlphaTransparency)
{
    // Make sure previous model+collision is loaded
    m_pManager->GetModelRequestManager()->RequestBlocking(usModel, "CClientDFF::ReplaceVehicleModel");

    // Grab the model info for that model and replace the model
    CModelInfo* pModelInfo = g_pGame->GetModelInfo(usModel);
    pModelInfo->SetCustomModel(pClump);

    pModelInfo->SetAlphaTransparencyEnabled(bAlphaTransparency);

    // Remember that we've replaced that vehicle model
    m_Replaced.push_back(usModel);

    // Stream out all the vehicle models with matching ID.
    // Streamer will stream them back in async after a frame
    // or so.
    m_pManager->GetVehicleManager()->RestreamVehicles(usModel);

    // Success
    return true;
}