Wysłany: 2014-07-22, 18:09
zbawca
Wiek: 34 Na forum: 5035 dni Posty: 36
Nick w MP: DJglizdek
Piwa : 1
Witam. Problem tym razem polega na tym ?e w ka?dym kodzie jaki pisa?em wszystko dzia?a?o sprawnie na tej samej zasadzie co w kodzie po ni?ej lecz tym razem co? jest nie tak i nie umiem znale?? tego b??du:\ Problem dok?adnie w tym tkwi ?e komenda "test", kt?ra powinna otwiera? GUI nie robi ?adnej reakcji.
Kod:
GUIEditor = {
button = {}
}
wnd1 = guiCreateWindow ( 318 , 314 , 250 , 171 , "Dealer broni" , true )
guiSetVisible ( wnd1 , false )
guiWindowSetSizable ( wnd1 , false )
guiSetAlpha ( wnd1 , 0.87 )
imgbtn1 = guiCreateStaticImage ( 17 , 30 , 64 , 64 , "grafika/colt.png" , true , wnd1 )
imgbtn2 = guiCreateStaticImage ( 91 , 30 , 64 , 64 , "grafika/coltb.png" , true , wnd1 )
imgbtn3 = guiCreateStaticImage ( 165 , 30 , 64 , 64 , "grafika/desert.png" , true , wnd1 )
lbl1 = guiCreateLabel ( 17 , 104 , 64 , 19 , "1200$" , true , wnd1 )
guiSetFont ( lbl1 , "default-bold-small" )
guiLabelSetColor ( lbl1 , 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( lbl1 , "center" , false )
lbl2 = guiCreateLabel ( 91 , 104 , 64 , 19 , "1500$" , true , wnd1 )
guiSetFont ( lbl2 , "default-bold-small" )
guiLabelSetColor ( lbl2 , 255 , 0 , 0 )
guiLabelSetHorizontalAlign ( lbl2 , "center" , false )
lbl3 = guiCreateLabel ( 165 , 104 , 64 , 19 , "3000$" , true , wnd1 )
guiSetFont ( lbl3 , "default-bold-small" )
guiLabelSetColor ( lbl3 , 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( lbl3 , "center" , false )
btnz = guiCreateButton ( 10 , 130 , 229 , 31 , "Zamknij" , true , wnd1 )
guiSetFont ( btnz , "default-bold-small" )
function coltbtn ()
triggerServerEvent ( "imagebtn1" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn1 , coltbtn , false )
function coltbbtn ()
triggerServerEvent ( "imagebtn2" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn2 , coltbbtn , false )
function desertbtn ()
triggerServerEvent ( "imagebtn3" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn3 , desertbtn , false )
function otworzzamknij ()
if ( guiGetVisible ( wnd1 ) == false ) then
guiSetVisible ( wnd1 , true )
showCursor ( true )
else
guiSetVisible ( wnd1 , false )
showCursor ( false )
end
end
addCommandHandler ( "test" , otworzzamknij )
Z g?ry dzi?kuje za pomoc i licz? na szybk? odpowied?:)
PS. Debug nic nie pluje
Wysłany: 2014-07-22, 18:14
krydianero
Samotny Wilk
Wiek: 33 Na forum: 4783 dni Posty: 395
Nick w MP: Yoshida
Piwa : 1798
Podaj b??dy z DB3
Podpis
Multi Drive Unlimited:Nowy projekt już wkrótce
Wysłany: 2014-07-22, 18:21
zbawca
Wiek: 34 Na forum: 5035 dni Posty: 36
Nick w MP: DJglizdek
Piwa : 1
"zbawca" napisał/a :
"krydianero" napisał/a :
Nast?pnym razem prosz? o dok?adniejsze czytanie
Wysłany: 2014-07-22, 18:57
krydianero
Samotny Wilk
Wiek: 33 Na forum: 4783 dni Posty: 395
Nick w MP: Yoshida
Piwa : 1798
Po pierwsze usu? ca?? tablic? bo jak widz? w tym kodzie i tak jest zb?dna.
Przetestuj Ten kod:
addEventHandler ( 'onResourceStart' , getResourceRootElement ( getThisResource ()),function()
wnd1 = guiCreateWindow ( 318 , 314 , 250 , 171 , "Dealer broni" , true )
guiSetVisible ( wnd1 , false )
guiWindowSetSizable ( wnd1 , false )
guiSetAlpha ( wnd1 , 0.87 )
imgbtn1 = guiCreateStaticImage ( 17 , 30 , 64 , 64 , "grafika/colt.png" , true , wnd1 )
imgbtn2 = guiCreateStaticImage ( 91 , 30 , 64 , 64 , "grafika/coltb.png" , true , wnd1 )
imgbtn3 = guiCreateStaticImage ( 165 , 30 , 64 , 64 , "grafika/desert.png" , true , wnd1 )
lbl1 = guiCreateLabel ( 17 , 104 , 64 , 19 , "1200$" , true , wnd1 )
guiSetFont ( lbl1 , "default-bold-small" )
guiLabelSetColor ( lbl1 , 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( lbl1 , "center" , false )
lbl2 = guiCreateLabel ( 91 , 104 , 64 , 19 , "1500$" , true , wnd1 )
guiSetFont ( lbl2 , "default-bold-small" )
guiLabelSetColor ( lbl2 , 255 , 0 , 0 )
guiLabelSetHorizontalAlign ( lbl2 , "center" , false )
lbl3 = guiCreateLabel ( 165 , 104 , 64 , 19 , "3000$" , true , wnd1 )
guiSetFont ( lbl3 , "default-bold-small" )
guiLabelSetColor ( lbl3 , 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( lbl3 , "center" , false )
btnz = guiCreateButton ( 10 , 130 , 229 , 31 , "Zamknij" , true , wnd1 )
guiSetFont ( btnz , "default-bold-small" )
end
)
function coltbtn ()
triggerServerEvent ( "imagebtn1" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn1 , coltbtn , false )
function coltbbtn ()
triggerServerEvent ( "imagebtn2" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn2 , coltbbtn , false )
function desertbtn ()
triggerServerEvent ( "imagebtn3" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , imgbtn3 , desertbtn , false )
function otworzzamknij ()
if ( guiGetVisible ( wnd1 ) == false ) then
guiSetVisible ( wnd1 , true )
showCursor ( true )
else
guiSetVisible ( wnd1 , false )
showCursor ( false )
end
end
addCommandHandler ( "test" , otworzzamknij )
Podpis
Multi Drive Unlimited:Nowy projekt już wkrótce
Wysłany: 2014-07-22, 23:27
zbawca
Wiek: 34 Na forum: 5035 dni Posty: 36
Nick w MP: DJglizdek
Piwa : 1
Dalej nie dzia?a:\ I w debugu te? dalej nic nie ma
Wysłany: 2014-07-22, 23:49
krydianero
Samotny Wilk
Wiek: 33 Na forum: 4783 dni Posty: 395
Nick w MP: Yoshida
Piwa : 1798
zbawca , trzymaj
GUIEditor = {
button = {},
window = {},
label = {},
memo = {}
}
GUIEditor . window [ 1 ] = guiCreateWindow ( 318 , 314 , 250 , 171 , "Dealer broni" , true )
guiSetVisible ( GUIEditor . window [ 1 ], false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetAlpha ( GUIEditor . window [ 1 ], 0.87 )
GUIEditor . button [ 1 ] = guiCreateStaticImage ( 17 , 30 , 64 , 64 , "grafika/colt.png" , true , GUIEditor . window [ 1 ])
GUIEditor . button [ 2 ] = guiCreateStaticImage ( 91 , 30 , 64 , 64 , "grafika/coltb.png" , true , GUIEditor . window [ 1 ])
GUIEditor . button [ 3 ] = guiCreateStaticImage ( 165 , 30 , 64 , 64 , "grafika/desert.png" , true , GUIEditor . window [ 1 ])
GUIEditor . label [ 1 ] = guiCreateLabel ( 17 , 104 , 64 , 19 , "1200$" , true , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 1 ], "default-bold-small" )
guiLabelSetColor ( GUIEditor . label [ 1 ], 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( GUIEditor . label [ 1 ], "center" , false )
GUIEditor . label [ 2 ] = guiCreateLabel ( 91 , 104 , 64 , 19 , "1500$" , true , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 2 ], "default-bold-small" )
guiLabelSetColor ( GUIEditor . label [ 2 ], 255 , 0 , 0 )
guiLabelSetHorizontalAlign ( GUIEditor . label [ 2 ], "center" , false )
GUIEditor . label [ 3 ] = guiCreateLabel ( 165 , 104 , 64 , 19 , "3000$" , true , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 3 ], "default-bold-small" )
guiLabelSetColor ( GUIEditor . label [ 3 ], 255 , 6 , 0 )
guiLabelSetHorizontalAlign ( GUIEditor . label [ 3 ], "center" , false )
GUIEditor . button [ 4 ] = guiCreateButton ( 10 , 130 , 229 , 31 , "Zamknij" , true , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 4 ], "default-bold-small" )
function coltbtn ()
triggerServerEvent ( "imagebtn1" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 1 ], coltbtn , false )
function coltbbtn ()
triggerServerEvent ( "imagebtn2" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 2 ], coltbbtn , false )
function desertbtn ()
triggerServerEvent ( "imagebtn3" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 3 ], desertbtn , false )
function mojegui ()
outputChatBox ( 'y' )
if not guiGetVisible ( GUIEditor . window [ 1 ]) then
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true )
elseif guiGetVisible ( GUIEditor . window [ 1 ]) then
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
end
end
addCommandHandler ( "testg" , mojegui )
Teraz gui si? pojawia
Podpis
Multi Drive Unlimited:Nowy projekt już wkrótce
Tagi: ammunation
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: