addEventHandler("onClientMouseEnter", main.buttonLogin,
function(btn,state)
if btn == "left" and state == "up" then
local login = guiGetText(main.poleLogin)
local haslo = guiGetText(main.poleHaslo)
if login ~= "" and haslo ~= "" then
triggerServerEvent("sprobujZalogowac", localPlayer, login, haslo)
else
setErrorStrine("Uzupe?nij wszystkie pola!")
end
end
end, false
)
Server:
addEvent("sprobujZalogowac",true)
addEventHandler("sprobujZalogowac", root,
function(login,haslo)
if getAccount(login) then
local acc = getAccount(login,haslo)
if acc then
logIn(source,acc,haslo)
else
triggerClientEvent(source,"onClientWrongLogin",root,"Podane konto posiada inne has?o.")
end
else
triggerClientEvent(source,"onClientWrongLogin",root,"Konto o podanym loginie nie istnieje.")
end
if checksave == true then
triggerClientEvent(source,"ZapiszLoginXML",getRootElement(),login,haslo)
else
triggerClientEvent(source,"ResetZapisuXML",getRootElement(),login,haslo)
end
end
)
addEventHandler("onClientResourceStart", resourceRoot,
function()
showChat(false)
showCursor(true)
end
)
addEventHandler("onClientClick", main.buttonLogin,
function(btn,state)
if btn == "left" and state == "up" then
local login = guiGetText(main.poleLogin)
local haslo = guiGetText(main.poleHaslo)
if login ~= "" and haslo ~= "" then
triggerServerEvent("sprobujZalogowac", localPlayer, login, haslo)
else
setErrorStrine("Uzupe?nij wszystkie pola!")
end
end
end, false
)
Server:
addEvent("sprobujZalogowac",true)
addEventHandler("sprobujZalogowac", root,
function(login,haslo)
if getAccount(login) then
local acc = getAccount(login,haslo)
if acc then
logIn(source,acc,haslo)
else
triggerClientEvent(source,"onClientWrongLogin",root,"Podane konto posiada inne has?o.")
end
else
triggerClientEvent(source,"onClientWrongLogin",root,"Konto o podanym loginie nie istnieje.")
end
if checksave == true then
triggerClientEvent(source,"ZapiszLoginXML",getRootElement(),login,haslo)
else
triggerClientEvent(source,"ResetZapisuXML",getRootElement(),login,haslo)
end
end
)
addEventHandler("onPlayerLogin", root,
function()
setCameraTarget(source,source)
showChat(source,true)
showCursor(source,false)
setPlayerHudComponentVisible(source,"all",true)
outputChatBox("Naci?nij F1 aby przeczyta? poradnik o serwerze.", player)
triggerClientEvent(source,"onClientLoginSuccess",root)
end
)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach