Skip to content

Conversation

@SophiaDLL
Copy link

Sell Vehicles

  • Added SellVeh Event
  • Added a sell vehicle function into the Vehicle shop
  • Changed the way vehicles are stored to the data base to include vehicle price
  • Vehicles sell for 50% of original Value

stats now show

  • money
  • level
  • drift session points
  • total drift points
  • your crew name

Sophia added 3 commits February 7, 2025 07:10
- Added SellVeh Event
- Added a sell vehicle function into the Vehicle shop
- Changed the way vehicles are stored to the data base to include vehicle price
- Vehicles sell for 50% of original Value
stats now show 
- money
- level
- drift session points
- total drift points
- your crew name
implemented fetures for new stats
@nzkfc
Copy link

nzkfc commented Feb 7, 2025

I approve

Copy link

@nzkfc nzkfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loaded and looks good for pull

Sophia Black added 6 commits April 14, 2025 14:46
- minimum buy price of a vehicle

- The original Money Math of points / 200 insted of points / 80 witch is in DVRM

-added a "," to the ending line of 
 - "crewOwner = false" to "crewOwner = false,"
after i deleted this by accident i have re-instated them to the code.
Have reversed what i had done with the merging the following into " Refresh other player data" 

```
RegisterNetEvent("driftV:RefreshCrewRanking", function(ranking)
    CrewRanking = ranking
end)
```
@SophiaDLL
Copy link
Author

Re-reading over a lot of the code that i had removed/changed for no reason within this PR I have then reverted from what i had done and sent out the new commits Regarding what should have been Kept in the Sources and is ready for merge If wanted.

@Rubylium
Copy link
Owner

It is hard for me to validate the PR, lot of things changed, more than the title would suggest (Change made to the buy part, change made to loading data for some reason). I would need to test those change myself and I'm afraid I don't have a lot of time those days.

Also unless I forgot how I coded that few years ago, drift:FetchVehicles should not be needed to hit the database to get the current vehicle list of the player, all those data should already be on the server side cache.

About the Events.sellVeh logic, I see you based your logic on the model of the vehicle, but that would cause issue if 1 player has multiple cars of the same model, the logic would just take the first one it found in the list which is not ideal, maybe base this logic on an uid / table index ? ( Uid would be more robust here, but that would mean adding this data to the cars table when loading it in the cache ).

@SophiaDLL
Copy link
Author

Hello, Thank you for getting back on the pr.

would cause issue if 1 player has multiple cars of the same model, the logic would just take the first one it found in the list which is not ideal

This is something that i have not personally actually had time to check on myself Due to myself being busy and taking time away from my remastered project so i never fully tested it on the base However all fetures where working as inteded when myself and nz had used it in 2 diffirent servers of our own. || This indeed is not the most ideal way of doing this.

( We have added in a Block from buy multiple vehicles due to an issue where it would pull out every vehicle that is owned under the same spawn code. this is why we added the blocking feature for buying multiple of the same vehicle's)

base this logic on an uid / table index ?

This is indeed something that i will look into doing if i have the spare time to put it together. (aswell as would change the way that the vehicle preview system works for selling vehicles so that it would get your specific car rather than just what the model(vehicle) looks like)

Also unless I forgot how I coded that few years ago, drift:FetchVehicles should not be needed to hit the database to get the current vehicle list of the player, all those data should already be on the server side cache.

As we work in a team and this was split between 2 people i can not explain entirely why using drift:FetchVehicles was used in regards to this, It may be due to the fact that We had not fully looked thru how everything was coded at the time & Just used the Drift:FetchVehicles as an easy way of getting them at the time.


The code for this was entirely just ripped out of what system we have worked on & Used from our version of DriftV So i will run a base driftV Server and double check to make sure that the edits that where added Are entirely working. I will also look over what i have added and add onto that what i have done to make it more standing aswell as to see what we have changed to the buy part of the syste (Witch to what im aware is how many of 1 car you could buy due to getting a car out it would get both all vehicles with the same name witch could be resolved by making vehicles use a ID System rather than relying on the vehicles spawn code)

Finishing comment : Myself as well as my team will look over the work that we have done and resolve any issues//unnecessary changes that we have made for the base Also wanted to look into doing a flag system that would change the price of the vehicles sell based on if there was upgrades or not but the main thing is time related

@Rubylium
Copy link
Owner

To be honest the code is old, even tho I took some time to upgrade some part some time ago, most of it is old and pretty badly coded so I don't blame yourself when trying to tweak it now, it's hard to do things properly when all the others things aside are not done properly ^^'
There is so many part of the code that don't follow good practice (The first thing I can think of is the crew refresh logic that can litteraly destroy the server network as it send WAY too much data the more crew there is on the server, if you run a server I highly suggest removing/reworking that part)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants