Code:
// Terror model selected...
if (m_Choice == 0) {
CBaseEntity *pPlayer = pEntity->GetUnknown()->GetBaseEntity();
pPlayer->PrecacheModel("models/player/terror.mdl");
pPlayer->SetModel("models/player/terror.mdl");
}
// T_OS model selected
else if (m_Choice) {
CBaseEntity *pPlayer = pEntity->GetUnknown()->GetBaseEntity();
pPlayer->PrecacheModel("models/player/t_os.mdl");
pPlayer->SetModel("models/player/t_os.mdl");
}
For some reason this always crashes the server. I have this as a client command, and it should precache and set the model, but instead crashes.
Does precaching a model crash if the model is already precached, or do I need to precache the model on ServerActivate or LevelInit?
__________________