formel117 Posted January 18, 2014 Share Posted January 18, 2014 Is there anyway to get a list of all vehicles that exist currenty ingame and go over them? Link to comment Share on other sites More sharing options...
stef538 Posted January 19, 2014 Share Posted January 19, 2014 You mean, select which cars needs to be spawned / seen ? Link to comment Share on other sites More sharing options...
formel117 Posted January 19, 2014 Author Share Posted January 19, 2014 I want to loop over a list of every vehicle that is currently spawned in the world. Link to comment Share on other sites More sharing options...
InfamousSabre Posted January 19, 2014 Share Posted January 19, 2014 World.GetAllVehicles returns an Array of all currently spawned Vehicles. from there you can loop through them using a foreach loop you can exclude your players vehicle by checking for equality with Game.LocalPlayer.CurrentVehicle and before you do ANYTHING with the Vehicles (including the above check for equality) always make sure it exists first with Game.Exists(Vehicle)Again, most of this is in the Scripthook.net documentation. It even comes in a handy .chm help file. Many general C# questions can be found pre-answered on http://stackoverflow.com/ or your favorite search engine. Link to comment Share on other sites More sharing options...
formel117 Posted January 19, 2014 Author Share Posted January 19, 2014 I'm sorry for any confusion, but this question was in regand to Aru's Scripthook(C++). Thank you anyway. 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