NoNameSet Posted March 17, 2018 Share Posted March 17, 2018 (edited) As alot of you already know there are natives that let you control a vehicle weapon & also enable a helicopters search light so I just wanted to show people how to combine those natives and get a script working that lets the search light track an entity. => Sorry if this has been shown before and yes I am using RPH hope this is useful is some kind of way. //firstly you want to activate the search light on a helicopter and set both toggle and canBeUsedByAI to trueNativeFunction.Natives.SET_VEHICLE_SEARCHLIGHT(helicopter, true, true);//then when you want to make the search light track an entity/position you have do use this native in a loop:NativeFunction.Natives.SET_MOUNTED_WEAPON_TARGET(HeliPilot, TargetPed, TargetVehicle, TargetPosX, TargetPosY, TargetPosZ, 3, 1);orNativeFunction.Natives.SET_MOUNTED_WEAPON_TARGET(HeliPilot, TargetPed, TargetVehicle, TargetPosX, TargetPosY, TargetPosZ, 2, 0);//MUST BE RUN IN A LOOP or it will stop tracking the entity/position after a few seconds//in nativedb the native only has 4 parameters but I guess that has been changed after I looked into a script it has two more Edited March 30, 2018 by NoNameSet Bob_74, OfficerJohnson, Skorpro and 1 other 4 Link to comment Share on other sites More sharing options...
OfficerJohnson Posted March 29, 2018 Share Posted March 29, 2018 Thank you for this. This is something I've actually been looking into but couldn't fully figure it out. This is the in-game searchlight on a police helicopter, right? The one that tracks you on a Wanted Level? Link to comment Share on other sites More sharing options...
NoNameSet Posted March 30, 2018 Author Share Posted March 30, 2018 (edited) Thank you for this. This is something I've actually been looking into but couldn't fully figure it out. This is the in-game searchlight on a police helicopter, right? The one that tracks you on a Wanted Level? Yes it is. Also remember if you are going to use this, that you don't need to use all three of the params for tracking, you can only choose one option and leave the rest on 0...example NativeFunction.Natives.SET_MOUNTED_WEAPON_TARGET(HeliPilot, Suspect, 0, 0f, 0f, 0f, 3, 1); Edited March 30, 2018 by NoNameSet Link to comment Share on other sites More sharing options...
NoNameSet Posted March 30, 2018 Author Share Posted March 30, 2018 (edited) here are examples found in the scripts: (in the scripts: agency_heist3b.c4, epsilon8.c4, fm_mission_controller.c4, gb_gangops.c4, paparazzo3a.c4) BRAIN::SET_MOUNTED_WEAPON_TARGET(Local_441[3 /*88*/].f_1[0 /*20*/], 0, 0, ENTITY::GET_ENTITY_COORDS(Local_441[2 /*88*/], 1), 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(Local_441[3 /*88*/].f_1[0 /*20*/], 0, 0, 187.76f, -672.66f, 41.41f, 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(Local_441[3 /*88*/].f_1[0 /*20*/], 0, 0, ENTITY::GET_ENTITY_COORDS(Local_441[12 /*88*/].f_1[0 /*20*/], 1), 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(Local_441[3 /*88*/].f_1[0 /*20*/], 0, 0, 187.76f, -672.66f, 41.41f, 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(Local_440[5 /*20*/], 0, 0, vVar2, 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(iLocal_379, 0, iLocal_395, 0f, 0f, 0f, 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(iParam0, iParam0, 0, 0f, 0f, 0f, 1, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(iParam0, iVar0, 0, 0f, 0f, 0f, 3, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(iParam0, iVar3, iVar4, 0f, 0f, 0f, 3, 1); BRAIN::SET_MOUNTED_WEAPON_TARGET(iLocal_204, Local_316, 0, 0f, 0f, 0f, 2, 0); BRAIN::SET_MOUNTED_WEAPON_TARGET(iLocal_204, Local_316, 0, 0f, 0f, 0f, 2, 0); Edited March 30, 2018 by NoNameSet Link to comment Share on other sites More sharing options...
OfficerJohnson Posted April 1, 2018 Share Posted April 1, 2018 @NoNameSet what is the programming language these scripts are in? If I knew, I could study it and understand better since I want to use this properly. Link to comment Share on other sites More sharing options...
NoNameSet Posted April 4, 2018 Author Share Posted April 4, 2018 @NoNameSet what is the programming language these scripts are in? If I knew, I could study it and understand better since I want to use this properly. c++ 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