Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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

ped won't scare when we shoot


Lovono
 Share

Recommended Posts

I saw this video:

and I really want to find out how did he make the ped stand there fearlessly when he shot. Does anyone know what native function we can achieve that?

Thank you :)

Link to comment
Share on other sites

If you use SHVDN, try Ped.BlockPermanentEvents. I hear that is what it is used for.

Link to comment
Share on other sites

I see, with the method above, you still have to set it for every ped, so if you want to make it work, the script have to get all ped every frame, or at least every minute. but I guess in the video he set something affect the 'scare' system or something so not have to call it every frame. Do you think it possible? like instead of calling the clear wanted every frame, we call the never wanted function. btw what is SHVDN, it's the first time I hear of it?
​Thank you :)

Link to comment
Share on other sites

Could it be: SET_EVERYONE_IGNORE_PLAYER(Player player, BOOL toggle)
Let me test this ;)

Edit: I have test, and I even call the following function each frame:

player = PLAYER::PLAYER_ID();PLAYER::SET_EVERYONE_IGNORE_PLAYER(player, 1);PLAYER::SET_ALL_RANDOM_PEDS_FLEE(player, 0);PLAYER::SET_IGNORE_LOW_PRIORITY_SHOCKING_EVENTS(player, 1);

But what I got is just the police can't shoot me.

what seems to work is

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);								
Edited by 123iamking
Link to comment
Share on other sites

Oh, I see that

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);

is work, but does anyone know how to make the ped stand still after we block its non-temp events? I don't even want the ped to walk we I shoot it, I want it stand still. But if I call some task before the block, the task gone, if I call some task after the block, the block is gone.
​I'm thinking about make it play animation or OPEN_SEQUENCE_TASK or something, but I don't want to request the anim dict.

Link to comment
Share on other sites

bhavinbhai2707

Oh, I see that

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);
is work, but does anyone know how to make the ped stand still after we block its non-temp events? I don't even want the ped to walk we I shoot it, I want it stand still. But if I call some task before the block, the task gone, if I call some task after the block, the block is gone.

​I'm thinking about make it play animation or OPEN_SEQUENCE_TASK or something, but I don't want to request the anim dict.

u can use this

void TASK_STAND_STILL( Ped

ped , int time)

but this thing got timer stuff so u have to mess up around with it. . . n yess try these on loop with a proper logic to solve ur problem

Edited by bhavinbhai2707
Link to comment
Share on other sites

 

Oh, I see that

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);
is work, but does anyone know how to make the ped stand still after we block its non-temp events? I don't even want the ped to walk we I shoot it, I want it stand still. But if I call some task before the block, the task gone, if I call some task after the block, the block is gone.

​I'm thinking about make it play animation or OPEN_SEQUENCE_TASK or something, but I don't want to request the anim dict.

u can use this

void TASK_STAND_STILL( Ped

ped , int time)

but this thing got timer stuff so u have to mess up around with it. . . n yess try these on loop with a proper logic to solve ur problem

 

just use -1f. Easy

  • Like 1
Link to comment
Share on other sites

Like I said

I want it stand still. But if I call some task before the block, the task gone, if I call some task after the block, the block is gone.

If I use this code

AI::TASK_STAND_STILL(peds[i], -1);AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);

The ped won't stand still (it's stand still for a fraction of second and walk again)

If I use this code

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);AI::TASK_STAND_STILL(peds[i], -1);					

The ped will stand still, but when I shoot, it runs like a coward.

​As you see in the video:

, it seems like when ped do something like: text phone, paramedic heal patient, worker work, they will stand to do their job, and also won't run away when we shoot them.

 

Link to comment
Share on other sites

bhavinbhai2707

 

 

Like I said

I want it stand still. But if I call some task before the block, the task gone, if I call some task after the block, the block is gone.

If I use this code
AI::TASK_STAND_STILL(peds[i], -1);AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);
The ped won't stand still (it's stand still for a fraction of second and walk again)

If I use this code

AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);AI::TASK_STAND_STILL(peds[i], -1);
The ped will stand still, but when I shoot, it runs like a coward.

 

​As you see in the video:

, it seems like when ped do something like: text phone, paramedic heal patient, worker work, they will stand to do their job, and also won't run away when we shoot them.

 

just kill the ped :p lol. . . . just don't put both the code together just try them differently using bools maybe that can help :)

Link to comment
Share on other sites

In C#, given the following definitions:

        public static void SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(int ped, bool value)        {            Function.Call(Hash.SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, ped, value);        }        public static void SET_PED_KEEP_TASK(int ped, bool value)        {            Function.Call(Hash.SET_PED_KEEP_TASK, ped, value);        }        public static int OpenSequenceTask()        {            unsafe            {                int handle = 0;                GTA.Native.Function.Call(Hash.OPEN_SEQUENCE_TASK, &handle);                return handle;            }        }        public static void CloseSequenceTask(int handle, bool setToRepeat)        {            if (setToRepeat)            {                GTA.Native.Function.Call(Hash.SET_SEQUENCE_TO_REPEAT, handle, true);            }            GTA.Native.Function.Call(Hash.CLOSE_SEQUENCE_TASK, handle);        }        public static void PerformSequenceTask(Ped p, int handle)        {            unsafe            {                GTA.Native.Function.Call(Hash.TASK_PERFORM_SEQUENCE, p.Handle, handle);                GTA.Native.Function.Call(Hash.CLEAR_SEQUENCE_TASK, &handle);            }        }				public static void TASK_STAND_STILL(int ped, int duration)        {            Function.Call(Hash.TASK_STAND_STILL, ped, duration);        } 

 

This Code will spawn a Ped near you and tell it to perform the STAND_STILL Task, regardless of what is happening around it (You can even shoot the ped, it won't care):

Ped playerPed = Game.Player.Character;Ped p = World.CreatePed(PedHash.Abigail, playerPed.Position.Around(1.7f));                SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(p.Handle, true);SET_PED_KEEP_TASK(p.Handle, true);int seq = OpenSequenceTask();TASK_STAND_STILL(0, -1);     CloseSequenceTask(seq, true);PerformSequenceTask(p, seq);

 

Note: When we set the Task for a task sequence, we need to pass in 0 instead of the ped handle:

TASK_STAND_STILL(0, -1);

 

Edited by ech3lon
Link to comment
Share on other sites

I found out how to do do this about a week ago, but I was too occupied by other activities, until today, the Sabbath day, I can put my code here :)

AI::CLEAR_PED_TASKS(peds[i]);PED::SET_PED_KEEP_TASK(peds[i], 1);AI::TASK_STAND_STILL(peds[i], -1);PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(peds[i], 1);
Edited by 123iamking
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.