function onLogin ( player, user, pass )local login = mysql_query(handler,\"SELECT * FROM accounts WHERE pName = \'\"..mysql_escape_string( handler, user )..\"\' AND pPassword = \'\"..mysql_escape_string( handler, sha256(pass) )..\"\';\")if login thenlocal rows = mysql_num_rows(login)if rows == 1 then outputChatBox(\"* You successfully logged in your account!\", player, 255, 255, 255)else outputChatBox(\"* Login failed!\", player, 255, 255, 255)endmysql_free_result(login)endendaddEvent( \"onLogin\", true )addEventHandler( \"onLogin\", getRootElement(), onLogin )
triggerServerEvent ( \"onLogin\", getRootElement(), getLocalPlayer())
bad argument 1# to \'mysql_escape_string\' (mysql handler expected, got userdata)
valamiuser = \"jozsi\"valamipass = \"szupertitkosjelszo\"triggerServerEvent(\"onLogin\", getRootElement(), getLocalPlayer(), valamiuser, valamipass)
Szia!2 argumentumot nem triggerelsz át (user, pass)A getLocalPlayert triggereled csak át, a többit nem.Így lenne helyes: valamiuser = \"jozsi\"valamipass = \"szupertitkosjelszo\"triggerServerEvent(\"onLogin\", getRootElement(), getLocalPlayer(), valamiuser, valamipass) Persze a valamiuser és a valamipass helyére nem ez kerül, hanem értelemszerűen...Robika1
function LoginPlayer(playerSource,commandName,password) local user = getPlayerName(playerSource) local login = mysql_query(handler,\"SELECT * FROM accounts WHERE pName = \'\"..mysql_escape_string( handler, user )..\"\' AND pPassword = \'\"..mysql_escape_string( handler, sha256(password) )..\"\';\") if login then local rows = mysql_num_rows(login) if rows == 1 then outputChatBox(\"* You successfully logged in your account!\", playerSource, 255, 255, 255) else outputChatBox(\"* Login failed!\", playerSource, 255, 255, 255) end mysql_free_result(login) endendaddCommandHandler(\"bejelentkez\",LoginPlayer)