GUIEditor = {
label = {},
button = {},
edit = {},
window = {},
}
GUIEditor.window[1] = guiCreateWindow(351, 179, 661, 423, "Login Panel By AlooyFTW", false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.edit[1] = guiCreateEdit(260, 65, 294, 51, "", false, GUIEditor.window[1])
GUIEditor.edit[2] = guiCreateEdit(260, 154, 294, 51, "", false, GUIEditor.window[1])
GUIEditor.button[1] = guiCreateButton(10, 291, 280, 76, "Login", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "sa-gothic")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "C8FFFFFF")
GUIEditor.label[1] = guiCreateLabel(16, 65, 189, 53, "UserName", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "sa-header")
guiLabelSetColor(GUIEditor.label[1], 16, 0, 193)
GUIEditor.label[2] = guiCreateLabel(19, 154, 176, 51, "Password", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[2], "sa-header")
guiLabelSetColor(GUIEditor.label[2], 16, 0, 193)
GUIEditor.button[5] = guiCreateButton(342, 292, 280, 76, "Register", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[5], "sa-gothic")
guiSetProperty(GUIEditor.button[5], "NormalTextColour", "C8FFFFFF")
fadeCamera(false)
showCursor ( true )
setTimer(function()
guiLabelSetColor( GUIEditor.label[1],math.random(0, 255), math.random(0, 255), math.random(0, 255))
end,100,0,true)
setTimer(function()
guiLabelSetColor( GUIEditor.label[2],math.random(0, 255), math.random(0, 255), math.random(0, 255))
end,100,0,true)
guiSetVisible (GUIEditor.window[1], true)
addEventHandler ("onClientGUIClick", getRootElement(),
function(button, state, absoluteX, absoluteY)
if ( source == GUIEditor.button[1] ) then
local user = guiGetText(GUIEditor.edit[1])
local pass = guiGetText(GUIEditor.edit[2])
triggerServerEvent("login",getLocalPlayer(), user, pass)
end
end
)
addEventHandler ("onClientGUIClick", getRootElement(),
function(button, state, absoluteX, absoluteY)
if ( source == GUIEditor.button[5] ) then
local user = guiGetText(GUIEditor.edit[1])
local pass = guiGetText(GUIEditor.edit[2])
triggerServerEvent("register",getLocalPlayer(), user, pass)
end
end)
addEvent(hideLoginWindow, true)
addEventHandler("hideLoginWindow", root,
function()
fadeCamera(true)
guiSetVisible (GUIEditor.window[1], false)
showCursor ( false )
end)
سيرفر
addEvent("login", true)
addEventHandler("login",getRootElement(),
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 With User : #00FF00[ " .. user .. " ]!", player, 255, 255, 0 , true )
triggerClientEvent(player, "hideLoginWindow", getRootElement())
setElementModel ( player, 287 )
else
outputChatBox ( "Login Error!", player, 255, 255, 0 )
end
else
outputChatBox ( "Wrong Username or Password!", player, 255, 255, 0 )
end
end
)
addEvent("register", true)
addEventHandler("register",getRootElement(),
function ( player, user, pass )
local account = getAccount ( user, pass )
if ( account ~= false ) then
if (logIn ( player, account, pass ) == true) then
outputChatBox ( "You Registerd and Logged in Sucessfuly!", player, 255, 255, 0 )
setElementModel ( player, 287 )
else
outputChatBox ( "You Are Already Logged in !", player, 255, 255, 0 )
end
else
account = addAccount ( user, pass )
if (logIn ( player, account, pass ) == true) then
outputChatBox ( "You Registerd and Logged in Sucessfuly - Please Remember Your User/Password!", player, 255, 255, 0 )
outputChatBox ( "Register Details : [ Username ] : #00FF00" .. user .. " #FFFF1A[ Password ] : #00FF00" .. pass .. "", player, 255, 255, 0 , true )
triggerClientEvent(player, "hideLoginWindow", getRootElement())
setElementModel ( player, 287 )
else
outputChatBox ( "Register/Login error!", player, 255, 255, 0 )
end
end
end
)