Jump to content

[HELP] Pls help me


Recommended Posts

Hi all,

Today an guy give me an Arena's Resource with name "xnotify":

and problem is : i can't login/register ...

Problem is something with DB (DataBase) on localhost

-- Look at Problem :

46005675.png

-- Look at login panel ( Jake resource)

32853325.png

Please man help me

Look at server logs warnings :

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:181: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:182: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:31] INFO: K

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:258: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:181: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:182: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:31] INFO: K

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:258: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:181: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:182: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:31] INFO: K

[2013-05-21 17:39:31] WARNING: xnotify\server\core.lua:258: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:32] WARNING: xnotify\server\core.lua:181: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:32] WARNING: xnotify\server\core.lua:182: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:32] INFO: K

[2013-05-21 17:39:32] WARNING: xnotify\server\core.lua:258: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:51] WARNING: xnotify\server\core.lua:122: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:51] WARNING: xnotify\server\core.lua:123: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:51] ERROR: xnotify\server\core.lua:124: attempt to get length of local 'row' (a boolean value)

[2013-05-21 17:39:52] WARNING: xnotify\server\core.lua:122: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:52] WARNING: xnotify\server\core.lua:123: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:52] ERROR: xnotify\server\core.lua:124: attempt to get length of local 'row' (a boolean value)

[2013-05-21 17:39:52] WARNING: xnotify\server\core.lua:122: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:52] WARNING: xnotify\server\core.lua:123: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:52] ERROR: xnotify\server\core.lua:124: attempt to get length of local 'row' (a boolean value)

[2013-05-21 17:39:52] ERROR: SHC pointsystem: Bad argument (Could not get Data) ?

[2013-05-21 17:39:53] INFO: Warping player into vehicle for -spr-GiM

[2013-05-21 17:39:55] INFO: Warping player into vehicle for -spr-GiM

[2013-05-21 17:39:59] WARNING: xnotify\server\core.lua:122: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

[2013-05-21 17:39:59] WARNING: xnotify\server\core.lua:123: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]

[2013-05-21 17:39:59] ERROR: xnotify\server\core.lua:124: attempt to get length of local 'row' (a boolean value)

Link to comment
  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

man , is an problem with db (logik.register)

  
 
coreServer = {}
coreServer.__index = coreServer
 
local Maps = {}
Maps.DM = {}
Maps.DD = {}
Maps.Shooter = {}
Maps.Trials = {}
Maps.Race = {}
Maps.Bomb = {}
local serverElement = createElement("Lobby")
 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
    local resourceTable = getResources()
    for index, values in ipairs(resourceTable) do
        local name = getResourceName(values)
        local typ = getResourceInfo(values,"type")
        if typ == "map" and getResourceInfo(values,"gamemodes") == "race" then
            if string.find(string.upper(name),"[DM]") ~= nil then
                table.insert(Maps.DM, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            elseif string.find(string.upper(name),"[DD]") or string.find(string.upper(name),"DD") then
                table.insert(Maps.DD, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            elseif string.find(string.upper(name),"FUN") or string.find(string.upper(name),"[sHOOTER]") then
                table.insert(Maps.Shooter, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            elseif string.find(string.upper(name),"TRIALS") or string.find(string.upper(name),"[TRIALS]") then
                table.insert(Maps.Trials, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            elseif string.find(string.upper(name),"BOMB") or string.find(string.upper(name),"[bOMB]") then
                table.insert(Maps.Bomb, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            elseif string.find(string.upper(name),"[RACE]") or string.find(string.upper(name),"RACE") then
                table.insert(Maps.Race, {
                mapname = name,
                lastPlayed = getResourceLastStartTime(getThisResource()),
                author = getResourceInfo(values,"author"),
                added = getResourceLoadTime(values)
                })
            end
        end
    end
end)
 
function coreServer:getRandomMap(mapPrefix)
    local randomMap
    if (mapPrefix == "DM") then
        if tonumber(#Maps.DM) < 1 then return false end --Attempt to compare number with boolean
        randomMap = Maps.DM[math.random(tonumber(#Maps.DM))]
    end
   
    return randomMap
end
 
function coreServer:setSelectionMode(player)
    bindKey(player"F1","down",function() coreServer:getInSelectionMode(player) end)
end
 
function coreServer:setJoinerStats()
    setElementData(source,"loggedin",false)
    setPlayerNametagShowing(source,false)
    showPlayerHudComponent(source,"all",false)
    setElementData(source,"arena","lobby")
    setMinuteDuration( 60000)
    setTime(23,0)
    spawnPlayer(source,0,0,0)
    setElementFrozen(source,true)
    setElementDimension(source,0)
    setElementInterior(source,0)
    toggleControl(source, "vehicle_secodanry_fire", true)
    toggleControl(source, "vehicle_fire", true)
end
addEventHandler("onPlayerJoin", root, function() coreServer:setJoinerStats() end)
 
addEventHandler("onPlayerJoin", root, function()
    spawnPlayer(source,0,0,0)
    setCameraMatrix(source, 1130.2138671875, -1281.513671875, 70.190544128418, 1128.0830078125, -1427.666015625, 37.42699432373)
    setElementParent(source, serverElement)
end)
 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
    for i, source in ipairs(getElementsByType("player")) do
        setElementParent(source, serverElement)
        setCameraMatrix(source, 1130.2138671875, -1281.513671875, 70.190544128418, 1128.0830078125, -1427.666015625, 37.42699432373)
    end
end)
 
   
 
-----------------------------
--Playerstuff----------------
--------Login-Register-------
 
dbHandler = dbConnect("mysql","dbname=ni157812_1_db;host=localhost","mta","mta")
 
addEvent("registerNewPlayer",true)
addEventHandler("registerNewPlayer", root, function(player, name, pw)
    --outputDebugString("K")
    local query = dbQuery(dbHandler,"SELECT * FROM accounts WHERE name = ?", name)
    local row = dbPoll(query,-1)
    if #row == 0 then
        local exec = dbExec(dbHandler,"INSERT INTO accounts (name) VALUES(?)", name)
        if exec then
            local carlights = {buy = "false", color = "none", policelights = "false"}
            local headlights = {buy = "false", color = "none", pulsating = "false", policelights = "false"}
            local rims = {buy = "false", typ = "none" }
            local skin = {buy = "false", model = "none" }
            local lights = {buy = "false", model = "none"}
            local rainbowlights = {buy = "false", enable = "false"}
            local vehicleskin = {buy = "false", model = "none"}
            local exec2 = dbExec(dbHandler,"UPDATE accounts SET password = ?,\
                                                                serial = '"..getPlayerSerial(player).."',\
                                                                grank = 0,\
                                                                points = 0,\
                                                                money = 0,\
                                                                dmtts = 0,\
                                                                dmwins = 0,\
                                                                ddwins = 0,\
                                                                shooterwins = 0,\
                                                                shooterrockets = 0,\
                                                                shooterkills = 0,\
                                                                bombwins = 0,\
                                                                racewins = 0,\
                                                                racetts = 0,\
                                                                trialwins = 0,\
                                                                trialtts = 0,\
                                                                playtime = 0,\
                                                                donator = 0,\
                                                                team = 0,\
                                                                freetokens = 0,\
                                                                carlights = '"..toJSON(carlights).."',\
                                                                headlights = '"..toJSON(headlights).."',\
                                                                mapsplayed = 0,\
                                                                rims = '"..toJSON(rims).."',\
                                                                skin = '"..toJSON(skin).."',\
                                                                serverjoined = 0,\
                                                                mapsbought = 0,\
                                                                lightskin = '"..toJSON(lights).."',\
                                                                rainbowlights = '"..toJSON(rainbowlights).."',\
                                                                vehicleskin = '"..toJSON(vehicleskin).."' WHERE name = ?", md5(pw), name)
            if exec2 then
                triggerClientEvent(player,"removeLoginPanel",root)
                triggerClientEvent(player,"startSelectionMode",root)
                triggerClientEvent(player,"addNotification",root,"Account successfully created", 1)
                bindKey(player,"F1","down",function()
                    startSelection(player)
                end)
            end
        end
    else
        triggerClientEvent(player,"addNotification",root,"Accountname exists", 2)
    end
    dbFree(query)                                                          
end)
 
addEvent("loginNewPlayer",true)
addEventHandler("loginNewPlayer", getRootElement(), function(player,name,pw)
    local query = dbQuery(dbHandler,"SELECT * FROM accounts WHERE name = ? AND password = '"..md5(pw).."'", name)
    local res, row = dbPoll(query,-1)
    outputDebugString("K")
    if res and row > 0 then
        outputDebugString("KK")
        for id, r in ipairs(res) do
            setElementData(player,"nick",getPlayerName(player))
            setElementData(player,"loggedin",true)
            setElementData(player,"grank",tonumber(r['grank']))
            setElementData(player,"points",tonumber(r['points']))
            setElementData(player,"money",tonumber(r['money']))
            setElementData(player,"dmtts",tonumber(r['dmtts']))
            setElementData(player,"dmwins",tonumber(r['dmwins']))
            setElementData(player,"ddwins",tonumber(r['ddwins']))
            setElementData(player,"shooterwins",tonumber(r['shooterwins']))
            setElementData(player,"shooterrockets",tonumber(r['shooterrockets']))
            setElementData(player,"shooterkills",tonumber(r['shooterkills']))
            setElementData(player,"bombwins",tonumber(r['bombwins']))
            setElementData(player,"racewins",tonumber(r['racewins']))
            setElementData(player,"racetts",tonumber(r['racetts']))
            setElementData(player,"trialwins",tonumber(r['trialwins']))
            setElementData(player,"trialtts",tonumber(r['trialtts']))
            setElementData(player,"playtime",tonumber(r['playtime']))
            setElementData(player,"donator",tonumber(r['donator']))
            setElementData(player,"team",tonumber(r['team']))
            setElementData(player,"freetokens",tonumber(r['freetokens']))
            setElementData(player,"mapsplayed",tonumber(r['mapsplayed']))
            setElementData(player,"serverjoined",tonumber(r['serverjoined']))
            setElementData(player,"mapsbought",tonumber(r['mapsbought']))
            setElementData(player,"registered",tostring(r['registered']))
           
            local carlights = fromJSON(r['carlights'])
            setElementData(player,"carlights.color", carlights.color)
            setElementData(player,"carlights.policelights", carlights.policelights)
            setElementData(player,"carlights.buy", carlights.buy)
           
            local headlights = fromJSON(r['headlights'])
            setElementData(player,"headlights.color", headlights.color)
            setElementData(player,"headlights.pulsating", headlights.pulsating)
            setElementData(player,"headlights.policelights", headlights.policelights)
            setElementData(player,"headlights.buy", headlights.buy)
           
            local rims = fromJSON(r['rims'])
            setElementData(player,"rims.typ",rims.typ)
            setElementData(player,"rims.buy",rims.buy)
           
            local skin = fromJSON(r['skin'])
            setElementData(player,"skin.model",skin.model)
            setElementData(player,"skin.buy",skin.buy)
           
            local lightskin = fromJSON(r['lightskin'])
            setElementData(player,"lightskin.model",lightskin.model)
            setElementData(player,"lightskin.buy",lightskin.buy)
           
            local rainbowlights = fromJSON(r['rainbowlights'])
            setElementData(player,"rainbowlights.enable",rainbowlights.enable)
            setElementData(player,"rainbowlights.buy",rainbowlights.buy)
           
            local vehicleskin = fromJSON(r['vehicleskin'])
            setElementData(player,"vehicleskin.model",vehicleskin.model)
            setElementData(player,"vehicleskin.buy",vehicleskin.buy)
           
            outputChatBox(getElementData(player,"rainbowlights.enable"))
            triggerClientEvent(player,"removeLoginPanel",root)
            triggerClientEvent(player,"startSelectionMode",root)
            triggerClientEvent(player,"addNotification",root,"Wrong password or name", 1)
            triggerClientEvent(player,"addNotification",root,"Wrong password or name", 2)
            triggerClientEvent(player,"addNotification",root,"Wrong password or name", 3)
           
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...