Wysłany: 2016-02-04, 16:24
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
Witam, jak zrobic zeby po wejsciu w marker otwiera?o sie gui, i jak dodac funkcje do button?w na dodanie ?ycia graczowi?
Prosi?bym o nie przekierowywanie na mta wiki, tylko wyt?umaczenie.
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
GUIEditor . window [ 1 ] = guiCreateWindow (( screenW - 760 ) / 2 , ( screenH - 317 ) / 2 , 760 , 317 , "Menu Cluckin' Bell" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetAlpha ( GUIEditor . window [ 1 ], 0.87 )
GUIEditor . button [ 1 ] = guiCreateButton ( 65 , 71 , 169 , 61 , "Cola 0.5L - 5z?" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 1 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 2 ] = guiCreateButton ( 64 , 139 , 170 , 60 , "Cola 1L - 8z?" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 2 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 3 ] = guiCreateButton ( 249 , 71 , 170 , 61 , "Hamburger - 12z?" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 3 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 3 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 4 ] = guiCreateButton ( 249 , 139 , 170 , 60 , "Cheeseburger - 13z?" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 4 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 4 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 5 ] = guiCreateButton ( 433 , 71 , 170 , 61 , "Skrzyde?ka kurczaka x7 - 15z?" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 5 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 5 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 6 ] = guiCreateButton ( 433 , 139 , 170 , 61 , "Skrzyde?ka kurczaka x15 - 20z?" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 6 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 7 ] = guiCreateButton ( 708 , 276 , 43 , 31 , "X" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 7 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 7 ], "NormalTextColour" , "FFAAAAAA" )
end
)
Wysłany: 2016-02-04, 16:27
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Tworzysz event onClientGUIClick, a w nim wykonujesz setElementHealth, co powoduje dodanie ?ycia, Co do otwierania gui u?yj guiSetVisible przy evencie onClientMarkerHit.
Wysłany: 2016-02-04, 17:37
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
ok cos tam poprobuje, jak cos to napisze (nie zamykac)
[ Dodano : 2016-02-05, 17:34 ]
onClientGUIClick ( GUIEditor . button [ 1 ] ) then
addElementHealth ( source , 10 )
outputChatbox "Kupi?e? Cole 0.5L za 8z?"
takePlayerMoney ( source , 8 )
co? takiego?
Gdzie mam to dodac? Mo?e byc byle gdzie?
[ Dodano : 2016-02-05, 17:47 ]
I co dac do strony servera? bo to chyba client
Wysłany: 2016-02-05, 18:30
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
o moj boze cos ty tu wykombinowal
DODAJ TO DO CLIENTA :
addEventHandler ( "onClientGUIClick" , getRootElement (),function ()
if source ~= GUIEditor . button [ 1 ] then return end
addElementHealth ( source , 10 )
outputChatbox "Kupi?e? Cole 0.5L za 8z?"
triggerServerEvent ( "hajs" , getRootElement (), localPlayer )
end )
A TO DO SERVERA :
addEvent ( "hajs" , true )
addEventHandler ( "hajs" , root ,function ( plr )
takePlayerMoney ( plr , 8 )
end )
Wysłany: 2016-02-05, 18:37
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
Gdzie wy w mta macie addElementHealth ? Pode?lijcie linka.
Wysłany: 2016-02-05, 18:39
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4261 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
DestroY ,
Co? im sie pomyli?o
//No tobie te? bo funkcja od ma?ej si? zaczyna, jak b?dzie z du?ej to nie znajdzie.
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Ostatnio zmieniony przez #404 2016-02-05, 18:42, w całości zmieniany 1 raz
Wysłany: 2016-02-05, 19:27
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
Tylko ze ja nie mam S-side pomoze ktos z stworzeniem go?
Wysłany: 2016-02-05, 21:40
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
To? Black da? Ci kod, kt?ry masz wklepa? w s-side. Tworzysz nowy plik .lua np. server.lua, dodajesz go do mety z typem server i wklepujesz to.
Wysłany: 2016-02-06, 10:59
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
I tyle wystarczy? cu? ma?o.. :L
Wysłany: 2016-02-06, 13:58
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Tagi: jak :: dodać?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: