Call setcorrectplayermodel from within cbaseplayer::spawn. ---------------------------------------------------------- SERVER DLL ---------- player.h -------- struct playerModel_s { int model_index; string_t model_name; }; extern playerModel_s playerModels[PM_PLAYERMODELS_MAX]; void CachePlayerModels(void); ------------------------------------------------------- player.cpp ---------- playerModel_s playerModels[PM_PLAYERMODELS_MAX]; void CachePlayerModels(void) { //go male/female in order of each class playerModels[PM_SPECTATOR].model_name = MAKE_STRING("models/player/rebel_recon_m.mdl"); //we have no boo.mdl in flf 2.0 playerModels[PM_REBEL_RECON_MALE].model_name = MAKE_STRING("models/player/rebel_recon_m.mdl"); playerModels[PM_REBEL_RECON_FEMALE].model_name = MAKE_STRING("models/player/rebel_recon_f.mdl"); playerModels[PM_REBEL_ASSAULT_MALE].model_name = MAKE_STRING("models/player/rebel_assault_m.mdl"); playerModels[PM_REBEL_ASSAULT_FEMALE].model_name = MAKE_STRING("models/player/rebel_assault_f.mdl"); playerModels[PM_REBEL_SUPPORT_MALE].model_name = MAKE_STRING("models/player/rebel_support_m.mdl"); playerModels[PM_REBEL_SUPPORT_FEMALE].model_name = MAKE_STRING("models/player/rebel_support_f.mdl"); playerModels[PM_COMMANDOS_RECON_MALE].model_name = MAKE_STRING("models/player/tricorp_recon_m.mdl"); playerModels[PM_COMMANDOS_RECON_FEMALE].model_name = MAKE_STRING("models/player/tricorp_recon_f.mdl"); playerModels[PM_COMMANDOS_ASSAULT_MALE].model_name = MAKE_STRING("models/player/tricorp_assault_m.mdl"); playerModels[PM_COMMANDOS_ASSAULT_FEMALE].model_name = MAKE_STRING("models/player/tricorp_assault_f.mdl"); playerModels[PM_COMMANDOS_SUPPORT_MALE].model_name = MAKE_STRING("models/player/tricorp_support_m.mdl"); playerModels[PM_COMMANDOS_SUPPORT_FEMALE].model_name = MAKE_STRING("models/player/tricorp_support_f.mdl"); //omega; force un-modify the models as they get precached. //omega; be a little less strict for 2.0; allow people to use custom models as long as they fit inside the original boxes. for (int i = 0;iteam == TEAM_SPECTATOR || pev->team == TEAM_OBSERVER) pmIndex = PM_SPECTATOR; else { //set the base values for the sexes if (m_iSex == SEX_MALE) pmIndex = PM_SPECTATOR; else if (m_iSex == SEX_FEMALE) pmIndex = PM_COMMANDOS_SUPPORT_MALE; //pmIndex += pev->playerclass; //omega; have to redo the class system to use this easy math from defiance, because 2.0 still uses the 6 seperate //classes for each team instead of just 3 classes with team checks switch(m_iSex) { default: case SEX_MALE: pmIndex = pev->playerclass + (PM_REBEL_SUPPORT_MALE * (pev->team - 1));break; case SEX_FEMALE: pmIndex = pev->playerclass + (pev->team == TEAM_REBELS ? PM_COMMANDOS_SUPPORT_MALE : 0) + (PM_REBEL_SUPPORT_FEMALE * (pev->team - 1));break; } } pev->model = playerModels[pmIndex].model_name; pev->modelindex = playerModels[pmIndex].model_index; } ---------------------------------------------------------------------------------------------- client.cpp ---------- void ClientPrecache( void ) { CachePlayerModels(); ........................ .. other code in here .. ........................ } ----------------------------------------------------------------- CLIENT DLL ----------------------------------------------------------------- StudioModelRenderer.cpp ----------------------- int CStudioModelRenderer::StudioDrawPlayer( int flags, entity_state_t *pplayer ) { alight_t lighting; vec3_t dir; m_pCurrentEntity = IEngineStudio.GetCurrentEntity(); IEngineStudio.GetTimes( &m_nFrameCount, &m_clTime, &m_clOldTime ); IEngineStudio.GetViewInfo( m_vRenderOrigin, m_vUp, m_vRight, m_vNormal ); IEngineStudio.GetAliasScale( &m_fSoftwareXScale, &m_fSoftwareYScale ); m_nPlayerIndex = pplayer->number - 1; if (m_nPlayerIndex < 0 || m_nPlayerIndex >= gEngfuncs.GetMaxClients()) return 0; //omega;okay, it works! success is mine! //all player models are now set directly, we're not using the infokey, so it doesnt matter //all hitboxes are now always correct too. m_pRenderModel = m_pCurrentEntity->model; //omega; test this out; not using the model infokey now m_pStudioHeader = (studiohdr_t *)IEngineStudio.Mod_Extradata (m_pRenderModel); IEngineStudio.StudioSetHeader( m_pStudioHeader ); IEngineStudio.SetRenderModel( m_pRenderModel ); ........................ .. other code in here .. ........................ }