04.04.2013, 09:38
Ok so I am creating my vehicle system and I am stuck on the logic.
At the mo I have an enum with all the vInfo. When a player spawns I want to spawn all their vehicles, when they leave de spawn all of them.
So in OnPlayerSpawn I run the command to collect all players vehicles. BUT!!!! here is the problem. I want to now set these into the enum in this format
playerVehicles[vehicleid][vBitOfInfoHere] But I don't have the vehicleid yet as I haven't spawned it but I can't spawn it till I have set all the relevent info. I'm at a bit of a loss to be honest.
Obviously vehicleid is the only identifier that is kept while the players vehicles are loaded so I'm struggling with how to do it. I need the enum because I want to update the data about the vehicle periodically while the player is on without having to call to the database each time.
Hope it makes sense
At the mo I have an enum with all the vInfo. When a player spawns I want to spawn all their vehicles, when they leave de spawn all of them.
So in OnPlayerSpawn I run the command to collect all players vehicles. BUT!!!! here is the problem. I want to now set these into the enum in this format
playerVehicles[vehicleid][vBitOfInfoHere] But I don't have the vehicleid yet as I haven't spawned it but I can't spawn it till I have set all the relevent info. I'm at a bit of a loss to be honest.
Obviously vehicleid is the only identifier that is kept while the players vehicles are loaded so I'm struggling with how to do it. I need the enum because I want to update the data about the vehicle periodically while the player is on without having to call to the database each time.
Hope it makes sense