Jump to content

||مساعدة في اللوحة التسجيلات ||ا×تصحيح×ا


Recommended Posts

السلام عليكم

انا عندي لوحة تسجيل دخول واللوحة تسجيل حساب اوكي؟

xDاسه انا عامل لوحة تسجيل دخول 

xDالحين انا بدي اعمل لوحة تسجيل حساب 

بس المشكلة هنا هي

اانا مو عارف اشيل لوحة التسجيل حساب الموججوده هنا + مو عارف زر كود ربط الزر

ممكن يا اخوان مساعدة

المطلوب بأختصار :-        ا

. أزاله لوحة تسجيل حساب من الملف ×

Panel Register

. اضهار اي  كود مسؤول عن ربط زر تسجيل حساب في لوحة تسجيل الدخول ×

 

. والله يعطيكو العافية×

 

الملف 

طبعاً هو موجود بالكلينت

 

  1. --------------------------
    --------Login Panel-------
    --------------------------
    
    
    -- Login handling
    function loginPlayer(username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts)
    	if isGuestAccount(getPlayerAccount(source)) then
    		if not (username == "") then
    			if not (password == "") then
    				local account = getAccount ( username, password )
    				if ( account ~= false ) then
    					--[[for k,v in ipairs(getAccounts()) do
    						if getAccountData(v, "Serial") == getPlayerSerial(source) then
    							noa = noa+1
    						end
    					end
    					if noa < 2 and not getAccountData(account, "Serial") or getAccountData(account, "Serial") == getPlayerSerial(source) then
    						noa = 0]]
    						logIn (source, account, password)
    						exports["guimessages"]:outputServer(source,"* You have sucessfully logged in!", 255, 255, 255)
    						setTimer(outputChatBox,700,1,"#ff0000Welcome To Server .:[Gta-Ua]:.",source,255,255,255,true)
    						triggerClientEvent (source,"hideLoginWindow",getRootElement())
    						loadacc(source)
    					--[[else
    						noa = 0
    						outputChatBox("You're allowed to own 2 accounts only!يحق لك أن تملك حسابين فقط", source, 255, 0, 0)
    					end]]
    				else
    					if enableKickPlayer == true then
    						if (attemptedLogins >= maxLoginAttempts-1) then
    							exports["guimessages"]:outputServer(source, "*#FFF000Error! Wrong username and/or password!", 255, 255, 255)
    							setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFWarning! Maximum login attempts reached! [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true)
    							setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFYou will be kicked in #008AFF5 seconds#FFFFFF!",source,255,255,255,true)
    							setTimer(kickPlayer,5000,1,source,"Failed to login")
    						else
    							exports["guimessages"]:outputServer(source, "* Error! Wrong username and/or password!", 255, 255, 255)
    							setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFLogin attempts: [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true)
    							triggerClientEvent(source,"onRequestIncreaseAttempts",source)
    						end
    					else
    						exports["guimessages"]:outputServer(source, "* Error! Wrong username and/or password!", 255, 255, 255)
    					end
    				end
    			else
    				exports["guimessages"]:outputServer(source,"* Error! Please enter your password!",255, 255, 255)
    			end
    		else
    			exports["guimessages"]:outputServer(source, "* Error! Please enter your username!", 255, 255, 255)
    		end
    	else
     		logIn (source, account, password)
    		exports["guimessages"]:outputServer(source, "* You have sucessfully logged in!", 0 , 255, 0)
    		setTimer(outputChatBox,700,1,"#0000FF* #ff0000Welcome To Server .:[Gta-Ua]:.",source,255,255,255,true)
    		triggerClientEvent (source,"hideLoginWindow",getRootElement())
    		loadacc(source)
      end
    end
    
    dbb = dbConnect("sqlite", "link/internal.db")
    
    -- Registration here
    function registerPlayer(username,password,passwordConfirm)
    	--[[for k,v in ipairs(getAccounts()) do
    		if getAccountData(v, "Serial") == getPlayerSerial(source) then
    			noa = noa+1
    		end
    	end]]
    	local noa = dbPoll(dbQuery(dbb, "SELECT value FROM userdata WHERE value = ? AND key= ?", getPlayerSerial(source), "Serial"), -1)
    	if #noa < 2 then
    		if not (username == "") then
    			if not (password == "") then
    				if not (passwordConfirm == "") then
    					if password == passwordConfirm then
    						local account = getAccount (username,password)
    						if (account == false) then
    							local accountAdded = addAccount(tostring(username),tostring(password))
    							if (accountAdded) then
    								setAccountData(accountAdded, "Serial", getPlayerSerial(source))
    								triggerClientEvent(source,"hideRegisterWindow",getRootElement())
    								exports["guimessages"]:outputServer(source, "* You have sucessfuly registered! [Username: " .. username .. " #| Password: " .. password .. "]", 255, 255, 255)
    								setTimer(outputChatBox,800,1,"#0000FF* #FFFFFFYou can now login with your new account.",source,255,255,255,true )
    							else
    								exports["guimessages"]:outputServer(source,"* An unknown error has occured! Please choose a different username/password and try again.", 255, 255, 255)
    							end
    						else
    							exports["guimessages"]:outputServer(source, "* Error! An account with this username already exists!", 255, 255, 255)
    						end
    					else
    						exports["guimessages"]:outputServer(source, "* Error! Passwords do not match!", 255, 255, 255)
    					end
    				else
    					exports["guimessages"]:outputServer(source, "* Error! Please confirm your password!", 255, 255, 255)
    				end
    			else
    				exports["guimessages"]:outputServer(source, "* Error! Please enter a password!", 255, 255, 255)
    			end
    		else
    			exports["guimessages"]:outputServer(source, "* Error! Please enter a username you would like to register with!", 255, 255, 255)
    		end
    	else
    		exports["guimessages"]:outputServer(source, "You're allowed to own 2 account only! يحق لك ان تملك حسابان فقط !", 255, 0, 0)
    	end
    	--noa = 0
    end
    
    -- Auto-login handling
    function autologinPlayer(username,password)
    	if not (username == "") then
    		if not (password == "") then
    			local account = getAccount ( username, password )
    			if not (account == false) then
    				logIn (source, account, password)
    				exports["guimessages"]:outputServer(source, "* You have been automatically logged in.", 255, 255, 255)
    				setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFTo disable auto-login, use #ABCDEF/disableauto.",source,255,255,255,true)
    				--triggerClientEvent(source, "hideLoginWindow", getRootElement())
    				loadacc(source)
    			else
    				exports["guimessages"]:outputServer(source, "* Auto-login error - Username & password do not match", 255, 255, 255)
    			end
    		else
    			exports["guimessages"]:outputServer(source, "* Auto-login error - Failed to retrieve password", 255, 255, 255)
    		end
    	else
    		exports["guimessages"]:outputServer(source,"* Auto-login error - Failed to retrieve username", 255, 255, 255)
    	end
    end
    
    login = {}
    
    function loadacc()
    	if not login[source] then
    		login[source] = true
    		plang = getAccountData(getPlayerAccount(source), "ALanguage")
    		if not plang then
    			plang = 0
    		end
    		setElementData(source, "Language", plang)
    		triggerClientEvent("SSS", source, source)
    		triggerClientEvent("TLANG", source, source)
    		triggerClientEvent("onLI", source, source, bag, rul)
    		--triggerClientEvent("COAJT", source)
    		if not rbp then
    			x, y, z = getElementPosition(bag)
    			triggerClientEvent("DropB", source, x, y, z)
    		end
    	end
    end
    
    addEventHandler("onPlayerQuit", root, function() login[source] = nil end) -- You forgot to add this (by TAPL)
    
    --[[ When the player logs out, trigger the client event to check if the login panel will request them to login again
    function logoutHandler()
    	triggerClientEvent(source,"onRequestDisplayPanel",source)
    end
    addEventHandler("onPlayerLogout",getRootElement(),logoutHandler)
    ]]
    
    
    -- Get the server's name
    function getData()
    	local sName = md5(getServerName())
    	local sName = string.sub(sName,0,15)
    	triggerClientEvent(source,"onGetServerData",getRootElement(),sName)
    end
    
    addEvent("onRequestLogin",true)
    addEvent("onRequestRegister",true)
    addEvent("onRequestAutologin",true)
    addEvent("onClientLoginLoaded",true)
    addEventHandler("onRequestLogin",getRootElement(),loginPlayer)
    addEventHandler("onRequestRegister",getRootElement(),registerPlayer)
    addEventHandler("onRequestAutologin",getRootElement(),autologinPlayer)
    addEventHandler("onClientLoginLoaded",getRootElement(),getData)
    
    -------------------------------------------------------------------------------------

     

 

 

Edited by iyaad
Link to comment

X D لوحة تسجيل الدخول

X D لوحة تسجيل الحساب كمان بدي اسويها

بس لازم احذف اللوحة الموجوده بالملف الموجود فوووق

Edited by iyaad
خطأ
Link to comment
1 minute ago, #BrosS said:

كيف وانت معطينا سيرفر

ابحث عن اسم اللوحة واستبدلها بحقتك

والازرار اللي تحته .....

اللوحة معهوله على القيم ايدتور

X D واللوحة الي بدي احطها

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...