qalle
December 4, 2018, 9:23pm
1
esx-qalle-sellvehicles
[NOTES]
This gives you the opportunity to sell your vehicle to another player with modifications and own price.
If you find any bug, lemme know and i’ll fix it as quick as possible.
If you got feedback how to do it better, lemme know and i’ll redo it.
Right now you can only sell 11 vehicles max, you can add more by adding more positions in Config.SellPositions
This is like an dealership for used cars.
[REQUIREMENTS]
[INSTALLATION]
Download: GitHub - qalle-git/esx-qalle-sellvehicles: This gives you the opportunity to sell cars to eachother.
Import SQL.
Add this in your server.cfg :
start esx-qalle-sellvehicles
[SCREENSHOTS]
Here you set the price to what you want others to pay for it.
If you want to change the price you can do so, else just put it up for sale.
Here you see the price of the vehicle, you need to sit in it to access the buy menu.
If you own it you can remove it. Otherwise just buy it.
35 Likes
J_E
December 4, 2018, 9:52pm
2
oooh thanks for the hard work running into an issue
Not sure if I missed a step …
qalle
December 4, 2018, 9:52pm
3
Oh uploaded wrong sql file 1 sec.
1 Like
qalle
December 4, 2018, 9:53pm
4
Download the new sql file and insert it.
1 Like
qalle
December 4, 2018, 10:18pm
6
Fixed. Forgot to remove an ) for you that got errors. Redownload it.
1 Like
How do you counter everything when the server is restarted and someone has their car out there for sale what happens? when the server is restarted when it loads back up do their models re appear?
qalle
December 4, 2018, 10:29pm
8
Yes this is database made. It loads the cars on esx:playerLoaded or when resource is restarted.
2 Likes
När man ska slänga upp en bil för försäljning så står det att det redan är 11 ute :S
1 Like
jul_DX
December 4, 2018, 10:54pm
10
Hello I do not see the petite For sale and I have this error
Don
December 5, 2018, 1:28am
13
No, it only works for essx
Love the idea, but im having an issue. No errors in console, or debug. Just this error when trying to place a vehicle for a sale. There are none on the lot, obviously. SQL is installed fine. Again, love the idea, and your other scripts!
degen
December 5, 2018, 8:05am
16
It checks for validity on clientside from server callback and does not get fulfilled. Something to do with this line perhaps…
local xPlayer = ESX.GetPlayerFromId(src)
local plate = vehicleProps["plate"]
local isFound = false
RetrievePlayerVehicles(xPlayer.identifier, function(ownedVehicles)
for id, v in pairs(ownedVehicles) do
if plate == v.plate and #Config.VehiclePositions ~= VehiclesForSale then
MySQL.Async.execute("INSERT INTO vehicles_for_sale (seller, vehicleProps, price) VALUES (@sellerIdentifier, @vehProps, @vehPrice)",
{
["@sellerIdentifier"] = xPlayer["identifier"],
["@vehProps"] = json.encode(vehicleProps),
["@vehPrice"] = price
}
)
MySQL.Async.execute('DELETE FROM owned_vehicles WHERE plate = @plate', { ["@plate"] = plate})
1 Like
qalle
December 5, 2018, 8:22am
17
Ill see what I can find I don’t get the error myself.
i also got the same error as @BrickTree
Appreciate your time man. Thanks!
lucamas
December 5, 2018, 10:40am
21
ì get the same problem with the car is not mine/11 cars for sale ??
any ideas on how to fix this ?
in my database for my owned vehicles they are different to the sql u have
mine ar id, vehicle, owner, plate, state
and yours are id, vehicles, vehicleProps, price ?