OfficerJohnson Posted February 14, 2018 Share Posted February 14, 2018 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). Link to comment Share on other sites More sharing options...
OfficerJohnson Posted February 17, 2018 Author Share Posted February 17, 2018 Wow! Nothing yet? Hmm, is there a specific script that controls this behavior? I could look there then. Link to comment Share on other sites More sharing options...
stillhere Posted February 18, 2018 Share Posted February 18, 2018 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. Link to comment Share on other sites More sharing options...
zilch Posted August 24, 2018 Share Posted August 24, 2018 (edited) i'd get the coords the player is aiming at with: Entity enemy; PLAYER::GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(playerID, &enemy); enemyPosition = ENTITY::GET_ENTITY_COORDS(enemy, 1); then use: AI::TASK_THROW_PROJECTILE(ped, enemyPosition.x, enemyPosition.y, enemyPosition.z); Edited August 24, 2018 by zilch Link to comment Share on other sites More sharing options...