Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEvent("RegisterPlayer",true)
- addEventHandler("RegisterPlayer",root,
- function(user,pass,email)
- addAccount(user,pass)
- local userAccount = getAccount(user,pass)
- if ( userAccount ~= false ) then
- local tryToLog = logIn(client,userAccount,pass)
- if (tryToLog) then
- triggerClientEvent(source,"onRegisterComplete",source)
- --fadeCamera(client,true)
- --outputChatBox("* "..user.." вошёл на сервер",root,102,204,0,false)
- --setPlayerName(client,user)
- local usersAccountsTable = executeSQLSelect ( "usersAccounts", "*","accountName = '" .. getAccountName( getPlayerAccount( source ) ) .. "'")
- if #usersAccountsTable == 0 then
- outputDebugString("usersAccounts Insert")
- executeSQLInsert ( "usersAccounts", "'"..getAccountName( getPlayerAccount( source ) ).."','"..email .."'")
- end
- end
- else
- triggerClientEvent(source,"checkRegisterError",source)
- outputDebugString("Error this account is registered")
- end
- end
- )
Add Comment
Please, Sign In to add comment