Jump to content

lgeri000

Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

2 Neutral

About lgeri000

  • Rank
    Vic
  1. Hello, can anybody tell me why is this ids table stay empty? local maxPlayers = getMaxPlayers() local ids = {} addEventHandler("onPlayerJoin", root, function() local player = source for i = 1, maxPlayers do if (ids[i] == false) then ids[i] = i setElementData(player,"id",i) break end end end ) addEventHandler("onPlayerQuit", root, function() local i = getElementData(source,"id") ids[i] = false setElementData(source,"id",false) end ) this would be an id-system
  2. Thanks for your help finally it works
  3. its still not working, but now the console writes: INFO: "connection" elem:db-connection00000049 this is the part of the script where it tries to log in maybe it helps addEvent("attemptLogin",true) addEventHandler("attemptLogin", resourceRoot, function(un,pass) if not(isPlayerBanned(client)) then local qh = dbQuery(con, "SELECT * FROM accounts WHERE username=?",un) local user dbPoll(qh,500) if (user) then if(#user > 0) then if(user[1]["password"] == pass) then setElementData(client, "acc:id", user[1]["id"]) triggerClientEvent(client,"account
  4. Hey guys, i tried to write an account system for the first time with the help of a youtube video. The problem is that somewhy i cant connect to my mysql. This is my code which connect to the database, and its writing in the chatbox that mysql connection successful. local dbname = "lp"; local host = "127.0.0.1"; local username = "root"; local password = ""; local con; local connectionAttempts = 1; function connectMysql() con = dbConnect( "mysql", "dbname="..dbname..";host="..host..";charset=utf8", username, password, "share=1" ); if (con) then outputChatBox("#FFFFFFMySQL co
×
×
  • Create New...