function playerRegister(player, username, password, password2)local md5password = md5(password)if(password~=password2)thentriggerClientEvent(\"info\",player,\"A felhasználónév túl rövid!\", \"red\")returnendif(string.len(username)<5)thentriggerClientEvent(\"info\",player,\"A felhasználónév túl rövid!\", \"red\")returnendif(string.len(password)<5)then triggerClientEvent(\"info\", player, \"A jelszó túl rövid!\", \"red\")returnendserial = getPlayerSerial(player)dbQuery(function(qh, player, username, md5password) local a, b, c = dbPoll(qh, 0) if b > 0 then outputChatBox(\"Neked már van accountod\") regisztalhat = false return end end, {player,username,md5password}, mysql:getConnection(), (\"SELECT * FROM characters WHERE charactername=\'\" .. safecharname .. \"\' AND account=\'\" .. mysql:escape_string(id) .. \"\' AND cked = 0\")dbQuery(function(qh, player, username, md5password) local result, rows, errorMsg = dbPoll(qh, 0) if not regisztalhat then return end if rows > 0 then exports.sg_box:addNotification(\"Ez a felhasználónév már foglalt!\",\"red\") else local _, id = mysql:query_free(\"INSERT INTO accounts SET serial = \'\".. serial ..\"\', username = \'\"..tostring(username)..\"\', password = \'\"..tostring(md5password)..\"\'\", true) exports.sg_box:addNotification(\"Sikeresen regisztráltál!\",\"green\") endend, {player,username,md5password}, mysql:getConnection(), \"SELECT * FROM accounts WHERE username = ? LIMIT 1\", username)endaddEvent(\"playerRegister\", true)addEventHandler(\"playerRegister\", getRootElement(), playerRegister)
triggerServerEvent(\"asd\", source)
addEvent(\"asd\", true)addEventHandler(\"asd\", root, funkcio)
addEvent(\"playerLogin\", true)addEventHandler(\"playerLogin\", getRootElement(), playerLogin)
triggerServerEvent(\"playerLogin\", getLocalPlayer(), getLocalPlayer(), guiGetText(user), guiGetText(pw))
dbExec(sql, \"INSERT INTO test SET a=1, b=2\")dbQuery(function(qh)local res,rows,err=dbPoll(qh,0)if rows > 0 thenlocal id = res[1][\"id\"]outputChatBox(id)endend, sql, \"SELECT id FROM test WHERE id = LAST_INSERT_ID()\")
dbExec(sql, \"INSERT INTO test SET a=?,b=?\", 1, 2)