Wysłany: 2013-03-02, 19:35
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Witam, m?j problem polega na tym, ?e jak u?yje triggera, nie pokazuje panelu.
Kod trigger:
addEventHandler ( "onPlayerJoin" , getRootElement (),
function()
textDisplay = textCreateDisplay ()
textDisplayAddObserver ( textDisplay , source )
textServerName = textCreateTextItem ( "Best RPG" , 0.4 , 0.05 , 1 , 150 , 150 , 150 , 255 , 4 )
textDownloadRes = textCreateTextItem ( "Trwa pobieranie zasob?w serwera" , 0.3 , 0.35 , 1 , 150 , 150 , 150 , 255 , 1.5 )
textDisplayAddText ( textDisplay , textServerName )
textDisplayAddText ( textDisplay , textDownloadRes )
fadeCamera ( source , true )
addEvent ( "onZasobyPobrane" , true )
addEventHandler ( "onZasobyPobrane" , getRootElement (),
function()
setTimer (
function()
textDisplayRemoveText ( textDisplay , textServerName )
textDestroyTextItem ( textServerName )
textDestroyDisplay ( textDisplay )
setTimer (
function()
triggerClientEvent ( "onStartPanel" , getLocalPlayer ())
end , 100 , 1 )
end , 50 , 1 )
end
)
end
)
i kod addEvent:
addEvent ( "onStartPanel" , true )
addEventHandler ( "onStartPanel" , getLocalPlayer () showLoginBox )
Wysłany: 2013-03-02, 21:50
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
triggerClientEvent ( "onStartPanel" , getLocalPlayer ())
To jest strona serwera, tak? Jakim cudem chcesz skorzysta? z getLocalPlayer() po stronie serwera? Zmie? na prawid?owy element.
addEventHandler ( "onStartPanel" , getLocalPlayer () showLoginBox )
przecinek po getLocalPlayer()
Wysłany: 2013-03-02, 23:10
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Gdy do dajesz eventHandler to getRootElement() nie localPlayer.
Wysłany: 2013-03-03, 13:25
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Thanks you Brzysiek and Jacob.
[ Dodano : 2013-03-03, 13:22 ]
Jeszcze jedno pytanko:
Dlaczego destroyElement raz mi usuwa, a raz nie ?
destroyElement ( g_l_login )
destroyElement ( g_l_password )
destroyElement ( g_e_login )
destroyElement ( g_e_password )
destroyElement ( g_b_login )
destroyElement ( g_b_register )
[ Dodano : 2013-03-03, 13:28 ]
i dlaczego panel pokazuje si? wszystkim gracz? jak kto? wejdzie ?
addEventHandler ( "onPlayerJoin" , getRootElement (),
function()
textDisplay = textCreateDisplay ()
textDisplayAddObserver ( textDisplay , source )
textServerName = textCreateTextItem ( "Best RPG" , 0.45 , 0.05 , 1 , 150 , 150 , 150 , 255 , 4 )
textDownloadRes = textCreateTextItem ( "Trwa pobieranie zasob?w serwera" , 0.3 , 0.35 , 1 , 150 , 150 , 150 , 255 , 1.5 )
textDisplayAddText ( textDisplay , textServerName )
textDisplayAddText ( textDisplay , textDownloadRes )
fadeCamera ( source , true )
addEvent ( "onZasobyPobrane" , true )
addEventHandler ( "onZasobyPobrane" , getRootElement (),
function()
setTimer (
function()
textDisplayRemoveText ( textDisplay , textServerName )
textDestroyTextItem ( textServerName )
textDestroyDisplay ( textDisplay )
setTimer (
function()
triggerClientEvent ( "onStartPanel" , getRootElement ())
end , 100 , 1 )
end , 50 , 1 )
end
)
end
) function showLoginBox ()
fadeCamera ( true )
setElementPosition ( localPlayer , 1172.89 ,- 1156.69 ,- 100 )
setElementAlpha ( localPlayer , 0 )
showCursor ( true )
showChat ( false )
showPlayerHudComponent ( "all" , false )
addEventHandler ( "onClientRender" , getRootElement (), drawLoginBox )
guiSetInputMode ( "no_binds_when_editing" )
g_l_login = guiCreateLabel ( 6 / 30 , 9 / 20 , 4 / 30 , 0.03 , "Login/nick:" , true )
guiLabelSetHorizontalAlign ( g_l_login , "right" )
guiLabelSetVerticalAlign ( g_l_login , "center" )
g_e_login = guiCreateEdit ( 10.5 / 30 , 9 / 20 , 0.2 , 0.03 , "" , true )
guiEditSetMaxLength ( g_e_login , 22 )
g_l_password = guiCreateLabel ( 6 / 30 , 10 / 20 , 4 / 30 , 0.03 , "Has?o:" , true )
guiLabelSetHorizontalAlign ( g_l_password , "right" )
guiLabelSetVerticalAlign ( g_l_password , "center" )
g_e_password = guiCreateEdit ( 10.5 / 30 , 10 / 20 , 0.2 , 0.03 , "" , true )
guiEditSetMasked ( g_e_password , true )
g_b_login = guiCreateButton ( 17 / 30 , 9 / 20 , 4 / 30 , 2.5 / 30 , "Zaloguj" , true )
g_b_register = guiCreateButton ( 21.5 / 30 , 9 / 20 , 4 / 30 , 2.5 / 30 , "Za??? konto" , true )
addEventHandler ( "onClientGUIClick" , g_b_login , loginH , false )
addEventHandler ( "onClientGUIClick" , g_b_register , registerH , false )
end
addEvent ( "onStartPanel" , true )
addEventHandler ( "onStartPanel" , getRootElement (), showLoginBox )
Wysłany: 2013-03-03, 22:33
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
1. Raz usuwa a raz nie? Niekt?re elementy Ci usuwa, a niekt?re nie czy jak?
2. addEventHandler ( "onPlayerJoin" , getRootElement (),
function()
textDisplay = textCreateDisplay ()
textDisplayAddObserver ( textDisplay , source )
textServerName = textCreateTextItem ( "Best RPG" , 0.45 , 0.05 , 1 , 150 , 150 , 150 , 255 , 4 )
textDownloadRes = textCreateTextItem ( "Trwa pobieranie zasob?w serwera" , 0.3 , 0.35 , 1 , 150 , 150 , 150 , 255 , 1.5 )
textDisplayAddText ( textDisplay , textServerName )
textDisplayAddText ( textDisplay , textDownloadRes )
fadeCamera ( source , true )
addEvent ( "onZasobyPobrane" , true )
addEventHandler ( "onZasobyPobrane" , getRootElement (),
function()
setTimer (
function()
textDisplayRemoveText ( textDisplay , textServerName )
textDestroyTextItem ( textServerName )
textDestroyDisplay ( textDisplay )
setTimer (
function()
triggerClientEvent ( source , "onStartPanel" , getRootElement ())
end , 100 , 1 )
end , 50 , 1 )
end
)
end
)
Wysłany: 2013-03-04, 14:17
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Ziomek11 napisał/a :1. Raz usuwa a raz nie? Niekt?re elementy Ci usuwa, a niekt?re nie czy jak?
Masz na filmiku, jak widzisz tylko jedna rzecz si? usuwa:
http://youtu.be/XFARsAC33NI
Ziomek11 napisał/a : addEventHandler ( "onPlayerJoin" , getRootElement (),
function()
textDisplay = textCreateDisplay ()
textDisplayAddObserver ( textDisplay , source )
textServerName = textCreateTextItem ( "Best RPG" , 0.45 , 0.05 , 1 , 150 , 150 , 150 , 255 , 4 )
textDownloadRes = textCreateTextItem ( "Trwa pobieranie zasob?w serwera" , 0.3 , 0.35 , 1 , 150 , 150 , 150 , 255 , 1.5 )
textDisplayAddText ( textDisplay , textServerName )
textDisplayAddText ( textDisplay , textDownloadRes )
fadeCamera ( source , true )
addEvent ( "onZasobyPobrane" , true )
addEventHandler ( "onZasobyPobrane" , getRootElement (),
function()
setTimer (
function()
textDisplayRemoveText ( textDisplay , textServerName )
textDestroyTextItem ( textServerName )
textDestroyDisplay ( textDisplay )
setTimer (
function()
triggerClientEvent ( source , "onStartPanel" , getRootElement ())
end , 100 , 1 )
end , 50 , 1 )
end
)
end
)
Zaraz sprawdz? czy dzia?a
[ Dodano : 2013-03-04, 14:23 ]
Login Panel po sprawdzeniu przesta? si? pokazywa? :O
Wysłany: 2013-03-05, 08:16
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
addEvent ( "onStartPanel" , true )
addEventHandler ( "onStartPanel" , getRootElement (), showLoginBox )
Dodawanie tego eventu jest zupe?nie niepotrzebne. Zamiast go daj event onClientResourceStart - wyjdzie na to samo, poniewa? funkcja za??czy si? dopiero po w??czeniu zasobu i po pobraniu.
setTimer (
function()
triggerClientEvent ( source , onStartPanel , getRootElement ())
end , 100 , 1 )
Usu? jeszcze ten timer, i zr?b tak jak Ci powiedzia?em .
A co do twojego problemu ze znikaniem.. spr?buj takiej kolejno?ci :
destroyElement ( g_l_login )
destroyElement ( g_e_login )
destroyElement ( g_l_password )
destroyElement ( g_e_password )
destroyElement ( g_b_login )
destroyElement ( g_b_register )
Wysłany: 2013-03-05, 14:19
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Thanks you Brzysiek, you have .
You wrote at 8.16, you aren't school ?
[ Dodano : 2013-03-05, 14:21 ]
I remove YouTube's movie.
Wysłany: 2013-03-05, 14:48
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
Film to w?a?ciwie ju? wczoraj ko?o 16 przynajmniej mi nie dzia?a?.
PS. TU JEST POLSKA. Uszanuj to, ?e jest to POLSKIE forum, dlatego u?ywamy tu J?ZYKA POLSKIEGO. Mo?e wyda? Ci si? to zaskoczeniem, ale tak jest! Fajnie ?e znasz j?zyk angielski, ale nie musisz z tym si? tak odnosi? (odno? si? na community).
Wybaczcie za OT.
Wysłany: 2013-03-05, 15:30
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Ziomek11 napisał/a :Film to w?a?ciwie ju? wczoraj ko?o 16 przynajmniej mi nie dzia?a?.
Troch? trwa?o zanim si? wgra?, wgrywa?em 2 filmy naraz
Tagi: trigger :: nie :: rozpoczyna :: panelu.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: