Jump to content

[ سوال - لوحه تسجيل ]x


Adham

Recommended Posts

السلأم عليكم ورحمه الله وبركاتة ..

اليوم سويت مود تسجيل دخول

المود لما بسجل في حسابي بكتب في الايديت الاول والتاني الباس يسجل تمام ..

ولما اكتب لوحه اخري ايدديت اسم الحساب .. وايديت الباسورد .. وايديت تاأكيد الباسورد

ويسجل تمأم المشكله :

لما بسجل الحساب register

بيسجل لاكن لما اسجل الحساب واجي اكتبو في لوحه ال Login

م يدخل يقولي الحساب غلط

Link to comment

Login :

addEventHandler ( "onClientGUIClick", root,
function ()
            if source == GUIEditor.button[1] then -- Login
                     local AccountName = guiGetText ( GUIEditor.edit[1] ) -- edit
                     local AccountPass = guiGetText ( GUIEditor.edit[2] )
                     if AccountName == "" or AccountPass == "" then return end
                     triggerServerEvent ( "onPlayer:Login", localPlayer, AccountName, AccountPass )
          end
     end
)

addEventHandler ( "onClientGUIClick", root,
function (  )
            if source == Ok then
			    local NewAccount = guiGetText(username)
                local NewPass = guiGetText(password)
                local RepeatPass = guiGetText(RepeatPass)
				if NewAccount == "" or NewPass == "" or RepeatPass == "" then return end
			        if ( NewPass ~= RepeatPass) then outputChatBox( 'يرجأ كتابه باسورد متاطبق', 255, 0, 0, true ) return end
				triggerServerEvent( 'addAccount', localPlayer, NewAccount, NewPass )
			end
		end
	end
);

-- server register

addEvent ( 'checkForRegisterNewAccount', true )
addEventHandler( 'checkForRegisterNewAccount', root,
function( NewAccount, NewPass)
     if (getAccount( NewAccountName ) ~= false) then outputChatBox( 'الحساب موجود .؟!', source, 255, 0, 0, true )
else 
        addAccount( NewAccount, NewPass)
        outputChatBox( '*You register now.', source, 0, 255, 0, true )
    end
end
)

 

Edited by Deativated
Link to comment
addEvent ( 'onPlayer:Login', true )
addEventHandler ( 'onPlayer:Login', root,
function ( AccountName, AccountPass )
          local oldAccount = getPlayerAccount( source )
          if (not oldAccount == isGuestAccount(oldAccount)) then outputChatBox( 'تم تسجيل من قبل', source, 255, 0, 0, true ) return end
          local playerAccount = getAccount(AccountName, AccountPass)
          if (playerAccount ~= nil or playerAccount ~= false) then
          if (logIn(source, playerAccount, AccountPass)) then 
          outputChatBox( 'تم التسجيل', source, 0, 255, 0, true )
          triggerClientEvent ( source, "onPlayer:LoginWnd", source )
          else outputChatBox( 'حدث خطا!', source, 255, 0, 0, true ) return end
   end
end
)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...