Sziasztok! Hogyan tudom az accounts adatbázisból a játékos pénzét lekérni mysql- en keresztül?
addEvent(\"attemptLogin\", true)
addEventHandler(\"attemptLogin\", resourceRoot,
function(un, pass)
if not(isPlayerBanned(client)) then
local money
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, \"accountServerResponse\", resourceRoot, \"loginSucces\")
setPlayerMoney(client, qh.money)
--outputChatBox(qh.[\"money\"]..\" Ennyi pénzed van!\")
dbFree(qh)
else
triggerClientEvent(client, \"accountServerResponse\", resourceRoot, \"roszjelszo\")
end
else
triggerClientEvent(client, \"accountServerResponse\", resourceRoot, \"nincsilyen\")
end
else
triggerClientEvent(client, \"accountServerResponse\", resourceRoot, \"ismeretlenhiba\")
end
else
triggerClientEvent(client, \"accountServerResponse\", resourceRoot, \"bannolva\")
end
end
)