EH10 Posted January 13, 2014 Share Posted January 13, 2014 ابي تعدلون على هاذا اذا ممكن تخلونة يقدر يسجل واذا مكرر التسجيل يقول هاذا الحساب موجود واذا سوا حساب لقد عملت حساب جديد واذا سجل دخول لقد سجلت دخول واذا مافي مثل كذا حساب يقول هاذا الحساب ليس موجود واذا سجل يقول حياك لقد سجلت كلينت wind = guiCreateWindow(0, 0, 0, 0, "", false) reg = guiCreateEdit(0, 0, 0, 0, "", false, winds) pass2 = guiCreateEdit(0, 0, 0, 0, "", false, winds) register = guiCreateButton(0, 0, 0, 0, "register", false, winds) name = guiCreateEdit(0, 0, 0, 0, "", false, winds) pass = guiCreateEdit(0, 0, 0, 0, "", false, winds) login = guiCreateButton(0, 0, 0, 0, "lgoin", false, winds) addEventHandler("onClientGUIClick",getRootElement(), function () local user = guiGetText(name) local pass = guiGetText(pass) if ( source == login ) then triggerServerEvent("onlogin",getLocalPlayer(),user,pass) elseif ( source == register ) then triggerServerEvent("onre",getLocalPlayer(),user,pass) end end ) سيرفر addEvent("onlogin",true) addEventHandler("onlogin",getRootElement(), function (user,pass) local account = getAccount(user,pass) if ( account ) then logIn(source,account,pass) triggerClientEvent(source,"setcol",source) else outputChatBox("* Worng Username Or Password",source,255,0,0) end end ) addEvent("onre",true) addEventHandler("onre",getRootElement(), function (user,pass) local account = getAccount(user,pass) if ( account ) then outputChatBox("* This Account is Already Used",source,255,0,0) else addAccount(user,pass) outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) end end ) Link to comment
al-Kobra Posted January 13, 2014 Share Posted January 13, 2014 (edited) addEvent("onlogin", true) addEventHandler("onlogin",root, function (player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= true ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Logged in Sucessfuly!", player, 250, 150, 0 , true ) triggerClientEvent (source, "setcol", source) else outputChatBox ( "* Login Error!", player, 255, 0, 0 ) end else outputChatBox ( "* Worng Username Or Password", player, 255, 0, 0 ) end end ) addEvent("onre", true) addEventHandler("onre",root, function ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= true ) then outputChatBox("* This Account is Already Used",player,255,0,0) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Registerd and Logged in Sucessfuly", player, 250, 150, 0 ) outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) else outputChatBox ( "You Are Already Logged in !", player, 250, 150, 0 ) end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then outputChatBox ( "You Registerd and Logged in Sucessfuly!", player, 250, 150, 0 ) else outputChatBox ( "Register Error !", player, 255, 0, 0 ) end end end ) جربه Edited January 13, 2014 by Guest Link to comment
EH10 Posted January 13, 2014 Author Share Posted January 13, 2014 addEvent("onlogin", true) addEventHandler("onlogin",root, function (player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= true ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Logged in Sucessfuly!", player, 250, 150, 0 , true ) triggerClientEvent (source, "setcol", source) else outputChatBox ( "* Login Error!", player, 255, 0, 0 ) end else outputChatBox ( "* Worng Username Or Password", player, 255, 0, 0 ) end end ) addEvent("onre", true) addEventHandler("onre",root, function ( player, user, pass ) local account = getAccount ( user, pass ) if ( account == true ) then outputChatBox("* This Account is Already Used",player,255,0,0) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Registerd and Logged in Sucessfuly", player, 250, 150, 0 ) outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) else outputChatBox ( "You Are Already Logged in !", player, 250, 150, 0 ) end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then outputChatBox ( "You Registerd and Logged in Sucessfuly!", player, 250, 150, 0 ) else outputChatBox ( "Register Error !", player, 255, 0, 0 ) end end end ) جربه ماضبط Link to comment
al-Kobra Posted January 13, 2014 Share Posted January 13, 2014 addEvent("onlogin", true) addEventHandler("onlogin",root, function (player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= true ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Logged in Sucessfuly!", player, 250, 150, 0 , true ) triggerClientEvent (source, "setcol", source) else outputChatBox ( "* Login Error!", player, 255, 0, 0 ) end else outputChatBox ( "* Worng Username Or Password", player, 255, 0, 0 ) end end ) addEvent("onre", true) addEventHandler("onre",root, function ( player, user, pass ) local account = getAccount ( user, pass ) if ( account == true ) then outputChatBox("* This Account is Already Used",player,255,0,0) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then outputChatBox ( "* You Registerd and Logged in Sucessfuly", player, 250, 150, 0 ) outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) else outputChatBox ( "You Are Already Logged in !", player, 250, 150, 0 ) end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then outputChatBox ( "You Registerd and Logged in Sucessfuly!", player, 250, 150, 0 ) else outputChatBox ( "Register Error !", player, 255, 0, 0 ) end end end ) جربه ماضبط جربه الحين عدل فيه شي Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now