Jump to content

help


Nedim

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...