Wysłany: 2014-03-08, 23:22
CnB
Wiek: 31 Na forum: 4918 dni Posty: 10
Nick w MP: CnB
B??d: ERROR: login_panel\c.lua:342 stack overflow
Kod:
function xmlFileHandler ( gReturn )
local xmlFile = xmlLoadFile ( xmlFileName )
if not xmlFile then
xmlFile = xmlCreateFile ( xmlFileName , "settings" )
xmlNodeSetAttribute ( xmlFile , "autologin" , "false" )
end
xmlNodeSetAttribute ( xmlFile , "username" , tostring ( guiGetText ( editUsername )))
xmlNodeSetAttribute ( xmlFile , "password" , tostring ( guiGetText ( editPassword )))
xmlSaveFile ( xmlFile )
xmlUnloadFile ( xmlFile )
if ( gReturn ) then
if ( gReturn == true ) then
loginPanel ()
else
return
end
end
end
Prosz? o pomoc linijka 342 to ta z 'local'
Ostatnio zmieniony przez Riot 2014-03-09, 21:27, w całości zmieniany 1 raz
Wysłany: 2014-03-09, 09:42
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
xmlFileName - jak to masz zdefiniowane?
Wysłany: 2014-03-09, 10:21
CnB
Wiek: 31 Na forum: 4918 dni Posty: 10
Nick w MP: CnB
Ale ?e o co chodzi "jak mam zdefiniowane" ?
[ Dodano : 2014-03-09, 13:35 ]
help xD
Wysłany: 2014-03-09, 21:26
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
Co masz pod t? zmienn??
PS. Kod dawaj w [.lua][/lua] (bez kropeczki).
Wysłany: 2014-03-10, 19:15
CnB
Wiek: 31 Na forum: 4918 dni Posty: 10
Nick w MP: CnB
blackLoginScreen = false
enableKickPlayer = true
disallowLogout = false
removeBlackScreenTime = 4
maxLoginAttempts = 5
guiSetInputEnabled ( true )
screenWidth , screenHeight = guiGetScreenSize ()
mainWidth , mainHeight = 439 , 350
regWidth , regHeight = 439 , 440
statWidth , statHeight = 439 , 500
function getServerName ()
triggerServerEvent ( "onClientLoginLoaded" , getLocalPlayer ())
end
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource ()), getServerName )
function setXmlFileName ( sName )
xmlFileName = tostring ( "login_" .. sName .. ".xml" )
loginPanel ()
end
addEvent ( "onGetServerData" , true )
addEventHandler ( "onGetServerData" , getRootElement (), setXmlFileName )
addEvent ( "onRequestIncreaseAttempts" , true )
addEvent ( "onRequestDisplayPanel" , true )
function loginPanel ()
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" , 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" )
registerWindow = guiCreateWindow ( 0.2859 , 0.2927 , 0.4305 , 0.4969 , "Panel Logowania" , 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 )
statystyki = guiCreateWindow ( 0.3688 , 0.2406 , 0.3148 , 0.4667 , "Statystyki" , 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" )
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 enableWideScreen ( player )
if ( getLocalPlayer () == player ) then
guiSetVisible ( wideScreenGUI , true )
guiMoveToBack ( wideScreenGUI )
end
end
function disableWideScreen ( player )
guiSetVisible ( wideScreenGUI , false )
end
addEventHandler ( "onClientGUIClick" , getRootElement (),
function( button , state , absx , absy )
if ( source == wideScreenGUI ) then
guiMoveToBack ( wideScreenGUI )
end
end )
function ustaw ( name , login , playerSkin , czasOnline , dataRejstracji , ostatniaWizyta )
guiSetText ( stat_label , "Nick: " .. name .. "\nLogin: " .. login .. "\nSkin: " .. playerSkin .. "\nCzas Online: " .. czasOnline .. "\nData rejstracji: " .. dataRejstracji .. "\nData ostatniej wizyty:" .. ostatniaWizyta .. "" )
end
addEvent ( "ustaw" , true )
addEventHandler ( "ustaw" , getRootElement (), ustaw )
function pokazstaty ()
guiSetVisible ( statystyki , true )
guiSetEnabled ( buttonok , false )
timer = setTimer ( guiSetEnabled , 10000 , 1 , buttonok , true )
setTimer ( guiSetText , 10000 , 1 , buttonok , "OK" )
setTimer (
function()
if isTimer ( timer ) then
remaining , a , b = getTimerDetails ( timer )
local czas = math . floor ( tonumber ( remaining / 1000 ))
guiSetText ( buttonok , "Poczekaj (" .. czas .. ")sek." )
end
end , 1000 , 11 , timer , buttonok )
triggerServerEvent ( "koncwe" , getRootElement (), getLocalPlayer ())
end
addEvent ( "ShowStaty" , true )
addEventHandler ( "ShowStaty" , getRootElement (), pokazstaty )
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 zamknijoknostaty ()
if source == buttonok then
guiSetVisible ( statystyki , false )
showCursor ( false )
setCameraTarget ( getLocalPlayer () )
disableWideScreen ( player )
end
end
function onClickRegisterConfirm ( button , state )
if( button == "left" and state == "up" ) then
if ( source == btnConfirmRegistration ) then
username = guiGetText ( editRegistrationUsername )
password = guiGetText ( editRegistrationPassword )
passwordConfirm = guiGetText ( editRegistrationRepeatPassword )
triggerServerEvent ( "onRequestRegister" , getLocalPlayer (), username , password , passwordConfirm )
end
end
end
function onClickRegisterToggle ( button , state )
if( button == "left" and state == "up" ) then
if ( source == btnToggleRegister ) then
guiSetVisible ( registerWindow , true )
guiBringToFront ( registerWindow )
guiSetInputEnabled ( true )
showCursor ( true )
end
end
end
function onClickCancel ( button , state )
if( button == "left" and state == "up" ) then
if ( source == btnCancel ) then
guiSetVisible ( mainWindow , true )
guiSetVisible ( registerWindow , false )
guiSetInputEnabled ( true )
showCursor ( true )
end
end
end
function showLoginWindow ()
guiSetVisible ( mainWindow , true )
guiSetVisible ( registerWindow , false )
guiSetInputEnabled ( true )
enableWideScreen ()
showCursor ( true )
end
addEvent ( "showLoginWindow" , true )
addEventHandler ( "showLoginWindow" , getRootElement (), showLoginWindow )
function hideLoginWindow ()
guiSetInputEnabled ( false )
guiSetVisible ( mainWindow , false )
guiSetVisible ( registerWindow , false )
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 )
end
addEvent ( "hideLoginWindow" , true )
addEventHandler ( "hideLoginWindow" , getRootElement (), hideLoginWindow )
function hideRegisterWindow ()
guiSetInputEnabled ( true )
guiSetVisible ( mainWindow , true )
guiSetVisible ( registerWindow , false )
showCursor ( true )
end
addEvent ( "hideRegisterWindow" , true )
addEventHandler ( "hideRegisterWindow" , getRootElement (), hideRegisterWindow )
function logoutHandler ()
if ( disallowLogout == true ) then
loginPanel ()
setTimer ( outputChatBox , 600 , 1 , "#0000FF* #FFFFFFWarning! You have logged out. Please login again." , 255 , 255 , 255 , true )
end
end
function xmlFileHandler ( gReturn )
local xmlFile = xmlLoadFile ( xmlFileName )
if not xmlFile then
xmlFile = xmlCreateFile ( xmlFileName , "settings" )
xmlNodeSetAttribute ( xmlFile , "autologin" , "false" )
end
xmlNodeSetAttribute ( xmlFile , "username" , tostring ( guiGetText ( editUsername )))
xmlNodeSetAttribute ( xmlFile , "password" , tostring ( guiGetText ( editPassword )))
xmlSaveFile ( xmlFile )
xmlUnloadFile ( xmlFile )
if ( gReturn ) then
if ( gReturn == true ) then
loginPanel ()
else
return
end
end
end
function increaseAttempts ()
attemptedLogins = attemptedLogins + 1
end
infoWnd = guiCreateWindow ( 0.3773 , 0.4824 , 0.2727 , 0.2393 , "Informacja" , true )
buttzamknijboxlogin = guiCreateButton ( 0.2865 , 0.7796 , 0.3782 , 0.1388 , "OK" , true , infoWnd )
img = guiCreateStaticImage ( 0.0831 , 0.2857 , 0.3037 , 0.3429 , "info.png" , true , infoWnd )
login = guiCreateMemo ( 0.4212 , 0.1143 , 0.4814 , 0.6204 , "" , true , infoWnd )
guiMemoSetReadOnly ( login , true )
guiSetVisible ( infoWnd , false )
showCursor ( false )
function logininfo ( co )
guiSetVisible ( infoWnd , true )
guiSetText ( login , tostring ( co ))
showCursor ( true )
guiBringToFront ( infoWnd )
end
function zamknijlogin_panel ( player )
if source == buttzamknijboxlogin then
guiSetVisible ( infoWnd , false )
end
end
addEventHandler ( "onClientGUIClick" , buttzamknijboxlogin , zamknijlogin_panel )
addEvent ( "msgBoxLogin" , true )
addEventHandler ( "msgBoxLogin" , getRootElement (), logininfo )
local gR = getRootElement ()
local gRR = getResourceRootElement ( getThisResource () )
local gMe = getLocalPlayer ()
local plane = createObject ( 1681 , 3660 ,- 850 , 350 , 0 , 0 , 0 )
setElementDimension ( plane , 1 )
function showintro ()
showPlayerHudComponent ( "radar" , false )
fadeCamera ( false , 0.5 , 0 , 0 , 0 )
setElementDimension ( gMe , 1 )
setTimer (
function ()
fadeCamera ( true , 1.2 , 0 , 0 , 0 )
moveObject ( plane , 9000 ,- 1701 ,- 255 , 14.2 )
setTimer (
function ()
fadeCamera ( false , 1.0 , 0 , 0 , 0 )
end
, 7500 , 1 )
addEventHandler ( 'onClientPreRender' , gR , updateCam1 )
setTimer (
function ()
fadeCamera ( true , 0.5 , 0 , 0 , 0 )
addEventHandler ( 'onClientPreRender' , gR , updateCam2 )
setTimer (
function ()
setTimer (
function ()
addEventHandler ( 'onClientPreRender' , gR , updateCam3 )
setTimer (
function()
removeEventHandler ( 'onClientPreRender' , gR , updateCam1 )
removeEventHandler ( 'onClientPreRender' , gR , updateCam2 )
removeEventHandler ( 'onClientPreRender' , gR , updateCam3 )
setElementDimension ( gMe , 0 )
setCameraTarget ( gMe , gMe )
showPlayerHudComponent ( "radar" , true )
fadeCamera ( true , 1.5 , 0 , 0 , 0 )
setCameraTarget ( gMe , gMe )
end
, 10500 , 1 )
end
, 8500 , 1 )
end
, 9000 , 1 )
end
, 8000 , 1 )
end
, 1000 , 1 )
end
addCommandHandler ( "intro" ,
function ()
showintro ()
end
)
function updateCam1 ()
local cx , cy , cz = getElementPosition ( thing )
local tx , ty , tz = getElementPosition ( plane )
setCameraMatrix ( cx , cy , cz , tx , ty , tz )
end
function updateCam2 ()
local cx , cy , cz = getElementPosition ( thing2 )
local tx , ty , tz = getElementPosition ( thing )
setCameraMatrix ( cx , cy , cz , tx , ty , tz )
end
function updateCam3 ()
local cx , cy , cz = getElementPosition ( thing2 )
local tx , ty , tz = getElementPosition ( thing )
setCameraMatrix ( cx , cy , cz , tx , ty , tz )
end
Ca?y skrypt , przejrzyj , zedytuj , wstaw dobry - poprosz?
Wysłany: 2014-03-10, 22:35
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
CnB , chyba Ci? pomyli?o .
Prosz? o zamkni?cie tematu.
Wr?? jak b?dziesz wiedzia? co zepsu?e? w kodzie (kt?rego autorem nie jeste? zapewne).
Wysłany: 2014-03-11, 18:24
CnB
Wiek: 31 Na forum: 4918 dni Posty: 10
Nick w MP: CnB
Jak ja tego nie dotyka?em nawet , z dnia na dzie? po przeniesieniu servera z servhosta na maxrate przesta?o dzia?a? -.-
Tagi: stack :: overflow :: o.o
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: