striker666dk Posted June 3, 2015 Share Posted June 3, 2015 Hey i'm new at modding, and i'm trying to get a vehicle id. But it's a vehicle that the player has never used. Any ideas? Link to comment Share on other sites More sharing options...
Colarocker Posted June 3, 2015 Share Posted June 3, 2015 looked around a little bit but didn't find a function for it.. only thing u can do is to spawn a vehicle and assign an id to it ( i think ) if you want to research more also try older gta IV scripts and stuff, because you can find a lot of parallels to gta V.. the native db gets lots of updates, maybe there will be a fitting function in the future another approach would be to use the entity functions but i didnt find one for entitys near the player :x if there would be one you could scan for entitys around player till IS_ENTITY_A_VEHICLE is true next approach would be objects because there are functions like OBJECTS::GET_CLOSEST_OBJECT_OF_TYPE but im not sure if you can handle a vehicle as an object there is also no documentation yet for this one but you can look up the gamescripts if you find any connection to vehicles (as i'm writing this i find it more and more appealing to look more inside the object calls they seem pretty promising, stuff like OBJECT::IS_OBJECT_NEAR_POINT ) hope it helped, if i get the time i think im gonna test around with it too hope you gonna give an update if you found something working striker666dk 1 Link to comment Share on other sites More sharing options...
Colarocker Posted June 4, 2015 Share Posted June 4, 2015 or just try VEHICLE::GET_CLOSEST_VEHICLE(float x, float y, float z, float radius, Hash modelHash, int flags) just use playercords for xyz, radius like you want it, modelHash = 0 for all models and the last flag is something like 70, but i never tried it myself will test it later ^^ striker666dk 1 Link to comment Share on other sites More sharing options...
striker666dk Posted June 4, 2015 Author Share Posted June 4, 2015 Thank you so much Colarocker, i'll try it as soon as possible. And if i find something i'll post it here Link to comment Share on other sites More sharing options...
Colarocker Posted June 4, 2015 Share Posted June 4, 2015 (at first get the playerPOS with Ped PlayerID = PLAYER::PLAYER_PED_ID(); Vector3 playerPOS = ENTITY::GET_ENTITY_COORDS(PlayerID, true); ) after it use: Vehicle closestV; closestV = VEHICLE::GET_CLOSEST_VEHICLE(playerPOS.x, playerPOS.y, playerPOS.z, 20, 0, 70); VEHICLE::START_VEHICLE_ALARM(closestV); this one definetly worked for me! (just had to find a car with an alarm lol) have fun =) 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