Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

MAFINS

Stop peds from fleeing [method 2]

Recommended Posts

MAFINS

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);

Share this post


Link to post
Share on other sites
Freakyy

Radical. B)

Share this post


Link to post
Share on other sites
Tiryll

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 :)

Share this post


Link to post
Share on other sites
wolfokami321

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

Share this post


Link to post
Share on other sites
xsploit

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Andross90

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.

Share this post


Link to post
Share on other sites
dehan

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.

Share this post


Link to post
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);

Share this post


Link to post
Share on other sites
nordi

 

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 ?

Share this post


Link to post
Share on other sites
whorse

 

 

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"));        }            }

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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