function loginPlayer(username,password,client)dbQuery( function(qh, username, password) local result,rows,errmsg = dbPoll( qh, 0 ) local row = result[1] if row then setElementData(client, \"isPlayedLoggedIn\", true) setElementData(client, \"getPlayerUsername\", username) if row[\"haveCharacter\"] == 0 then spawnCharacter(client) else triggerClientEvent(client, \"successLogin\", client,\"haveChar\") end else outputChatBox(\"Hibás felhasználónév, vagy jelszó!\") endend,{username,password}, sql, \"SELECT * FROM account WHERE username=? and password=?\",username,password)endaddEvent(\"loginPlayer\", true)addEventHandler(\"loginPlayer\", getRootElement(), loginPlayer)
function spawnCharacter(thePlayer)spawnPlayer (thePlayer, 0, 0, 5)fadeCamera (thePlayer, true)setCameraTarget (thePlayer, thePlayer)end
function loginPlayer(username,password,client)dbQuery( function(qh, player, username, password) local result,rows,errmsg = dbPoll( qh, 0 ) local row = result[1] if row then setElementData(player, \"isPlayedLoggedIn\", true) setElementData(player, \"getPlayerUsername\", username) if row[\"haveCharacter\"] == 0 then spawnCharacter(player) else triggerClientEvent(player, \"successLogin\", player, \"haveChar\") end else outputChatBox(\"Hibás felhasználónév, vagy jelszó!\") endend,{source,username,password}, sql, \"SELECT * FROM account WHERE username=? and password=?\",username,password)endaddEvent(\"loginPlayer\", true)addEventHandler(\"loginPlayer\", getRootElement(), loginPlayer)
function loginPlayer(username,password)dbQuery( function(qh, player, username, password) local result,rows,errmsg = dbPoll( qh, 0 ) local row = result[1] if row then setElementData(player, \"isPlayedLoggedIn\", true) setElementData(player, \"getPlayerUsername\", username) if row[\"haveCharacter\"] == 0 then spawnCharacter(player) else triggerClientEvent(player, \"successLogin\", player) end else outputChatBox(\"Hibás felhasználónév, vagy jelszó!\") endend,{source,username,password}, sql, \"SELECT * FROM account WHERE username=? and password=?\",username,password)endaddEvent(\"loginPlayer\", true)addEventHandler(\"loginPlayer\", getRootElement(), loginPlayer)function spawnCharacter(target)spawnPlayer (target, 0, 0, 5)fadeCamera (target, true)setCameraTarget (target, target)end
function loginPlayer(username,password)dbQuery( function(qh, player, username, password) local result,rows,errmsg = dbPoll( qh, 0 ) local row = result[1] if row then setElementData(player, \"isPlayedLoggedIn\", true) setElementData(player, \"getPlayerUsername\", username) if row[\"haveCharacter\"] == 0 then isCharHave = \"noChar\" else isCharHave = \"haveChar\" end triggerClientEvent(player, \"successLogin\", player,isCharHave) else outputChatBox(\"Hibás felhasználónév, vagy jelszó!\") endend,{source,username,password}, sql, \"SELECT * FROM account WHERE username=? and password=?\",username,password)endaddEvent(\"loginPlayer\", true)addEventHandler(\"loginPlayer\", getRootElement(), loginPlayer)function spawnCharacter(isCharHave)source = clientif isCharHave == \"haveChar\" then spawnPlayer(source, 0, 0, 5) fadeCamera(source, true) setCameraTarget(source, source)end endaddEvent(\"spawnCharacter\", true)addEventHandler(\"spawnCharacter\", getRootElement(), spawnCharacter)
triggerServerEvent(\"spawnCharacter\", root,character)