SuleymanM Posted May 21, 2013 Share Posted May 21, 2013 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 : -- Look at login panel ( Jake resource) 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
Jacob Lenn Posted May 21, 2013 Share Posted May 21, 2013 Do you have MySQL base? Becouse i think this script is using MySQL. Link to comment
SuleymanM Posted May 21, 2013 Author Share Posted May 21, 2013 no , this is problem , how to create ? Link to comment
Jacob Lenn Posted May 21, 2013 Share Posted May 21, 2013 Get some MySQL base or if you are using localhost just download xampp and create one. Link to comment
SuleymanM Posted May 21, 2013 Author Share Posted May 21, 2013 how to create in xampp , i have xampp Link to comment
Jacob Lenn Posted May 21, 2013 Share Posted May 21, 2013 Turn on controlpanel and turn on MySQL and Apahce. After go to http://localhost/phpmyadmin , create base and after conenct to the base in this mysql file in your script using this: host: localhost base: base_name user: root pass: Default user in MySQL is root without pass. Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 not need : $db_ I create an Database on phpMyAdmin and i dont know how to continue Man have pls an tutorial ? Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 show me this file xnotify\server\core.lua Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 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
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 dbHandler = dbConnect("mysql","dbname=ni157812_1_db;host=localhost","mta","mta") Here put ur base info. dbHandler = dbConnect("mysql","dbname=base_name;host=localhost", "root", "") Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 where put this line? dbHandler = dbConnect("mysql","dbname=base_name;host=localhost", "root", "") Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 Look where do you have it. It's below this: ----------------------------- --Playerstuff---------------- --------Login-Register------- Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 (edited) ye i add this line Edited May 22, 2013 by Guest Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 (edited) Man! You must change it to ur base's name. Edited May 22, 2013 by Guest Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 You created base with name "arena" i guess and put this into this connecting lane isntead of "base_name". I think it isnt good idea to use MySQL when u r amateur. Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 .... i put 'arena' in ' base_name' and restart resource but still not working Need to create Tabe ... Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 If script doesn't create tables you have to create them by yourself. You must look what tables with what columns you must create. Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 i dont know how to create table I set name : account | columns: 1 and dont know this : Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 Man looking at code from file dat u gave us, there is much more columns than 1. Link to comment
Jacob Lenn Posted May 22, 2013 Share Posted May 22, 2013 Send me this resource i will look how it works. Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 how send to u? Send to me an pm to with can contact u Link to comment
Castillo Posted May 22, 2013 Share Posted May 22, 2013 You must create a table on your MySQL database and then add each column, because if I'm right, the script doesn't add the table on it's own. Link to comment
SuleymanM Posted May 22, 2013 Author Share Posted May 22, 2013 solidsnake , i dont know what columns need to be add Link to comment
Castillo Posted May 22, 2013 Share Posted May 22, 2013 Do you know how to import a table at least? Link to comment
Recommended Posts