Jump to content

HELP ME! I'm not able to identify the negative responses from the ped.


Recommended Posts

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;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...