Skip to content

Conversation

@Scullyy
Copy link

@Scullyy Scullyy commented Jan 17, 2025

  • Adds server event to update the mismatched vehicle types list, this removes the requirement to update the list every time you update your artifacts.
  • Moves mismatched types to server due to being required for the event to work, event needs to be server sided to prevent abuse.
  • Tested on b3258 with the latest artifacts and txAdmin version as of this PR and working.

Example usage:

TriggerEvent('txAdmin:menu:addMismatchedTypes', {
    caddy3 = 'automobile',
    trailersmall2 = 'trailer',
    scrap = 'automobile',
    tractor3 = 'automobile'
})

- Adds event to update the mismatched vehicle types list.
- Moves mismatched types to server.

Example usage:

```lua
TriggerEvent('txAdmin:menu:addMismatchedTypes', {
    caddy3 = 'automobile',
    trailersmall2 = 'trailer',
    scrap = 'automobile',
    tractor3 = 'automobile'
})
```
@Scullyy Scullyy requested a review from tabarra as a code owner January 17, 2025 21:16
@tabarra
Copy link
Collaborator

tabarra commented Feb 23, 2025

@Scullyy Thanks for the PR.

If the system is broken in txAdmin, the right thing is for it to be fixed in txAdmin instead of getting individual server owners to fix it themselves.

That being, said, I tried updating this using my old guide and something is very wrong.
The list of classes seem to now be 22 items long instead of just 7, as can be seen in the fivem docs, and using this list marks all 844 vehicles as divergent.
But furthermore, I tried spawning a vehicle from the list and the game didn't crash as it usually did.

Can someone that knows more about the game help me fix this issue? Is this still even an issue?!

@Scullyy
Copy link
Author

Scullyy commented Feb 23, 2025

@Scullyy Thanks for the PR.

If the system is broken in txAdmin, the right thing is for it to be fixed in txAdmin instead of getting individual server owners to fix it themselves.

That being, said, I tried updating this using my old guide and something is very wrong. The list of classes seem to now be 22 items long instead of just 7, as can be seen in the fivem docs, and using this list marks all 844 vehicles as divergent. But furthermore, I tried spawning a vehicle from the list and the game didn't crash as it usually did.

Can someone that knows more about the game help me fix this issue? Is this still even an issue?!

Hey, nothing was broken in TxAdmin. The vanilla vehicles were just used an example to show usage, this is just so server owners can add their addon vehicles without needing to update the list each time but the current implementation works perfectly fine for vanilla vehicles.

@tabarra
Copy link
Collaborator

tabarra commented Feb 23, 2025

It's weird though, because the data changed, and it still works without updating it?!

@Scullyy
Copy link
Author

Scullyy commented Feb 24, 2025

It's weird though, because the data changed, and it still works without updating it?!

Some of the newer dlc vehicles may not work as they’re not listed but I meant the old method can continue to be used for default GTA vehicles with my PR as all I did was just move it to the server and add an api to add to the list externally so that people can put their addon vehicles that they download for their server on the list and they won’t need to make any changes between TxAdmin updates.

For example I have a hot air balloon vehicle and a truck that has a mismatched type so I would trigger the event in a server script which will put them on the mismatched list and allow them to spawn correctly in TxAdmin between updates without needing to edit the monitor resource.

@tabarra
Copy link
Collaborator

tabarra commented Feb 24, 2025

When trying to spawn a vehicle with wrong class/type, does it crash the client like it used to?

@Scullyy
Copy link
Author

Scullyy commented Feb 24, 2025

When trying to spawn a vehicle with wrong class/type, does it crash the client like it used to?

When I spawn a vehicle that has a mismatched type (without it being on the list to correct them) it will spawn an incorrect vehicle. Like let's say a truck was a trailer instead of spawning the truck it would spawn a trailer.

@Scullyy
Copy link
Author

Scullyy commented Feb 24, 2025

But to be clear this PR wasn't to resolve any kind of bug as I had no issue with the current system, this is only to implement an API so you can put your add-on vehicles onto the list that you download for your server without needing to edit the monitor resource each time.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants