i use
void combat_state(Ped ped, Ped player) {
PED::SET_PED_COMBAT_RANGE(ped, 2);
PED::SET_PED_COMBAT_MOVEMENT(ped, 2);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 28, true);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 50, true);
WEAPON::SET_PED_DROPS_WEAPONS_WHEN_DEAD(ped, false);
PED::SET_PED_FLEE_ATTRIBUTES(ped, 32768, false);
PED::SET_PED_FLEE_ATTRIBUTES(ped, 16384, true);
PED::SET_PED_FLEE_ATTRIBUTES(ped, 512, true);
PED::SET_PED_FLEE_ATTRIBUTES(ped, 1024, true);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 5, true);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 17, false);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 14, false);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 58, true);
PED::SET_PED_COMBAT_ATTRIBUTES(ped, 46, true);
PED::SET_PED_CONFIG_FLAG(ped, 225, false);
TASK::TASK_COMBAT_PED(ped, player, 0, 0);
PED::SET_PED_KEEP_TASK(ped, 1);
}
to make them not flee xd most peds flee on there own