GithubHelp home page GithubHelp logo

esx-qalle-sellvehicles's Introduction

Hi, I'm qalle

  • ๐Ÿซ I am a Computer Science and Software Engineer student at Chalmers Institute of Technology in Gothenburg.
  • FiveM Enthusiast, with hundreds of resources made, both public and private.
  • ๐Ÿง‘โ€๐Ÿ’ป I love using Software as a solution for every Problem.
  • ๐Ÿ’ป I am a fluent programmer in Lua, C#, TypeScript and Python.
  • ๐Ÿง‘โ€๐ŸŽ“ Iโ€™m currently learning Computer Science and how to use Assembly Language.
  • ๐Ÿค“ Always learning new things.

Statistics

esx-qalle-sellvehicles's People

Contributors

qalle-git avatar redalex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esx-qalle-sellvehicles's Issues

2 Garages both working, I have only 1 error

If i buy a car on the first 1 everything works perfect..on the second im getting error..
I change the SQL Tables
1st Garage SQL Table: vehicles_for_sale
2nd Garage SQL Table: vehicles_for_sale2

and i change those
1st Garage:
ESX.RegisterServerCallback("esx-qalle-sellvehicles:buyVehicle", function(source, cb, vehProps, price)
2nd Garage
ESX.RegisterServerCallback("esx-qalle-sellvehicles:buyVehicle2", function(source, cb, vehProps, price)

stack traceback:
        @esx_qalle-sellvehicles/server/main.lua:85: in upvalue 'ref'
        citizen:/scripting/lua/scheduler.lua:389: in function <citizen:/scripting/lua/scheduler.lua:388>
        [C]: in function 'xpcall'
        citizen:/scripting/lua/scheduler.lua:388: in function <citizen:/scripting/lua/scheduler.lua:387>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:403: in function <citizen:/scripting/lua/scheduler.lua:372>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/MessagePack.lua:830: in method 'underflow'
        citizen:/scripting/lua/MessagePack.lua:465: in field 'any'
        citizen:/scripting/lua/MessagePack.lua:860: in field 'unpack'
        citizen:/scripting/lua/scheduler.lua:626: in field '?'
        @es_extended/server/functions.lua:33: in field 'TriggerServerCallback'
        @es_extended/server/common.lua:63: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>

on this line

	if xPlayer.getAccount("bank")["money"] >= price or price == 0 then

If someone can help <3

players get no money when selling a car

players get no money when selling a car, no notifications or anything. i really want this script for my server but its kinda a necessity to give the players money when the car gets sold.

Vehicles dissapear

The vehicles dissapear when there is a server restart but instead they come bank they dont!!!!

They stay active in the database but are not showned. We have enough sell places in the config theres no error.

Does somebody know how to fix this please!

Cannot sell or retrieve vehicles

I got an error after switching to the new es_extended. I go to the place and sit in the car but when I click to buy it nothing happens

When the user is offline

When the user who owns the vehicle is disconnected, the money does not go to his account
[ERROR] [MySQL] [esx-qalle-sellvehicles] An error happens on MySQL for query "UPDATE users SET bank = bank + 50 WHERE identifier = '380529ae28a898a88a896ce1a64dd33362e5945c'": ER_BAD_FIELD_ERROR: Unknown column 'bank' in 'field list'

Sell other people's cars

Hello! I'm trying to edit esx-qalle-sellvehicles (awesome script btw) so that players can sell other player's cars.

I looked into the server.lua and the "owner check" is right there :

function RetrievePlayerVehicles(newIdentifier, cb)
    local identifier = newIdentifier

    local yourVehicles = {}

    MySQL.Async.fetchAll("SELECT * FROM owned_vehicles WHERE owner = @identifier", {['@identifier'] = identifier}, function(result) 

        for id, values in pairs(result) do

            local vehicle = json.decode(values.vehicle)
            local plate = values.plate

            table.insert(yourVehicles, { vehicle = vehicle, plate = plate })
        end

        cb(yourVehicles)

    end)
end

So this function give the list of owned vehicles for the seller, and if the vehicle that's being sold is in that list, it works
I want the function to search by plate rather than listing user's plates to check if he owns the car

I suppose it's the way i need to edit the script but im not 100% sure
Any help pls? :)

Vehicule directly on garage.

Hello i need for my server to have vehicule directly on garage. I have update the sql request to add state.

MySQL.Async.execute("INSERT INTO owned_vehicles (plate, owner, vehicle, state) VALUES (@plate, @Identifier, @vehProps, @State)",
{
["@plate"] = plate,
["@Identifier"] = xPlayer["identifier"],
["@vehProps"] = json.encode(vehProps),
["@State"] = 1
}
)

Bank issue

[ script:oxmysql] SCRIPT ERROR in promise (unhandled): Error: esx-qalle-sellvehicles was unable to execute a query!
[ script:oxmysql] Unknown column 'bank' in 'field list'
[ script:oxmysql] SELECT bank FROM users WHERE identifier = 'char7:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
[ script:oxmysql] > query_default (@oxmysql/dist/server/build.js:16103)
[ script:oxmysql] > processTicksAndRejections (node:internal/process/task_queues:96)

It seems the sql file is uncomplete. I suggest to target the IBAN ID of the client, wich is already managed by financial scripts.

can't set price

when i come on the point to sell , i can't set the price , the menu stuck on set price

He can not sell a car

He can not sell a car. Has the apartment in line 40 server/main.lua v.plate? If I switch to a plate, the car can be sold but I can not own it

2 garages

How to make this work with 2 garages... because i got 2 garages with same cars on both

Offline Player does not receive money (FIX) ESX 1.9 VERSION

IF U R USING ESX 1.9 VERSION U CAN CHANGE YOUR server\main.lua like this
MySQL.Async.fetchAll('SELECT accounts FROM users WHERE identifier = @identifier', { ["@identifier"] = identifier }, function(result) if result[1] ~= nil then local accs = json.decode(result[1].accounts) accs.bank = accs.bank + cash print(accs.bank) MySQL.Async.execute("UPDATE users SET accounts = @newBank WHERE identifier = @identifier", { ["@identifier"] = identifier, ["@newBank"] = json.encode(accs) } ) end end)

Brought used cars aren't owned by the play who brought them

It seems when people buy a used car, they own them but when they try to store them again they can't due to not owning them even though they do.

I'm unsure if this is something to do with your script or vehicle shop script. Either way any help would be awesome!

Person Pays full price, Seller only receives $1

Hey,
Having a issue with the plugin, Had a few people's car for sale in the lot, All for different prices. Some guy came and bought them, paid full price for them but sellers only received $1 for the sale.

Could you look into this as i love having this plugin on my server and would hate to remove it

Thanks

Vehicles in ground

image

I have this issue.. If I restart script or add new vehicle everything is fine.

image

Offline Player does not receive money (FIX)

function UpdateCash(identifier, cash)
local xPlayer = ESX.GetPlayerFromIdentifier(identifier)

if xPlayer ~= nil then
	xPlayer.addAccountMoney("bank", cash)

	TriggerClientEvent("esx:showNotification", xPlayer.source, "Someone bought your vehicle and transferred $" .. cash)
else
	MySQL.Async.fetchAll('SELECT accounts FROM users WHERE identifier = @identifier', { ["@identifier"] = identifier }, function(result)
		if result[1] ~= nil then
    local accs = json.decode(result[1].accounts)

accs.bank = accs.bank + cash
MySQL.Async.execute("UPDATE users SET account = @NewBank WHERE identifier = @Identifier",
{
["@Identifier"] = identifier,
["@NewBank"] = json.encode(accs)
}
)
end
end)
end
end

vehicle job

Hi
i have a problem with my script job when any one try to get a job car and open the trunk it said not your car
can u help me please
esx server

error:
[esx_jobs] An error happens for query "INSERT INTO owned_vehicles (plate, owner) VALUES (?, @owner) : ["WRK 4347"]": ER_BAD_NULL_ERROR: Column 'owner' cannot be null
[script:hop_vehcontro] event baseevents:enteringVehicle was not safe for net

HELP ME PLease

I have a problem when i enter the price of the vehicles the dialog doesn't close

cant sell car

Hi im using an older version of Vehicleshop because the new one are buged as F.
so when i try to put it out for sale it say that i dont own the car. i understand that it has to do with tables in sql but mby you can help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.