You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many servers end up using custom scripts that add new columns to the player_vehicles table. This data, such as fake plates, NOS, mileage, stolen/vinscratched, etc always gets lost without customization to the SQL whenever there are changes in player_vehicles. This happens because the vehicle is deleted and only basic information is transferred over to the consignment table.
Ideal solution
Refactor the occasions_vehicles table and rename to consignment_vehicles. Heck, rename the entire resource to qbx_consignment
Drop seller, plate, model, mods columns
Create a new column player_vehicle_id
Add foreign key relationship to player_vehiclesid column
When a used vehicle is marked for sale, use the player_vehiclesid to and change the status to a status not in use - such as 100 (thinking of this in terms of firewall rules, giving room for existing servers that may have more statuses in use).
Use a JOIN to pull in relevant information from the player_vehicle table to populate the contract/load the used car dealership.
Whenever a car is purchase, just update the owners info instead of this hodgepodge of moving data between tables.
Garage scripts will have to exclude this from their lists just like they should do for impounded vehicles. Phone could be modified to show "For Sale" status.
Alternative solutions
Remove the consignment lot and only offer the buyback.
Create vehicle contracts to sell cars between players.
Additional context
No response
The text was updated successfully, but these errors were encountered:
The problem
Many servers end up using custom scripts that add new columns to the player_vehicles table. This data, such as fake plates, NOS, mileage, stolen/vinscratched, etc always gets lost without customization to the SQL whenever there are changes in player_vehicles. This happens because the vehicle is deleted and only basic information is transferred over to the consignment table.
Ideal solution
Refactor the
occasions_vehicles
table and rename toconsignment_vehicles
. Heck, rename the entire resource toqbx_consignment
seller
,plate
,model
,mods
columnsplayer_vehicle_id
player_vehicles
id
columnWhen a used vehicle is marked for sale, use the
player_vehicles
id
to and change the status to a status not in use - such as 100 (thinking of this in terms of firewall rules, giving room for existing servers that may have more statuses in use).Use a JOIN to pull in relevant information from the player_vehicle table to populate the contract/load the used car dealership.
Whenever a car is purchase, just update the owners info instead of this hodgepodge of moving data between tables.
Garage scripts will have to exclude this from their lists just like they should do for impounded vehicles. Phone could be modified to show "For Sale" status.
Alternative solutions
Additional context
No response
The text was updated successfully, but these errors were encountered: