Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- \\ writed by Jack // --
- --Regisztráció
- --Bejelentkezés
- --Karakter létrehozás random név táblából
- --Adatok mentése
- --Ellenőrizni hogy a játékosnak van -e accountja, ha van akkor a login-t tesszük elé
- local con = exports.le_mysql:getConnection( )
- local player = source;
- addEvent("checkAccount", true)
- addEventHandler("checkAccount", root,
- function()
- end
- )
- addEvent("acc:Register")
- addEventHandler("acc:Register", root,
- function()
- local serial = getPlayerSerial(source);
- local qh = dbQuery(con, "SELECT * FROM accounts");
- local res = dbPoll(qh, 0);
- triggerClientEvent(source, "sendDatas:server", source, username, password, passwordconfirm, email)
- setTimer(function()
- if (#res > 0) then
- if ((username ~= nil) and (password ~= nil) and (passwordconfirm ~= nil) and (email ~= nil)) then
- dbExec(con, "INSERT INTO accounts SET username = ?, password = ?, email = ?, serial = ?", username, password, email, serial);
- end
- end
- end, 1000, 1)
- end
- )
- addEvent("acc:Login")
- addEventHandler("acc:Login", root,
- function()
- end
- )
- function player_Spawn()
- triggerClientEvent(source, "cancelMoveCamera", source)
- spawnPlayer(source, 0, 0, 3)
- end
- addEventHandler("onPlayerLogin", getRootElement(), player_Spawn)
Add Comment
Please, Sign In to add comment