[SOLVED] Applying wounds to the ped you hit?
-
Does anyone know how to give the ped you hit wounds without a knife in C#
-
@NotCrunchyTaco I can't check right now but I believe I used this one: APPLY_PED_DAMAGE_PACK
-
@stillhere CORRECT but I need it to activate when you hit the ped I don't know how to detect that right now I am new to scripting I've been doing it for 6 days now not even a week
-
@NotCrunchyTaco something like
Game.Player.Character.IsTouching(targetPed) should work but I find that it doesn't work every time.I've thought of using a combination of bone coordinates and World.GetDistance and it should work but I haven't tried yet. If it works I can share it with yyou, though hopefully someone knows a better way.
-
@stillhere Thanks but you would probably know because in your shield throwing mod when the shield hits the ped the ped becomes all bloody
-
@NotCrunchyTaco yeah it's imperfect though, sometimes the shield just goes through the legs without damaging the ped lol. Basically I get the Position of the shield and the Position of the Ped, then if the distance between the two coordinates is less than or equal to a certain float (I used 0.8f I think), then I apply the damage pack to the ped.
-
@stillhere Ahhh I see but would you know how to get the position of a knife that a player is holding?
-
@stillhere or any melee weapon
-
@NotCrunchyTaco sure, here's an example: http://pastebin.com/7QxD6u73