Sziasztok! A napokban elkezdtem irni egy mdot 0-ról de elakadtam . Valaki segítene? Gond az ,hogy nem jön elő a gui!
Szerver :
addEventHandler(\"onPlayerJoin\" , getRootElement(),
function
outputChatBox(\"Welcome To The Restory RP!\", source)
end
)
A gond az ,hogy a gui nem jön elő .
A baj az lenne ,hogy a gui nem jön elő csak a köszöntő üzenet és utána nem csinál semmit!
addEventHandler(\"onPlayerQuit\"(),
function (quitType)
local account = getPlayerAccount(source)
if account and not isGuestAccount(account) then
setAccountData(account,\"money\",getPlayerMoney(source))
logOut(source)
end
end
)
addEvent(\"checkAccount\",true)
addEventHandler(\"checkAccount\", root,
function ()
local account = getAccount(getPlayerName(client))
if account then
triggerClientEvent(client, showLogin, client)
else
triggerClientEvent(client, showRegister, client)
end
end
)
addEvent(\"submitRegister\", true)
addEventHandler(\"submitRegister\", root,
function (password)
local accountAdded = getAccount(getPlayerName(client),password)
if account == false then
local accountAdded = addAccount(getPlayerName(client),password)
if accountAdded then
outputChatBox(\"Thanks For Register!\",client)
triggerClientEvent(client, \"showLogin\",client)
else
outputChatBox(\"Hiba! Keresd fel a tulajt TS-en vagy FACEBOOK-on. Kód: 03\",client)
end
else
outputChatBox(\"You have already registered!\",client)
end
end
)
addEvent(\"submitLogin\",true)
addEventHandler(\"submitLogin\",root,
function(password)
local account = getAccount(getPlayerName(client),password)
if account then
if logIn(client , account , password) == false then
outputChatBox(\"You have already logged in!\",client)
end
else
outputChatBox(client,\"Wrong password\")
end
end
)
Kliens:
addEventHandler(\"onClienResourceStart\", getResourceRootElement(),
function ()
triggerServerEvent(\"checkAccount\", getResourceRootElement())
end
)
addEvent(\"showRegister\", true)
addEventHandler(\"showRegister\", getRootElement(),
function
createRegisterWindow()
if(wdwRegister ~= nil) then
guiSetVisible(wdwRegister, true)
else
outputChatBox(\"Hiba! Keresd fel a tulajt Facebook-on vagy TS-en!\")
end
showcursor(true)
guiSetInputEnabled(true)
end
)
function clientSubmitRegister(button,state)
if button == \"left\" and state == \"up\" then
local password == guiGetText(edtPass)
if password then
triggerServerEvent(\"sumbitRegister\", getRootElement(), password)
guiSetInputEnabled(false)
guiSetVisible(wdwRegister , false)
showcursor(false)
else
outputChatBox(\"Type the password!\")
end
end
end
addEvent(\"showLogin\",true)
addEventhandler(\"showLogin\", getRootElement(),
function()
createLoginWindow()
if (wdwLogin ~= nil) then
guiSetVisible(wdwLogin, true)
else
outputChatBox(\"Hiba! Keresd fel a tulajt Facebook-on vagy TS-en!\")
end
showCursor(true)
guiSetInputEnabled(true)
end
)
function clientSubmitLogin(button,state)
if button == \"left\" and state == \"up\" then
local password == guiGetText(edtPass)
if password then
triggerServerEvent(\"sumbitLogin\", getRootElement() , password)
guiSetInputEnabled(false)
guiSetVisible(wdwLogin , false)
showcursor(false)
else
outputChatBox(\"Type the password!\")
end
end
end
function createRegisterWindow()
local X = 0.375
local Y = 0.375
local Width = 0.20
local Heigth = 0.15
wdwRegister = guiCreateWindow(X, Y, Width, Heigth \"Registration\", true)
X = 0.0825
Y = 0.2
Width = 0.25
Heigth = 0.25
guiCreateLabel(X, Y, Width, Heigth \"Password\" , true , wdwRegister)
X = 0.415
Y = 0.2
Width = 0.5
Heigth = 0.15
edtPass = guiCreateEdit(X, Y, Width, Heigth \"\", true, wdwRegister)
guiEditSetMaxLenght(edtPass, 50)
X = 0.415
Y = 0.7
Width = 0.25
Heigth = 0.20
btnRegister = guicreateButton(X, Y, Width, Heigth \"Register\", true , wdwRegister)
guiSetVisible(wdwRegister , false)
addEventHandler(\"onClientGuiClick\", btnRegister, clientSubmitRegister, false)
end
function createLoginWindow()
local X = 0.375
local Y = 0.375
local Width = 0.20
local Heigth = 0.15
wdwLogin = guiCreateWindow(X, Y, Width, Heigth \"Login\", true)
X = 0.0825
Y = 0.2
Width = 0.25
Heigth = 0.25
guiCreateLabel(X, Y, Width, Heigth \"Password\", true, wdwLogin)
X = 0.415
Y = 0.2
Width = 0.5
Heigth = 0.15
edtPass = guiCreateEdit(X, Y, Width, Heigth \"\", true, wdwLogin)
guiEditSetMaxLenght(edtPass, 50)
X = 0.415
Y = 0.7
Width = 0.25
Heigth = 0.20
btnLogin = guicreateButton(X, Y, Width, Heigth \"Login\", true, wdwLogin)
guiSetVisible(wdwLogin , false)
addEventHandler(\"onClientGuiClick\", btnLogin, clientSubmitLogin, false)
end