CPed* ped = nullptr;
CVector vector{ x, y, z };
if (type == CPedType::CIVILIAN_PED) {
CStreaming::RequestModel(modelId, GAME_REQUIRED);
CStreaming::LoadAllRequestedModels(false);
CStreaming::SetModelIsDeletable(modelId);
ped = new CCivilianPed(ePedType::PED_TYPE_CIVMALE, modelId);
}
if (type == CPedType::COP_PED) {
/*CStreaming::RequestModel(modelId, eStreamingFlags::GAME_REQUIRED);
CStreaming::LoadAllRequestedModels(false);*/
ped = new CCopPed(eCopType::COP_TYPE_CITYCOP);
}
if (type == CPedType::FIREMAN_PED) {
CStreaming::RequestModel(modelId, eStreamingFlags::GAME_REQUIRED);
CStreaming::LoadAllRequestedModels(true);
ped = new CEmergencyPed(ePedType::PED_TYPE_FIREMAN, modelId);
}
if (type == CPedType::MEDIC_PED) {
CStreaming::RequestModel(modelId, eStreamingFlags::GAME_REQUIRED);
CStreaming::LoadAllRequestedModels(true);
ped = new CEmergencyPed(ePedType::PED_TYPE_MEDIC, modelId);
}
ped->m_nCreatedBy = 2;
ped->m_pIntelligence->SetPedDecisionMakerType(-1);
ped->m_pIntelligence->SetSeeingRange(30.0);
ped->m_pIntelligence->SetHearingRange(30.0);
ped->m_pIntelligence->m_fDmRadius = 0.0f;
ped->m_pIntelligence->m_nDmNumPedsToScan = 0;
ped->SetPosn(vector);
ped->SetOrientation(0.f, 0.f, 0.f);
CWorld::Add(ped);
CPedStruct* pedStruct = new CPedStruct(type, modelId, x, y, z, ped);
m_Peds.push_back(pedStruct);