لا يسجل ولا يسجل دخول
كلنت
addEventHandler ("onClientGUIClick",root,
function ()
if source == log then
local user = guiGetText (user)
local pass = guiGetText (pass)
if user == "" and pass == "" then
triggerServerEvent ("login",localPlayer,user,pass)
end
elseif source == reg then
local user = guiGetText (user)
local pass = guiGetText (pass)
if user == "" and pass == "" then
triggerServerEvent ("register",localPlayer,user,pass)
end
end
end)
سيرفر
addEvent ("login",true)
addEventHandler ("login",root,
function (user,pass)
local acc = getAccount (user,pass)
if acc then
logIn (source,acc,pass)
outputChatBox ("LOGIN-DONE",source,5,255,5)
end
end)
addEvent ("register",true)
addEventHandler ("register",root,
function (user,pass)
if not getAccount (user,pass) then
addAccount (user,pass)
outputChatBox ("REGISTER-DONE",source,5,255,5)
else
outputChatBox ("REGISTER-THIS ACCOUNT IS ALREADY EXISTS",source,255,5,5)
end
end)