Mo?esz pokaza? w skrypcie miejsce, gdzie wykonujesz funkcj? "xmlFileHandler"?
Zmienna "xmlFileName" zosta?a w kodzie wcze?niej odpowiednio zdefiniowana?
-- LOGIN PLAYER
function onClickLogin(button,state)
if(button == "left" and state == "up") then
if (source == btnLogin) then
username = guiGetText(editUsername)
password = guiGetText(editPassword)
triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts)
xmlFileHandler()
end
end
end
function loginPanel()
-- Check if autologin is enabled - If yes, then log the player in, else create and show the userpanel
local xmlFile = xmlLoadFile(xmlFileName)
if xmlFile then
status = xmlNodeGetAttribute(xmlFile,"autologin")
if (status == "true") then
local username = tostring(xmlNodeGetAttribute(xmlFile,"username"))
local password = tostring(xmlNodeGetAttribute(xmlFile,"password"))
if not (username == "") and not (password == "") then
triggerServerEvent("onRequestAutologin",getLocalPlayer(),username,password)
end
else
if blackLoginScreen == true then
setCameraMatrix(-1798.4619140625,890.6220703125,78.623817443848,-1775.4619140625,918.6220703125,24.623817443848,0,70)
end
setCameraMatrix(-1798.4619140625,890.6220703125,78.623817443848,-1775.4619140625,918.6220703125,24.623817443848,0,70)
mainWindow = guiCreateWindow(0.3492,0.3104,0.3383,0.3531,"Panel Logowania by Nero657 (c)",true)
guiSetAlpha(mainWindow,1)
guiWindowSetMovable(mainWindow,false)
guiWindowSetSizable(mainWindow,false)
imglogowanie = guiCreateStaticImage(0.0208,0.0383,0.9215,0.2773,"logowanie.png",true,mainWindow)
lblLogin = guiCreateLabel(0.0462,0.4277,0.164,0.0619,"LOGIN:",true,mainWindow)
guiLabelSetVerticalAlign(lblLogin,"center")
guiSetFont(lblLogin,"default-bold-small")
lblHaslo = guiCreateLabel(0.0462,0.5487,0.1755,0.0855,"HAS?O:",true,mainWindow)
guiLabelSetVerticalAlign(lblHaslo,"center")
guiSetFont(lblHaslo,"default-bold-small")
editPassword = guiCreateEdit(0.2217,0.5575,0.6028,0.0737,"",true,mainWindow)
guiEditSetMasked(editPassword,true)
guiEditSetMaxLength(editPassword,20)
editUsername = guiCreateEdit(0.2217,0.4277,0.6028,0.0737,"",true,mainWindow)
guiEditSetMaxLength(editUsername,20)
btnLogin = guiCreateButton(0.0462,0.7227,0.4365,0.1534,"LOGOWANIE",true,mainWindow)
guiSetFont(btnLogin,"default-bold-small")
btnToggleRegister = guiCreateButton(0.5058,0.7227,0.4365,0.1534,"REJSTRACJA",true,mainWindow)
guiSetFont(btnToggleRegister,"default-bold-small")
infolbl = guiCreateLabel(0.0208,0.9351,0.7945,0.0442,"Copyright by Nero657 2012",true,mainWindow)
-----------------------------------------------------------------------------------------------------------------------------------------------------
registerWindow = guiCreateWindow(0.2859,0.2927,0.4305,0.4969,"Panel Logowania by Nero657 (c)",true)
guiSetAlpha(registerWindow,1)
guiWindowSetSizable(registerWindow,false)
guiWindowSetMovable(registerWindow,false)
registerimg = guiCreateStaticImage(0.029,0.0587,0.9201,0.2851,"rejstracja.png",true,registerWindow)
editRegistrationUsername = guiCreateEdit(0.2396,0.3983,0.5009,0.065,"",true,registerWindow)
guiEditSetMaxLength(editRegistrationUsername,20)
editRegistrationPassword = guiCreateEdit(0.2396,0.4843,0.5009,0.065,"",true,registerWindow)
guiEditSetMasked(editRegistrationPassword,true)
guiEditSetMaxLength(editRegistrationPassword,20)
editRegistrationRepeatPassword = guiCreateEdit(0.2396,0.5702,0.5009,0.065,"",true,registerWindow)
guiEditSetMasked(editRegistrationRepeatPassword,true)
guiEditSetMaxLength(editRegistrationRepeatPassword,20)
lblLogin = guiCreateLabel(0.0181,0.3983,0.2033,0.065,"Tw?j login:",true,registerWindow)
guiLabelSetVerticalAlign(lblLogin,"center")
guiSetFont(lblLogin,"default-bold-small")
lblHaslo = guiCreateLabel(0.0181,0.4843,0.2033,0.065,"Twoje haslo:",true,registerWindow)
guiLabelSetVerticalAlign(lblHaslo,"center")
guiSetFont(lblHaslo,"default-bold-small")
lblPowtorzHaslo = guiCreateLabel(0.0181,0.5702,0.2214,0.065,"Potwierdz twoje haslo:",true,registerWindow)
guiLabelSetVerticalAlign(lblPowtorzHaslo,"center")
guiSetFont(lblPowtorzHaslo,"default-bold-small")
btnConfirmRegistration = guiCreateButton(0.0544,0.717,0.5281,0.109,"REJSTRACJA",true,registerWindow)
guiSetFont(btnConfirmRegistration,"default-bold-small")
btnCancel = guiCreateButton(0.6897,0.8826,0.274,0.086,"Powrot do\nlogowania",true,registerWindow)
reg = guiCreateLabel(0.3811,0.6562,0.4356,0.0398,"Rejestruj?c si? akcetpujesz REGULAMIN",true,registerWindow)
guiSetFont(reg,"default-bold-small")
regBtn = guiCreateButton(0.6007,0.717,0.3394,0.109,"REGULAMIN",true,registerWindow)
maxlabel = guiCreateLabel(0.7586,0.4088,0.216,0.0545,"(max 20 znak?w)",true,registerWindow)
maxlabel3 = guiCreateLabel(0.7586,0.5807,0.216,0.0545,"(max 20 znak?w)",true,registerWindow)
maxlabel2 = guiCreateLabel(0.7586,0.4948,0.216,0.0545,"(max 20 znak?w)",true,registerWindow)
info = guiCreateLabel(0.0327,0.9413,0.3666,0.0524,"Copyright by Nero657 2012",true,registerWindow)
-----------------------------------------------------///////STATY//////----------------------------------------------------------------------------
statystyki = guiCreateWindow(0.3688,0.2406,0.3148,0.4667,"Statystyki by Nero657 (c)",true)
guiSetAlpha(statystyki,1)
statimg = guiCreateStaticImage(0.0372,0.067,0.8859,0.2879,"staty.png",true,statystyki)
stat_label = guiCreateLabel(0.0794,0.3638,0.8238,0.4219,"",true,statystyki)
guiLabelSetColor(stat_label,112,122,122)
guiLabelSetVerticalAlign(stat_label,"center")
guiSetFont(stat_label,"default-bold-small")
buttonok = guiCreateButton(0.5285,0.8504,0.4069,0.1071,"Przejd? dalej",true,statystyki)
guiSetFont(buttonok,"default-bold-small")
infolbl2 = guiCreateLabel(0.0521,0.942,0.4169,0.0513,"Copyright by Nero657",true,statystyki)
-----------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------///////widescr//////----------------------------------------------------------------------------
wideScreenGUI = guiCreateStaticImage(0,0,1,1,"widescreen.png",true,getRootElement())
guiMoveToBack (wideScreenGUI)
-----------------------------------------------------------------------------------------------------------------------------------------------------
guiSetVisible(mainWindow, true)
guiSetVisible(registerWindow, false)
guiSetVisible(statystyki, false)
guiSetInputEnabled(true)
showCursor(true)
addEventHandler("onClientGUIClick",btnLogin,onClickLogin)
addEventHandler("onClientGUIClick",btnToggleRegister,onClickRegisterToggle)
addEventHandler("onClientGUIClick",btnConfirmRegistration,onClickRegisterConfirm)
addEventHandler("onClientGUIClick",btnCancel,onClickCancel)
addEventHandler("onRequestIncreaseAttempts",getRootElement(),increaseAttempts)
addEventHandler( "onClientGUIClick", buttonok, zamknijoknostaty )
attemptedLogins = 0
end
xmlUnloadFile(xmlFile)
else
xmlFileHandler(true)
end
addEventHandler("onRequestDisplayPanel",getRootElement(),logoutHandler)
end
function setXmlFileName(sName)
xmlFileName = tostring("login_"..sName..".xml")
loginPanel()
end
addEvent("onGetServerData",true)
addEventHandler("onGetServerData",getRootElement(),setXmlFileName)
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