So, waking this up again instead of making a new topic so people know where we’re at.
I want to build a survival server and I want cars to have trunk inventory but I don’t want them to be spawned or saved into a garage, I want it to be real life like, you leave your car in your yard, a neighbour comes and takes it and you’re fucked but you can recover it unless destroyed.
For now I just got the database structure which would be like:
carid(automatic id) plate(varchar) pos(varchar, x,y,z) state(if destroyed or not, to prevent spawning blowed up cars)
that would be for now and after that I would get the first connected player, if player joined trigger a server toggle that works once per server start, if the server reboots, it will only trigger on first join, that’s easy but what I find difficult is to sync them through players, so every player sees one car where it is, if more than a car is found it’s got to remove the dupe but how do you identify which one is the synced car.
Where I’m lost at is at GTA natives that could sync the cars.
The most “could work” thing I thought of is making it so if a player is on the server, no matter who it is, if he’s the first make him spawn the cars, sync them to all new players, not sure if GTA would allow transferring ownership of spawned cars so another player has it, the very next player could have the cars and sync them to the new.
I’m lost with the GTA net-work sync system since it wasn’t designed for this.
I’m really interested into this, I know it works on other platforms that work with SQL databases so if the engine is the same why would it not work here?
If someone could explain the GTA net-work sync system for entities I would highly appreciate!