Cyron43 Posted July 13, 2015 Share Posted July 13, 2015 Hi there, the World.GetNearbyPeds method of the ScriptHookVDotNet (which uses the GET_PED_NEARBY_PEDS native under the hood) only returns alive peds. I want to migrate my undertaker mod from GTA IV but haven't found out yet how to retrieve dead peds. Can anyone help? Link to comment Share on other sites More sharing options...
0Root1 Posted July 13, 2015 Share Posted July 13, 2015 (edited) I'm pretty sure, there isn't method for that. But you can make your own with something like that. This code should work. Array ReturnDeadPeds(){ Ped[] nearbypeds = World.GetNearbyPeds(args); List<Ped> deadpeds = new List<Ped>(); for(int i = 0; i < nearbypeds.Length; i++) { if(nearbypeds[i].IsDead) { deadpeds.Add(nearbypeds[i]); } } return deadpeds.ToArray();} Edited July 13, 2015 by 0Root1 Link to comment Share on other sites More sharing options...
Prof_Farnsworth Posted July 13, 2015 Share Posted July 13, 2015 I think 5 releases peds after a certain amount of time where 4 didn't. If you watch closely, for a while, cars will "bounce" off of a ped when driving over it. Then they just pass right through. I think this is when the ped no longer "exists" as an entity. Therefore, I believe making a list that adds peds when they die would be more accurate. It seems that you can catch them while dead if they haven't been "released" by the engine. Just my two cents, I could be way off. Link to comment Share on other sites More sharing options...
frodzet Posted July 14, 2015 Share Posted July 14, 2015 (edited) Ped[] nearbyDeadPeds = World.GetNearbyPeds(Game.Player.Character, 100.0f).Where(p => p.IsDead).ToArray(); Won't work no? Edited July 14, 2015 by frodzet Link to comment Share on other sites More sharing options...
Inco Posted July 14, 2015 Share Posted July 14, 2015 Ped[] nearbyDeadPeds = World.GetNearbyPeds(Game.Player.Character, 100.0f).Where(p => p.IsDead).ToArray(); Won't work no? No. http://gtaforums.com/topic/789907-vrel-community-script-hook-v-net/page-16?do=findComment&comment=1067479663 frodzet 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now