Wysłany: 2019-09-14, 18:51
Szyszka947
ASP NET Core / Lua
Wiek: 19 Na forum: 2579 dni Posty: 288
Piwa : 16
Witam ponownie, wyjasni mi ktos czemu ten panel pojawia sie od razu po zrespieniu, a czasami od razu po wejsciu na serwer? Szukam, szukam, szukam, szukam i szukam i ze tak powiem !@#$#%%&#@% mnie trafia. Kod:
--[[
Author : SoSexy
Description : Information panel for servers
====== Information Panel ======
]]--
helpwindow = guiCreateWindow ( 0.18 , 0.16 , 0.68 , 0.71 , "Panel Pomocy" , true )
guiWindowSetSizable ( helpwindow , false )
helpmemo = guiCreateMemo ( 0.21 , 0.03 , 0.78 , 0.95 , "" , true , helpwindow )
guiMemoSetReadOnly ( helpmemo , true )
infogrid = guiCreateGridList ( 0.01 , 0.04 , 0.20 , 0.86 , true , helpwindow )
guiGridListAddColumn ( infogrid , "Info" , 0.9 )
function openit ()
if ( guiGetVisible ( helpwindow ) == false ) then
guiSetVisible ( helpwindow , true )
showCursor ( true )
fill ()
elseif ( guiGetVisible ( helpwindow ) == true ) then
guiSetVisible ( helpwindow , false )
showCursor ( false )
guiGridListClear ( infogrid )
guiSetText ( helpmemo , "" )
end
end
bindKey ( "F1" , "down" , openit )
info = { "Regulamin" , "Komendy" , "Informacje" , "Administracja" }
function fill ()
for i , v in ipairs ( info ) do
local row = guiGridListAddRow ( infogrid )
guiGridListSetItemText ( infogrid , row , 1 , v , false , false )
end
end
local AdminsF = fileOpen ( "texts/Admins.txt" , true )
local RulesF = fileOpen ( "texts/Rules.txt" , true )
local CommandsF = fileOpen ( "texts/Commands.txt" , true )
local InfoF = fileOpen ( "texts/Information.txt" , true )
local admins = fileRead ( AdminsF , 50000 )
local rules = fileRead ( RulesF , 50000 )
local commands = fileRead ( CommandsF , 50000 )
local info = fileRead ( InfoF , 50000 )
function clicked ()
local row , col = guiGridListGetSelectedItem ( infogrid )
if source == infogrid then
if guiGridListGetItemText ( infogrid , row , col ) == "Regulamin" then
guiSetText ( helpmemo , rules )
elseif guiGridListGetItemText ( infogrid , row , col ) == "Komendy" then
guiSetText ( helpmemo , commands )
elseif guiGridListGetItemText ( infogrid , row , col ) == "Informacje" then
guiSetText ( helpmemo , info )
elseif guiGridListGetItemText ( infogrid , row , col ) == "Administracja" then
guiSetText ( helpmemo , admins )
end
end
end
addEventHandler ( "onClientGUIClick" , root , clicked )
Wysłany: 2019-09-14, 19:00
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3809 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
To jest caly kod, czy jest jeszcze serverside?
Wysłany: 2019-09-14, 19:16
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Ustawiaj warto?? na 'false' dla elementu helpwindow zaraz po jego stworzeniu (po guiCreateWindow)
Wysłany: 2019-09-14, 19:47
Szyszka947
ASP NET Core / Lua
Wiek: 19 Na forum: 2579 dni Posty: 288
Piwa : 16
Jest tylko client side, wilq to co dales tez nie dziala
Wysłany: 2019-09-14, 20:47
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3809 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
Dodaj na koniec kodu guiSetVisible(helpwindow,false)
Jak dalej b?dzie to samo to znaczy, ?e musi by? podpi?ty jaki? event.
Wysłany: 2019-09-15, 10:15
Szyszka947
ASP NET Core / Lua
Wiek: 19 Na forum: 2579 dni Posty: 288
Piwa : 16
Na koncu kodu? Stworzyc nowa funkcje po funkcji clicked? Xd
Tagi: panel
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: