mjau Posted August 5, 2011 Share Posted August 5, 2011 Hi i will most likely ask very much in this topic over the time cuz im working wiht an EMP Project who can disable engine of a vehicle K over to the question i need an answer on before i can continue How can i make the script automaticly find the nearest player in the driver seat of a vehicle aircrafts also? Link to comment
bandi94 Posted August 5, 2011 Share Posted August 5, 2011 function off(player) local car = getPedOccupiedVehicle(player) setVehicleEngineState ( car, false ) end addCommandHandler("engineoff",off) next time try to make a part of script and we will help you whit errors you wana find the nearlest player form a car/plane Link to comment
mjau Posted August 5, 2011 Author Share Posted August 5, 2011 i didnt ask i will try myself but i need the functions to get nearest player in a car /plane exept me Link to comment
bandi94 Posted August 5, 2011 Share Posted August 5, 2011 try to use getDistanceBetweenPoints3D() getElementsByType ( "player" ) then first object are you (i think you need nearlest car form you ) and secound are other players and then check for each player if has a vehicle and if yes then check distance and if is smaler then .. Link to comment
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