Nedim Posted September 21, 2022 Share Posted September 21, 2022 ERROR: vehicles\vehicles.lua:3: call: failed to call 'db:getConnection' [string "?"] code : local db = exports.db:getConnection() another : WARNING: vehicles\vehicles.lua:7: Bad argument @ 'dbExec' [Expected db-connection at argument 1, got boolean] : dbExec(db, 'INSERT INTO vehicles (model, x, y, z) VALUES (?, ?, ?, ?)', model, x, y, z) server log: ================================================================== = Multi Theft Auto: San Andreas v1.5.9 ================================================================== = Server name : Default MTA Server = Server IP address: auto = Server port : 22003 = = Log file : ..ktop/server/mods/deathmatch/logs/server.log = Maximum players : 32 = HTTP port : 22005 = Voice Chat : Disabled = Bandwidth saving : Medium ================================================================== [2022-09-21 18:44:30] Resources: 3 loaded, 0 failed [2022-09-21 18:44:30] Starting resources...... [2022-09-21 18:44:30] Authorized serial account protection is enabled for the ACL group(s): `Admin` See http://mtasa.com/authserial [2022-09-21 18:44:30] WARNING: <owner_email_address> not set [2022-09-21 18:44:30] Server started and is ready to accept connections! [2022-09-21 18:44:30] To stop the server, type 'shutdown' or press Ctrl-C [2022-09-21 18:44:30] Type 'help' for a list of commands. [2022-09-21 18:44:30] Querying MTA master server... success! (Auto detected IP:31.176.135.138) [2022-09-21 18:44:57] Server minclientversion is now 1.5.9-9.21261.0 [2022-09-21 18:44:57] CONNECT: LooseMariachi11 connected (IP: 192.168.1.2 Serial: 505A20AA19516EE7B5BA1FFA5FB1A8B4 Version: 1.5.9-9.21324.0) [2022-09-21 18:44:58] JOIN: LooseMariachi11 joined the game (IP: 192.168.1.2) [2022-09-21 18:45:03] ERROR: vehicles\vehicles.lua:3: call: failed to call 'db:getConnection' [string "?"] [2022-09-21 18:45:03] WARNING: vehicles\vehicles.lua:7: Bad argument @ 'dbExec' [Expected db-connection at argument 1, got boolean] [2022-09-21 18:45:30] QUIT: LooseMariachi11 left the game [Quit] Link to comment
AngelAlpha Posted September 22, 2022 Share Posted September 22, 2022 17 minutes ago, Nedim said: help? check dbConnect function in db. Maybe wrong data Link to comment
Nedim Posted September 22, 2022 Author Share Posted September 22, 2022 1 hour ago, AngelAlpha said: check dbConnect function in db. Maybe wrong data local db = exports.db:getConnection() Link to comment
βurak Posted September 22, 2022 Share Posted September 22, 2022 (edited) can you show the codes and meta.xml file? Edited September 22, 2022 by Burak5312 Link to comment
Nedim Posted September 22, 2022 Author Share Posted September 22, 2022 12 minutes ago, Burak5312 said: can you show the codes and meta.xml file? <meta> <script src="vehicles.lua" type="server"/> </meta> function createVehicleForPlayer(player, command, model) local db = exports.db:getConnection() local x, y, z = getElementPosition(player) y = y + 5 dbExec(db, 'INSERT INTO vehicles (model, x, y, z) VALUES (?, ?, ?, ?)', model, x, y, z) createVehicle(model, x, y, z) end Link to comment
βurak Posted September 22, 2022 Share Posted September 22, 2022 (edited) Can you show the meta.xml file of the script you connected to the database? Edited September 22, 2022 by Burak5312 Link to comment
Nedim Posted September 22, 2022 Author Share Posted September 22, 2022 1 minute ago, Burak5312 said: Can you show the meta.xml file of the script you connected to the database? <meta> <script src="db.lua" type="server"/> <export function="getConnection" type="server"/> </meta> Link to comment
βurak Posted September 22, 2022 Share Posted September 22, 2022 Can you show the code for the db.lua file? Link to comment
Nedim Posted September 22, 2022 Author Share Posted September 22, 2022 i fixed all erors Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now