Lovono Posted June 16, 2016 Share Posted June 16, 2016 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 More sharing options...
AHK1221 Posted June 16, 2016 Share Posted June 16, 2016 If you use SHVDN, try Ped.BlockPermanentEvents. I hear that is what it is used for. Link to comment Share on other sites More sharing options...
g3o0or Posted June 16, 2016 Share Posted June 16, 2016 Also you'd try PED::SET_PED_FLEE_ATTRIBUTES(ped, 0, 0); Link to comment Share on other sites More sharing options...
Lovono Posted June 17, 2016 Author Share Posted June 17, 2016 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 More sharing options...
123iamking Posted June 17, 2016 Share Posted June 17, 2016 (edited) 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 June 17, 2016 by 123iamking Link to comment Share on other sites More sharing options...
Lovono Posted June 21, 2016 Author Share Posted June 21, 2016 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 More sharing options...
bhavinbhai2707 Posted June 21, 2016 Share Posted June 21, 2016 (edited) 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 June 21, 2016 by bhavinbhai2707 Link to comment Share on other sites More sharing options...
AHK1221 Posted June 21, 2016 Share Posted June 21, 2016 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 thisvoid 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 bhavinbhai2707 1 Link to comment Share on other sites More sharing options...
Lovono Posted June 22, 2016 Author Share Posted June 22, 2016 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 More sharing options...
bhavinbhai2707 Posted June 22, 2016 Share Posted June 22, 2016 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 codeAI::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 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 More sharing options...
ech3lon Posted June 24, 2016 Share Posted June 24, 2016 (edited) 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 June 24, 2016 by ech3lon Lovono 1 Link to comment Share on other sites More sharing options...
123iamking Posted June 26, 2016 Share Posted June 26, 2016 (edited) 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 June 26, 2016 by 123iamking Lovono 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