Wysłany: 2015-01-10, 17:17
michal982010
Wiek: 29 Na forum: 4445 dni Posty: 69
Piwa : 1
Witam.
Stworzy?em sobie w guieditor panel pojazdu (buttony, oraz grafik?)
I teraz chcia?bym nada? funkcje buttonom. Czy kto? z was pom?g?by mi z tym, np dopisa? do przycisku 1 odpalanie silnika jak powinien by? zrobiony, a ja reszt? zrobie sam na tej podstawie
Za pomoc daje oraz reputacje
GUIEditor = {
button = {},
staticimage = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
GUIEditor . staticimage [ 1 ] = guiCreateStaticImage ( 0.34 , 0.19 , 0.32 , 0.57 , ":guieditor/images/panel_tlo.png" , true )
GUIEditor . button [ 1 ] = guiCreateButton ( 104 , 129 , 368 , 65 , "" , false , GUIEditor . staticimage [ 1 ])
guiSetAlpha ( GUIEditor . button [ 1 ], 0.30 )
GUIEditor . button [ 2 ] = guiCreateButton ( 104 , 232 , 365 , 64 , "" , false , GUIEditor . staticimage [ 1 ])
guiSetAlpha ( GUIEditor . button [ 2 ], 0.30 )
GUIEditor . button [ 3 ] = guiCreateButton ( 105 , 331 , 364 , 64 , "" , false , GUIEditor . staticimage [ 1 ])
guiSetAlpha ( GUIEditor . button [ 3 ], 0.30 )
GUIEditor . button [ 4 ] = guiCreateButton ( 106 , 429 , 363 , 64 , "" , false , GUIEditor . staticimage [ 1 ])
guiSetAlpha ( GUIEditor . button [ 4 ], 0.30 )
end
)
Wysłany: 2015-01-10, 17:23
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Zajrzyj do mojego skryptu z interakcj?
Wysłany: 2015-01-10, 17:29
michal982010
Wiek: 29 Na forum: 4445 dni Posty: 69
Piwa : 1
zrobi?em tak jak w twoim skrypcie i mi si? nic nie pojawia
oto kod:
c-side
BUTTON = "LALT"
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource ()), function()
GUIEditor = {
button = {}
}
GUIEditor . staticimage [ 1 ] = guiCreateStaticImage ( 0.34 , 0.19 , 0.32 , 0.57 , ":guieditor/images/panel_tlo.png" , false )
przycisk [ 1 ] = guiCreateButton ( 104 , 129 , 368 , 65 , "Silnik" , false , GUIEditor . staticimage [ 1 ])
addEventHandler ( "onClientGUIClick" , przycisk [ 1 ], function()
wykonaj ( 1 )
end , false )
przycisk [ 2 ] = guiCreateButton ( 104 , 232 , 365 , 64 , "drzwi" , false , GUIEditor . staticimage [ 1 ])
addEventHandler ( "onClientGUIClick" , przycisk [ 2 ], function()
wykonaj ( 2 )
end , false )
przycisk [ 3 ] = guiCreateButton ( 105 , 331 , 364 , 64 , "swiatla" , false , GUIEditor . staticimage [ 1 ])
addEventHandler ( "onClientGUIClick" , przycisk [ 3 ], function()
wykonaj ( 3 )
end , false )
przycisk [ 4 ] = guiCreateButton ( 106 , 429 , 363 , 64 , "reczny" , false , GUIEditor . staticimage [ 1 ])
addEventHandler ( "onClientGUIClick" , przycisk [ 4 ], function()
wykonaj ( 4 )
end , false )
for i , v in ipairs ( przycisk ) do
guiSetVisible ( przycisk [ i ], false )
end
end )
bindKey ( BUTTON , "down" , function()
auto = getPedOccupiedVehicle ( getLocalPlayer () )
if not auto or not getVehicleController ( auto ) then
outputChatBox ( "*Nie jeste? w poje?dzie b?d? nie jeste? jego kierowc?" , 255 , 255 , 255 ) return end
interakcja ( 1 )
end )
bindKey ( BUTTON , "up" , function()
interakcja ( 2 )
end )
function interakcja ( type )
if not type or type == nil then return end
type = tonumber ( type )
if type == 1 then
for i , v in ipairs ( przycisk ) do
guiSetVisible ( przycisk [ i ], true )
showCursor ( true )
end
elseif type == 2 then
for i , v in ipairs ( przycisk ) do
guiSetVisible ( przycisk [ i ], false )
showCursor ( false )
end
end
end
function wykonaj ( number )
if not number or number == nil then return end
number = tonumber ( number )
if number == 1 then
triggerServerEvent ( "silnik" , getLocalPlayer () )
elseif number == 2 then
triggerServerEvent ( "drzwi" , getLocalPlayer () )
elseif number == 3 then
triggerServerEvent ( "swiatla" , getLocalPlayer () )
elseif number == 4 then
triggerServerEvent ( "reczny" , getLocalPlayer () )
end
end
Pojawia si? tylko informacja jak jestem poza autem i naciskam alt
[ Dodano : 2015-01-10, 19:13 ]
je?li trzeba, zap?ac? za oskryptowanie tego
Tagi: interakcja :: pojazdu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: