-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vehicleshop stable version #87
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
mafewtm
approved these changes
Aug 28, 2024
Manason
reviewed
Aug 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the changes to qbx_vehicles being used in this PR?
Frowmza
commented
Aug 28, 2024
Manason
suggested changes
Aug 28, 2024
is this good?, i removed plate from filters in qbx_vehicles here |
as for local function createPlayerVehicle(request)
assert(request.model ~= nil, 'missing required field: model')
local props = request.props or {}
if not props.plate then
repeat
props.plate = qbx.generateRandomPlate()
until doesEntityPlateExist(props.plate) == false
end
props.engineHealth = props.engineHealth or 1000
props.bodyHealth = props.bodyHealth or 1000
props.fuelLevel = props.fuelLevel or 100
props.model = joaat(request.model)
if not triggerEventHooks('createPlayerVehicle', { citizenid = request.citizenid, garage = request.garage, props = props }) then
return nil, {
code = 'hook_cancelled',
message = 'a createPlayerVehicle event hook cancelled this operation'
}
end
local vehicleId = MySQL.insert.await('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, state, garage) VALUES ((SELECT license FROM players WHERE citizenid = @citizenid), @citizenid, @vehicle, @hash, @mods, @plate, @state, @garage)', {
citizenid = request.citizenid,
vehicle = request.model,
hash = props.model,
mods = json.encode(props),
plate = props.plate,
state = request.garage and State.GARAGED or State.OUT,
garage = request.garage
})
return {
vehicleId = vehicleId,
plate = props.plate
}
-- or this so we dont need to make changes where this function is used in any other resource
-- return vehicleId, props.plate
end |
this tested and ready for a review! |
Manason
suggested changes
Aug 29, 2024
Manason
suggested changes
Aug 30, 2024
Manason
approved these changes
Aug 30, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
isInTestDrive
to check if player is in test driveChecklist