motorsport71 Posted April 2, 2018 Share Posted April 2, 2018 So i am trying to delete all passengers in all vehicles. I know to delete a ped it has to be set as a mission ped. So i set all of the drivers/passengers to mission peds and use PED::DELETE_PED . It will delete all mission peds including my group members. I tried to exclude only my group members but then no peds are deleted at all. Thoughts? Ped peds1[ARR_SIZE]; int count2 = worldGetAllPeds(peds1, ARR_SIZE); if (pedUpdateTime + 100 < GetTickCount()) { pedUpdateTime = GetTickCount(); for (int i = 0; i < count2; i++) { int player_group = PLAYER::GET_PLAYER_GROUP(playerPed); // TARGETS VEHICLE DRIVERS/PASSENGERS TO MISSION PEDS SO THEY CAN BE DELETED if (!ENTITY::IS_ENTITY_A_MISSION_ENTITY(peds1[i]) && PED::IS_PED_SITTING_IN_ANY_VEHICLE(peds1[i])) ENTITY::SET_ENTITY_AS_MISSION_ENTITY(peds1[i], true, true); // EXCLUDES GROUP MEMBERS FOR TARGETTED DELETION if (!PED::IS_PED_GROUP_MEMBER(playerPed, player_group)) PED::DELETE_PED(&peds1[i]); } } Link to comment Share on other sites More sharing options...
motorsport71 Posted April 3, 2018 Author Share Posted April 3, 2018 Nevermind, got it sorted out: Ped peds1[ARR_SIZE]; int count2 = worldGetAllPeds(peds1, ARR_SIZE); if (pedUpdateTime + 100 < GetTickCount()) { pedUpdateTime = GetTickCount(); for (int i = 0; i < count2; i++) { int player_group = PLAYER::GET_PLAYER_GROUP(playerPed); if (!ENTITY::IS_ENTITY_A_MISSION_ENTITY(peds1[i]) && PED::IS_PED_SITTING_IN_ANY_VEHICLE(peds1[i]) && !PED::IS_PED_GROUP_MEMBER(peds1[i], player_group)) { ENTITY::SET_ENTITY_AS_MISSION_ENTITY(peds1[i], true, true); PED::DELETE_PED(&peds1[i]); } } } Link to comment Share on other sites More sharing options...