Aldebaraan Posted December 20, 2020 Share Posted December 20, 2020 How do i make attack helicopters (e.g. buzzard) shoot at enemies using their weapons? I know it's possible since the buzzard uses the miniguns and rockets at the player in missions both online and offline. I already tried: Ped nearestPed = World.GetNearbyPeds(Game.Player.Character, 100f)[0]; vehicle.Driver.Task.VehicleShootAtPed(nearestPed); Link to comment Share on other sites More sharing options...
LeeC22 Posted December 20, 2020 Share Posted December 20, 2020 (edited) 9 hours ago, Aldebaraan said: How do i make attack helicopters (e.g. buzzard) shoot at enemies using their weapons? I know it's possible since the buzzard uses the miniguns and rockets at the player in missions both online and offline. I already tried: Ped nearestPed = World.GetNearbyPeds(Game.Player.Character, 100f)[0]; vehicle.Driver.Task.VehicleShootAtPed(nearestPed); I noticed these in the NativeDB void ADD_VEHICLE_SUBTASK_ATTACK_COORD(Ped ped, float x, float y, float z) void ADD_VEHICLE_SUBTASK_ATTACK_PED(Ped ped, Ped ped2) I did notice one other script that cleared the ped task and then set the task to shoot at the player, that would mean setting it back to the drive task after it has finished shooting. I don't do much ped tasking, so I am not sure if these are the right things to use or not. Edited December 20, 2020 by LeeC22 Aldebaraan 1 Link to comment Share on other sites More sharing options...
Aldebaraan Posted December 20, 2020 Author Share Posted December 20, 2020 @LeeC22Thanks! I tested this with a valkyrie and the co pilot indeed did shoot the autocannon at me. LeeC22 1 Link to comment Share on other sites More sharing options...
josiewales Posted May 13, 2021 Share Posted May 13, 2021 Hi Aldebaraan. Would you mind sharing the exact code you used. I’m curious as to how you referenced the code so that it would be applied to the chopper only? 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