HughJanus 244 Posted March 15, 2020 Share Posted March 15, 2020 (edited) In a mod I am using a bleeding effect. Currently it also applies when being damaged in a fistfight. How could I check if an NPC has been damaged by a "non-fist-weapon"?^^ I imagine something like checking if the last damaged source was NOT a fist... is that possible somehow? Edited March 26, 2020 by HughJanus Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted March 15, 2020 Share Posted March 15, 2020 It's not exactly what you are looking for, but you can try using and checking for specific weapons. 1 Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted March 15, 2020 Author Share Posted March 15, 2020 I found this one already, but would have to go through all the weapons but the fists 😕 Thanks for responding, though. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted March 17, 2020 Author Share Posted March 17, 2020 What is the weapon type that is requested in this method? Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted March 17, 2020 Share Posted March 17, 2020 The hash of a weapon iirc, such as WEAPON_UNARMED. 1 Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted March 17, 2020 Author Share Posted March 17, 2020 So if I want to do it for WEAPON_UNARMED, I do it like this? has_entity_been_damaged_by_weapon(Ped, GET_HASH_KEY("WEAPON_UNARMED"), ?); The method wants an integer and I dont know what to insert^^ Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted March 17, 2020 Share Posted March 17, 2020 Yes, that's exactly how it works. GET_HASH_KEY returns an (unsigned) integer which you can use for the function. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted March 18, 2020 Author Share Posted March 18, 2020 haha I was looking for the third value, where I put the question mark :D I googled and found this from GTA 5, I am now working with the value 0. If youu want to define only a specific weapon, second parameter=weapon hash code, third parameter=0 If you want to define any melee weapon, second parameter=0, third parameter=1. If you want to identify any weapon (firearms, melee, rockets, etc.), second parameter=0, third parameter=2. Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted March 18, 2020 Share Posted March 18, 2020 9 hours ago, HughJanus said: haha I was looking for the third value, where I put the question mark 😄 I googled and found this from GTA 5, I am now working with the value 0. If youu want to define only a specific weapon, second parameter=weapon hash code, third parameter=0 If you want to define any melee weapon, second parameter=0, third parameter=1. If you want to identify any weapon (firearms, melee, rockets, etc.), second parameter=0, third parameter=2. Very nice, might even solve your problem a bit easier: Use any weapon to determine whether they got first (param 2). If so, then make sure that param = 1 is false, so they have not been damaged by any melee weapon. Should save you from looping through all weapons. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted March 19, 2020 Author Share Posted March 19, 2020 I have now used the iterating through weapons, because I didnt want all weapons to cause bleeding :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.