zDxvilZ Posted June 13, 2020 Posted June 13, 2020 Hey Guys, I have a question. And if a player buys a car, how do I save it in the database Thanks for your help!
sparx Posted June 13, 2020 Posted June 13, 2020 Have a vehicles table with all of the columns relating to the vehicles properties then a foreign key for the players unique ID (ex. OwnerID). To get the players vehicles just fetch all vehicles where the players unique ID (ID/GUID/Whatever) matches that unique ID on the vehicles table (OwnerID). To save a new vehicle to the database as mentioned above you'll have a vehicle table with the vehicle properties and it's just a matter of doing an INSERT/UPDATE query with the required data. There are other more detailed database design methods but this one is pretty universal.
zDxvilZ Posted June 30, 2020 Author Posted June 30, 2020 And how do I „park“ the car? That the car is right in front of me. Thanks!
Division Posted June 30, 2020 Posted June 30, 2020 Loop all vehicles and get the closest one to your player position. Take that car object and safe it to the database.
qdex Posted June 30, 2020 Posted June 30, 2020 add me on discord i can give you a example discord : qdex#3223 1
zDxvilZ Posted June 30, 2020 Author Posted June 30, 2020 (edited) Can you add me on discord @qdex? because i get an error that discord don't find your name Fabio_#5860 Edited June 30, 2020 by zDxvilZ 1
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