jedijosh920 Posted October 27, 2015 Share Posted October 27, 2015 Hello all, I made a new AI task you can include in your scripts or play around with. It makes the pedestrian pickup a nearest weapon of the type you choose. void PedPickupNearestWeapon(Ped ped) { Prop NearestWeapon = Function.Call<Prop>(Hash.GET_CLOSEST_OBJECT_OF_TYPE, ped.Position.X, ped.Position.Y, ped.Position.Z, 7f, Function.Call<int>(Hash.GET_HASH_KEY, "w_pi_pistol"), 0, 0, 0); if (NearestWeapon != null && NearestWeapon.Exists() && ped.Weapons.Current.Hash.Equals(WeaponHash.Unarmed)) { ped.Task.ClearAllImmediately(); ped.Weapons.RemoveAll(); TaskSequence PedPickupWeapon = new TaskSequence(); PedPickupWeapon.AddTask.RunTo(NearestWeapon.Position); PedPickupWeapon.AddTask.PlayAnimation("pickup_object", "pickup_low", 8f, -1, false, 0f); PedPickupWeapon.Close(); ped.Task.PerformSequence(PedPickupWeapon); Script.Wait(750); NearestWeapon.Delete(); NearestWeapon = null; ped.Weapons.Give(WeaponHash.Pistol, 9999, true, true); } } It makes the pedestrian look for a nearby dropped pistol from another dead ped or whatever and he runs to to it and picks it up with an animation. You can look for other weapon props and change it. gtaVmod, zilch, nitanmarcel and 1 other 4 Link to comment Share on other sites More sharing options...
nitanmarcel Posted October 27, 2015 Share Posted October 27, 2015 Hmm that could be useful for a mod where you can make a ped to pick up a better weapon from a dead ped? I mean if the ped is having a weapon but there is a weapon with better stats on ground, then the ped will pick that weapon. I hope you will understand me jedijosh920 1 Link to comment Share on other sites More sharing options...
gtaVmod Posted October 27, 2015 Share Posted October 27, 2015 nice. PlayAnimation("pickup_object", "pickup_low") is there a list of all animations available? Link to comment Share on other sites More sharing options...
alloc8or Posted October 27, 2015 Share Posted October 27, 2015 nice. PlayAnimation("pickup_object", "pickup_low")is there a list of all animations available? 21881 anims gtaVmod 1 Link to comment Share on other sites More sharing options...
jedijosh920 Posted October 28, 2015 Author Share Posted October 28, 2015 I would just use this: http://docs.ragepluginhook.net/html/62951c37-a440-478c-b389-c471230ddfc5.htm It has all the animations InfamousSabre 1 Link to comment Share on other sites More sharing options...
NOTHING2 Posted July 3, 2019 Share Posted July 3, 2019 how to make peds stand close around player when he is low helth the code is hard to see because no begine new ling - paragraph what should i do to see code easier ? Link to comment Share on other sites More sharing options...
NOTHING2 Posted July 3, 2019 Share Posted July 3, 2019 there is a bug...ped will recieve a gun even though he is not finishing his animation... Reason is because the Script.Wait(750); not totally fix But i dont know how to fix....if we can wait until the last frame of annimation stop then give him the gun..it is perffect 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