Jump to content
  • 0

Set up vG script


Nicolasdes

Question

Hello, I've found vG's Sapphire Script and when I launch server.exe, it said (at the end):

[2012-05-19 12:57:39] ERROR: mysql\connection.lua:13: attempt to call global 'mysql_connect' (a nil value)

[2012-05-19 12:57:55] ERROR: attempt to call a nil value

[2012-05-19 12:57:55] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"]

Some lines of my connection.lua:

-- connection settings 
local hostname = "**HOST**" 
local username = "** USR **" 
local password = "**PASS**" 
local database = "**DB**" 
local port = 3306 
  
-- global things. 
local MySQLConnection = nil 
local resultPool = { } 
local sqllog = false 
local countqueries = 0 
  
-- connectToDatabase - Internal function, to spawn a DB connection 
function connectToDatabase(res) 
    MySQLConnection = mysql_connect(hostname, username, password, database, port) 
     
    if (not MySQLConnection) then 
        if (res == getThisResource()) then 
            cancelEvent(true, "Cannot connect to the database.") 
        end 
        return nil 
    end 
     
    return nil 
end 

SQL works with another gamemodes.

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