Wysłany: 2014-08-31, 13:12
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
witam jak zrobic panel auta znaczy gui mam tylko funkcje itd
GUI :
GUIEditor = {
button = {},
window = {},
label = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
GUIEditor . window [ 1 ] = guiCreateWindow ( 440 , 383 , 256 , 457 , "Panel Auta " , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
GUIEditor . button [ 1 ] = guiCreateButton ( 11 , 24 , 228 , 43 , "Silnik" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 1 ], "sa-header" )
guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FF0119FD" )
GUIEditor . button [ 2 ] = guiCreateButton ( 10 , 77 , 228 , 43 , "Reczny" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 2 ], "sa-header" )
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FF0119FD" )
GUIEditor . button [ 3 ] = guiCreateButton ( 10 , 130 , 228 , 43 , "Swiatla" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 3 ], "sa-header" )
guiSetProperty ( GUIEditor . button [ 3 ], "NormalTextColour" , "FF0119FD" )
GUIEditor . label [ 1 ] = guiCreateLabel ( 9 , 198 , 220 , 66 , "Panel by \nTrevoR \nWersja 1.0" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 1 ], "default-bold-small" )
guiLabelSetColor ( GUIEditor . label [ 1 ], 253 , 53 , 0 )
end
)
i niewiem co dalej
Wysłany: 2014-08-31, 13:18
Dixers
No-Life
Wiek: 26 Na forum: 4312 dni Posty: 549
Nick w MP: Dixers
Piwa : 412
Wi?c tak. Musisz zacz?? od funkcji. Wi?c podam ci funkcj? do silnika a reszt? spr?buj sam.
GUIEditor = {
button = {},
window = {},
label = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
okno = guiCreateWindow ( 440 , 383 , 256 , 457 , "Panel Auta" , false )
guiWindowSetSizable ( okno , false )
silnik = guiCreateButton ( 11 , 24 , 228 , 43 , "Silnik" , false , okno )
guiSetFont ( silnik , "sa-header" )
guiSetProperty ( silnik , "NormalTextColour" , "FF0119FD" )
reczny = guiCreateButton ( 10 , 77 , 228 , 43 , "Reczny" , false , okno )
guiSetFont ( reczny , "sa-header" )
guiSetProperty ( reczny , "NormalTextColour" , "FF0119FD" )
lampy = guiCreateButton ( 10 , 130 , 228 , 43 , "Swiatla" , false , okno )
guiSetFont ( lampy , "sa-header" )
guiSetProperty ( lampy ], "NormalTextColour" , "FF0119FD" )
GUIEditor . label [ 1 ] = guiCreateLabel ( 9 , 198 , 220 , 66 , "Panel by \nTrevoR \nWersja 1.0" , false , okno )
guiSetFont ( GUIEditor . label [ 1 ], "default-bold-small" )
guiLabelSetColor ( GUIEditor . label [ 1 ], 253 , 53 , 0 )
end
)
function silnik ()
localVehicle = getPedOccupiedVehicle ( getLocalPlayer () )
if source == silnik and ( localVehicle ) then
if ( getVehicleEngineState ( localVehicle ) ~= false ) then
setVehicleEngineState ( localVehicle , false )
else
setVehicleEngineState ( localVehicle , true )
end
end
end
addEventHandler ( "onClientGUIClick" , root , silnik )
[ Dodano : 2014-08-31, 13:19 ]
PS: Lekko edytowa?em twoje okno dla u?atwienia mi pracy. Zmieni?em tylko nazwy.
Wysłany: 2014-08-31, 13:21
KukiX
Wiek: 34 Na forum: 6718 dni Posty: 567
Piwa : 17560
Wysłany: 2014-08-31, 13:26
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
spoko dzieki a jak dodac bindkey i gdzie /
[ Dodano : 2014-08-31, 13:29 ]
piwka leca
Wysłany: 2014-08-31, 13:31
Dixers
No-Life
Wiek: 26 Na forum: 4312 dni Posty: 549
Nick w MP: Dixers
Piwa : 412
AstroStudio , bind key na ko?cu mo?esz a oto przyk?ad:
function okno ()
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ())
if ( guiGetVisible ( okno )) then
showCursor ( false )
guiSetVisible ( okno , false )
else
if isCursorShowing () then return end
if vehicle and getVehicleController ( vehicle ) == getLocalPlayer () then
showCursor ( true )
guiSetVisible ( okno , true )
end
end
end
bindKey ( "LSHIFT" , "down" , okno )
Ten bind sprawia, ?e okno pojawi si? tylko jak b?dziesz kierowc?.
Licz? na piwko
Tagi: jak :: zrobic :: panel :: auta
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: