Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.

refactor: bpt_boat\server\main.lua#1035

Merged
bitpredator merged 1 commit intomainfrom
dev-bitpredator
Mar 18, 2025
Merged

refactor: bpt_boat\server\main.lua#1035
bitpredator merged 1 commit intomainfrom
dev-bitpredator

Conversation

@bitpredator
Copy link
Owner

ParkBoats function: Handles parking of all boats not saved in the database, updating the stored field to true for those boats that were still out of the garage.
Callback bpt_boat:buyBoat: Checks if the player has enough money to buy a boat and updates the database to mark the boat as purchased. If the price is 0 (bad model), it signals an exploit attempt.
Event bpt_boat:takeOutVehicle: When a player wants to take a boat from the garage, the function updates the database to mark the boat as "out" of the garage (stored = false).
Callback bpt_boat:storeVehicle: Handles the logic to park the boat in the garage, updating the database to mark the boat as "in garage" (stored = true).
Callback bpt_boat:getGarage: Returns all boats saved in a player's garage, loading the data from the database.
Callback bpt_boat:buyBoatLicense: Allows to buy a license for the boat, if the player has enough money.

Tables Check: Make sure that the database has the table owned_vehicles with the necessary columns like owner, plate, vehicle, type and stored. Licenses: The licensing system is managed via the esx_license:addLicense event.
Make sure that the ESX licensing system is properly configured on your server.

Fixes #[issue_no]

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Does your submission pass tests?

Please describe the changes this PR makes and why it should be merged:

Discord username (if different from GitHub):

ParkBoats function: Handles parking of all boats not saved in the database, updating the stored field to true for those boats that were still out of the garage.
Callback bpt_boat:buyBoat: Checks if the player has enough money to buy a boat and updates the database to mark the boat as purchased. If the price is 0 (bad model), it signals an exploit attempt.
Event bpt_boat:takeOutVehicle: When a player wants to take a boat from the garage, the function updates the database to mark the boat as "out" of the garage (stored = false).
Callback bpt_boat:storeVehicle: Handles the logic to park the boat in the garage, updating the database to mark the boat as "in garage" (stored = true).
Callback bpt_boat:getGarage: Returns all boats saved in a player's garage, loading the data from the database.
Callback bpt_boat:buyBoatLicense: Allows to buy a license for the boat, if the player has enough money.
Considerations:
Tables Check: Make sure that the database has the table owned_vehicles with the necessary columns like owner, plate, vehicle, type and stored.
Licenses: The licensing system is managed via the esx_license:addLicense event. Make sure that the ESX licensing system is properly configured on your server.
@bitpredator bitpredator merged commit 39614d2 into main Mar 18, 2025
6 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant