Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Stop peds from fleeing [method 2]


MAFINS
 Share

Recommended Posts

Simply block non-temporary events for the ped, and clear the flee attributes.

TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true);SET_PED_FLEE_ATTRIBUTES(ped, 0, 0);SET_PED_COMBAT_ATTRIBUTES(ped, 17, 1);ORSET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, 1);SET_PED_FLEE_ATTRIBUTES(ped, 0, 0);SET_PED_COMBAT_ATTRIBUTES(ped, 17, 1);
  • Like 3
Link to comment
Share on other sites

Nice man. I did try something like this myself, but have to say when I seen freaky's example, it made a lot of sense in how I need to handle things and gives a bit more freedom I think. It's nice to have options :)

Link to comment
Share on other sites

wolfokami321

Great now all we need is a script to change everyone into the zombie ped... zombie mod plz

Link to comment
Share on other sites

i've been trying to make a zombie mod from the get go...i have the gta4 infection mod but i aint converting that, if someone could help withj entity.creatmodelswap....it could be possible

Link to comment
Share on other sites

  • 2 weeks later...
cnelbuendia

It's working for me only for created Peds but not for world existing peds, could you please elaborate on the params?

 

Thank you.

Edited by cnelbuendia
Link to comment
Share on other sites

I'm having issues with scripting Peds at the moment. In my mod I spawn and add a ped to my group, I have a ped follow me, once I eliminate an enemy, I then set a task for the Ped to go to a specific location. This works fine if I allow the ped to follow while I do the objective, but if I ditch the ped and get too far away from him (the objective is some distance a way and I must travel by vehicle) - after I eliminate the enemy, the ped will just freeze in place and refuse to go to perform the task I set.

 

I know that if you get too far away from peds they may leave your group, but I fixed this by doing: GTA.Native.Function.Call(Hash.SET_GROUP_SEPARATION_RANGE, GTA.Native.Function.Call<int>(Hash.GET_PLAYER_GROUP, Game.Player), 10000000000000.0f); which seems to work as I can drive miles away from him, and then return to him and he will still follow.

 

But if I am far away from him and the script then sets a new task for him, it just doesn't work and he stays frozen in place. Can anyone advise on how to set a task for a ped that is far away from you to go somewhere far away from him? Thanks.

Link to comment
Share on other sites

  • 3 weeks later...

It's working for me only for created Peds but not for world existing peds, could you please elaborate on the params?

 

Thank you.

Bump, has anyone managed to get existing world peds to not flee? Eg in vehicles and such.

Link to comment
Share on other sites

DaBOSS54320

I just got peds to not flee when you aim at them with a weapon. It took me trying out each attribute manually lol but oh well, I found it. It's combat attribute 46, it must mean something like "fight to the death" I guess.

 

PED::SET_PED_COMBAT_ATTRIBUTES(ped,46,TRUE);

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

 

It's working for me only for created Peds but not for world existing peds, could you please elaborate on the params?

 

Thank you.

Bump, has anyone managed to get existing world peds to not flee? Eg in vehicles and such.

 

 

Anyone ?

Link to comment
Share on other sites

  • 2 months later...

 

 

It's working for me only for created Peds but not for world existing peds, could you please elaborate on the params?

 

Thank you.

Bump, has anyone managed to get existing world peds to not flee? Eg in vehicles and such.

 

 

Anyone ?

 

Yes, we've been able to do this for a while now. You use either PED::GET_PED_NEARBY_PEDS or - preferably - worldGetAllPeds() to gather all the peds in the game world, then you go through them in a for-loop and set each of them to not flee by using the natives mentioned in this thread:

Ped allPeds[1024];int count = worldGetAllPeds(allPeds, 1024);for (int i = 0; i < count; i++){	Ped ped1 = allPeds[i];	if (ENTITY::DOES_ENTITY_EXIST(ped1))        {		PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped1, TRUE); //the most important one                PED::SET_PED_FLEE_ATTRIBUTES(ped1, 0, 0);                PED::SET_PED_COMBAT_ATTRIBURES(ped1, 46, TRUE);                PED::SET_PED_RELATIONSHIP_GROUP_HASH(ped1, GAMEPLAY::GET_HASH_KEY("cougar"));        }            }
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.