addEvent("zaloguj:konto", true) addEventHandler("zaloguj:konto", root, function(login, haslo) local result = exports["vr-db"]:db_query("SELECT * FROM vr_konta WHERE login=?", login) if result and #result > 1 then outputChatBox("Konto o takim loginie nie istnieje!", client) return end if result and #result < 1 then outputChatBox("Podane dane s? nie prawid?owe!", client) return end if result[1].serial ~= getPlayerSerial(client) then outputChatBox("Owe konto nie nale?y do ciebie!", client) return end for _,p in ipairs(getElementsByType("player")) do if getElementData(p, "gid") == result[1].gid then outputChatBox("Kto? ju? jest na tym koncie!", client) return end end outputChatBox("Pomy?lnie zalogowano na serwer!", client) triggerClientEvent(client, "zalogowano:usun", root) end)
local haslo = --ustaw kodowanie has?a md5 czy inne local result = exports["vr-db"]:db_query("SELECT * FROM vr_konta WHERE login=? AND haslo=?", login, haslo)