Vehicle Types (MySQL)
#1

Right, I'm revamping my vehicle system, and am wondering what I'm best off doing:

All's I have in my head at the minute would be to add in three fields into my vehicle table structure.

- FactionID (default value would be 0)
- GangID (default value would be 0)
- JobID (default value would be 0)
- Owned (default value would be 0)

Then if it's a faction vehicle for example, the value would be 1 (which is the faction id of LSPD) and the other 3 fields would then be 0.

Or is there a better and / or easier way to do this?
Reply
#2

There's not really a better way to do it, they shouldn't ever conflict anyway. It's the way I do it.

EDIT: Sorry there is more than one way, but it involves storing all vehicles seperately, which creates 3 sets of problems instead of one.
Reply
#3

You COULD define some "vehicle types" in your mode, that would save you from having 3 unnecessary fields. And you could have something like "possibleID" if the "vehicle type" is equivalent to something you would need to have an ID for...
Reply
#4

So, would something like this suffice?

1) Owned Vehicle
2) Faction Vehicle
3) Gang Vehicle
4) Job Vehicle
Reply
#5

This is what I was thinking:

pawn Код:
#define VEHICLE_TYPE_OWNED      1
#define VEHICLE_TYPE_FACTION    1
#define VEHICLE_TYPE_JOB        1
#define VEHICLE_TYPE_GANG       1
But in a nutshell, yes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)