Quantcast

Jump to content

» «
Photo

[.NET/C++] How to Task a PED to Throw Tear Gas (Like the In-Game NOOSE)?

2 replies to this topic
OfficerJohnson
  • OfficerJohnson

    Crackhead

  • Members
  • Joined: 07 Jan 2018
  • United-States

#1

Posted 4 days ago

I've seen this feature used on me a couple of times and I would really like to know how it's done.

Playing around with trainers, we can assign a ped teargas as a weapon but if placed in combat, they don't use it.

I specifically would like to know how to do this for bodyguards more than anything, but General ped usage is also welcome .NET format more than C++ native use but it wouldn't be a bad idea to know the natives involved as well.

Some pseudo code:

Ped targetedPed = new Ped.
Create bodyguard group.
Spawn bodyguards[n].
If targetedPed !inGroup && isHostile, bodyguards[n] Task.CombatInRange.
If targetedPed isUsingCover, Ped.GetClosestPed(bodyguard[n]).
ThrowTearGasTask(targetedPed).

OfficerJohnson
  • OfficerJohnson

    Crackhead

  • Members
  • Joined: 07 Jan 2018
  • United-States

#2

Posted A day ago

Wow! Nothing yet?

Hmm, is there a specific script that controls this behavior? I could look there then.

stillhere
  • stillhere

    A guy

  • Members
  • Joined: 06 Jun 2006
  • Canada

#3

Posted 18 hours ago

Pretty sure Ped.Task.ShootAt() does the job. Just checked some old code I had, haven't used it in a while though and can't test right now.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users