Wysłany: 2015-07-28, 00:21
MikeY
Wiek: 24 Na forum: 3967 dni Posty: 3
Nick w MP: Retro
Witam! M?g?by kto? zrobi? GUI pod ten kod oraz wyt?umaczy? mi krok po kroku? Za pomoc oczywi?cie :piwko:.
S-Side
local bikes = ( x , y , z , "cylinder" , 1.2 , 255 , 0 , 0 )
createBlipAttachedTo ( bikes , 52 )
function wpbike ( hitElement )
local element = getElementType ( hitElement )}
createVehicle = ( "481" , pos [ 1 ], pos [ 2 ], poa [ 3 ] + 5 )
end
addEventHandler ( "onMarkerHit" , bikes , wpbike )
function zsbike ( element )
if getElementModel ( source ) == 481 then
setElementData ( element , wpbike , false )
destroyElement ( source )
end
end
addEventHandler ( "onVehicleExit" , getRootElement (), zsbike )
Wysłany: 2015-07-28, 08:57
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Wysłany: 2015-07-28, 10:28
MikeY
Wiek: 24 Na forum: 3967 dni Posty: 3
Nick w MP: Retro
Maximerr , Sorry zapomnia?em powiedzie? , kiedy gracz wejdzie w marker to poka?? si? okno z przyciskiem wypo?ycz rower. Dalej ju? nie musz? t?umaczy?.
Wysłany: 2015-07-28, 12:14
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
Nie testowane
W razie bledow w /debugscript 3, podaj je tutaj
-- C - side
t_Window = guiCreateWindow ( 427 , 360 , 418 , 301 , "Wypozycz rower" , false )
guiWindowSetSizable ( t_Window , false )
guiWindowSetMovable ( t_Window , false )
zresp = guiCreateButton ( 16 , 91 , 147 , 96 , "Wypozycz rower" , false , t_Window )
wyjdz = guiCreateButton ( 261 , 91 , 147 , 96 , "Wyjdz" , false , t_Window )
guiSetVisible ( t_Window , false )
addEvent ( "showGUI" , true )
addEventHandler ( "showGUI" , resourceRoot , function()
guiSetVisible ( t_Window , true )
showCursor ( true )
end
)
addEvent ( "destroyGUI" , true )
addEventHandler ( "destroyGUI" , resourceRoot , function()
guiSetVisible ( t_Window , false )
showCursor ( false )
end
)
addEventHandler ( "onClientGUIClick" , root , function( btn )
if btn == "left" then
if source == zresp then
triggerServerEvent ( "respBike" , localPlayer , localPlayer )
outputChatBox ( "Wydano rower" )
elseif source == wyjdz then
guiSetVisible ( t_Window , false )
showCursor ( false )
end
end
end )
-- S SIDE
local bikes = createMarker ( x , y , z , "cylinder" , 1.2 , 255 , 0 , 0 , 150 )
createBlipAttachedTo ( bikes , 52 )
addEventHandler ( "onMarkerHit" , bikes , function ( he , md )
if getElementType ( he ) == "player" then
triggerClientEvent ( he , "showGUI" , he )
end
end )
addEventHandler ( "onMarkerLeave" , bikes , function( he , md )
if getElementType ( he ) == "player" then
triggerClientEvent ( he , "destroyGUI" , he )
end
end )
addEvent ( "respBike" , true )
addEventHandler ( "respBike" , resourceRoot , function( player )
if getElementData ( player , "wpbike" ) == false then
x , y , z = getElementPosition ( player )
rower = createVehicle ( 481 , x , y , z + 1 )
setElementData ( player , "wpbike" , true )
setElementData ( rower , "respiony" , true )
warpPedIntoVehicle ( player , rower )
end
end )
addEventHandler ( "onVehicleExit" , getRootElement (), function( plr , int , jacker )
if getElementModel ( source ) == 481 then
if getElementData ( source , "respiony" ) == true then
setElementData ( plr , "wpbike" , false )
destroyElement ( source )
end
end
end )
[ Dodano : 2015-07-28, 12:15 ]
uzupelnij sobie w markerze tylko, gdzie ma powstac marker
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Tagi: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: