Hi, I'm Brazilian, I'm a beginner in programming and I don't have money to take a fullstacks programming course. I'm using ChatGPT to do between 70 and 80% of the code, so don't judge me.
My problem is that I'm using "NATIVE_DECL BOOL GET_IS_PED_RESPONDING_TO_NEGATIVE_INTERACTION(Ped ped, Player player) { return invoke<BOOL>(0xA454D234E45BB6E5, ped, player); } // 0xA454D234E45BB6E5 b1207" to identify the interactions of the peds with the player, but I couldn't identify the interactions. I don't know why, but I've tried everything. If someone can help me, I would be very grateful.
// Function to detect if the interaction between the player and the Ped is negative
bool detectNegativeInteraction(Ped playerPed, Ped ped) {
PRINT_INFO("Checking interaction for Ped ID: " + std::to_string(ped));
// Additional debugging: Checking ped model and type
Hash pedModel = ENTITY::GET_ENTITY_MODEL(ped);
PRINT_INFO("Ped ID model: " + std::to_string(ped) + " is: " + std::to_string(pedModel));
int pedType = PED::GET_PED_TYPE(ped);
PRINT_INFO("Ped ID type: " + std::to_string(ped) + " is: " + std::to_string(pedType));
// Status checks
if (PED::IS_PED_IN_COMBAT(ped, playerPed)) {
PRINT_INFO("Ped ID: " + std::to_string(ped) + " is in combat with the player.");
return true;
}
if (PED::IS_PED_IN_ANY_VEHICLE(ped, false)) {
PRINT_INFO("Ped ID: " + std::to_string(ped) + " is in a vehicle.");
return false;
}
if (TASK::_GET_PED_USING_SCENARIO_POINT(ped)) {
PRINT_INFO("Ped ID: " + std::to_string(ped) + " is using a scenario.");
return false; }
// Check if it is responding to negative interactions
BOOL isRespondingNegative = invoke<BOOL>(0xA454D234E45BB6E5, ped, playerPed);
if (isRespondingNegative) {
PRINT_INFO("Ped ID: " + std::to_string(ped) + " is responding negatively.");
return true;
}
// Fallback when there is no recognized interaction
PRINT_WARN("Ped ID: " + std::to_string(ped) + " is not responding to positive or negative interactions.");
return false;
}