Jump to content

Need mysql/lua help asap! -- Please help....


Recommended Posts

i have this problem where when ever i install a resource in my server when i go into game the screeen is black and i lose all my guns and money. Ive fixed it once but i did the same thing as last time and now it wont work. (p.s ive got a host to host my server.) last time this happen i just put a new s_account_system.lua file in the account-system and re typed in mysql settings inot it . But it doesnt work now. If someone would like to help me please contact me via skype : deroboyy97 or pm me . I would put this script on but its got mysql passwords and that so u are going to help me pm and ill give u the script. Thanks

Edited by Guest
Link to comment

]

Clear the sql log

and pw then post here

local salt = "vgrpkeyscotland" 
mysql = exports.mysql 
  
-- //////////////////////////////////// 
-- //           MYSQL                // 
-- //////////////////////////////////// 
--sqlUsername = exports.mysql: 
--sqlPassword = exports.mysql: 
--sqlDB = exports.mysql: 
--sqlHost = exports.mysql: 
--sqlPort = exports.mysql: 
sqlUsername = "" 
sqlPassword = "" 
sqlDB = "" 
sqlHost = "" 
sqlPort = "" 
socket = "" 
  
handler = mysql_connect(, ,, , , ) 
  
function checkMySQL() 
    if not (mysql_ping(handler)) then 
        handler = mysql_connect(sqlHost, sqlUsername, sqlPassword, sqlDB, sqlPort, socket) 
    end 
end 
setTimer(checkMySQL, 300000, 0) 
  
function closeMySQL() 
    if (handler) then 
        mysql_close(handler) 
        handler = nil 
    end 
end 
addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), closeMySQL) 
-- //////////////////////////////////// 
-- //           MYSQL END            // 
-- //////////////////////////////////// 
  
addEvent("attemptRegister", true) 
addEventHandler("attemptRegister", getRootElement(), 
function ( username, password ) 
    if not (string.len(password) < 5) then 
        local password = md5(salt .. password) 
         
        local safeusername = mysql:escape_string(username) 
        local safepassword = mysql:escape_string(password) 
         
        local result = mysql:query_fetch_assoc("SELECT username FROM accounts WHERE username = '" .. safeusername .. "'") 
        if not (result) then 
            local newquery = mysql:query_free("INSERT INTO accounts SET username = '" .. safeusername .. "', password = '" .. safepassword .. "', registerdate=NOW() ") 
            if (newquery) then 
                local newAppState = mysql:query_free("UPDATE accounts SET appstate = '3' WHERE username = '" .. safeusername .. "'") 
                triggerClientEvent(source, "informRegister1", source) 
            else 
                outputChatBox("Error - 007.", source, 255, 0, 0) 
            end 
        else 
            triggerClientEvent(source, "informRegister2", source) 
        end 
    else 
        triggerClientEvent(source, "informRegister3", source) 
    end 
end 
  

please note the places are filled. I just took them out so u couldnt see em

Link to comment
looks fine. post server/script logs from the console.

here it is

Auto-restarting the server on crash 
(B )0 [?1049h [ r [m [4l [?1h = [39;49m [39;49m [37m [40m [1;1H[2;1H[3;1H[4;1H[5;1H[6;1H[7;1H[8;1H[9;1H[10;1H[11;1H[12;1H[13;1H[14;1H[15;1H[16;1H[17;1H[18;1H[19;1H[20;1H[21;1H[ H[ [24;1H   [1@ [30m [42m [H [23B   [1@ [H [m [39;49m [37m [40m [23B   [1@ [H[07:57:27] ERROR: exports: Call to non-running server resource (pool) [string "? [2;1H"] [ [07:57:27] ERROR: account-system/s_account_system_sapphire.lua:94: bad argument [ #1 to 'ipairs' (table expected, got nil) [ [07:57:27] start: Resource 'character-system' started [ [07:57:27] start: Resource 'carshop-cc' started [ [07:57:27] start: Resource 'carshop-g' started [ [07:57:27] start: Resource 'bikeshop' started [ [07:57:27] start: Resource 'boatshop' started [ [07:57:27] start: Resource 'carshop-low' started [ [07:57:27] start: Resource 'marquis-shop' started [ [07:57:28] WARNING: fuel-system/s_fuel_system.lua:90: Bad argument @ 'setTimer' [ [Expected number at argument 3, got function] [ [07:57:28] Please wait... [ [07:57:28] WARNING: killmessages/vgkillmessages_server.lua:80: Bad argument @ 'a [16;1HddEvent' [Expected bool at argument 2, got string 'wasted,killer,weapon'] [ [07:57:28] INFO: Lottery will be drawn in 303 minutes. [ [07:57:29] ERROR: realism-system/s_vehicle_crash.lua:11: attempt to call global [ 'getLocalPlayer' (a nil value) [ [07:57:29] ERROR: vehicle-interiors/s_vehicle_interiors.lua:35: attempt to perfo [21;1Hrm arithmetic on a boolean value [ [07:57:29] Server started and is ready to accept connections! [ [07:57:29] Type 'help' for a list of commands. [ [30m [42m   [1@ [m [39;49m [37m [40m   [1@ [H [3M [23B   [1@ [30m [42m M [m [39;49m [37m [40m[ H[21;1H[07:57:29] --------------------------------------------- [ [07:57:29] Viscaria Character System By: Dev, version: 1.1, Started. [ [07:57:29] --------------------------------------------- [ [30m [42m   [1@ [m [39;49m [37m [40m   [1@ [H [3M [23B   [1@ [30m [42m M [m [39;49m [37m [40m[ H[21;1H[07:57:30] Stopping global [ [07:57:30] Starting global [ [07:57:30] global restarted successfully [ [30m [42m   [1@ [m [39;49m [37m [40m 

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