Wysłany: 2016-02-11, 19:09
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
LSF = guiCreateWindow (( screenW - 545 ) / 2 , ( screenH - 315 ) / 2 , 545 , 315 , "Bilety" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
GUIEditor . button [ 1 ] = guiCreateButton ( 68 , 104 , 161 , 89 , "Bilet do Los Santos - 750z?" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 2 ] = guiCreateButton ( 304 , 104 , 161 , 89 , "Bilet do Las Venturas - 800z?" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 3 ] = guiCreateButton ( 493 , 279 , 42 , 26 , "X" , false , GUIEditor . window [ 1 ])
end
)
LSF = createMarker ( xx . xx , xx , "cylinder" , xx , xx , xx )
function panell ( thePlayer )
onPlayerMarkerHit then
guiSetVisible LSF ( thePlayer )
end
onClientGUIClick ( GUIEditor . button [ 1 ] ) then
takePlayerMoney ( source , 750 )
setElementPosiotion ( thePlayer , xx , xx , xx )
Chodzi mi o to zeby po wejsciu w marker otwiera?o sie gui + dzia?aj?ca myszka oraz zabieranie kasy po kliknieciu w button. Jeden button ma funkcje zamykania. Ide w dobrym kierunku? Je?li nie to prosze o poprawe. Staffiam
Wysłany: 2016-02-11, 19:13
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
Axmell , idziesz w fatalnym kierunku prawd? m?wi?c
Tak wygl?da struktura event?w:
addEventHandler ( "onClientGUIClick" , root , function()
if source == przycisk1 then
elseif source == przycisk2 then
end
end
)
-- lub
function nazwa ()
end
addEventHandler ( "onClientGUIClick" , przycisk1 , nazwa )
Spr?buj to zrobi?, jak to Ci si? uda to b?dzie po po?owie problem?w, wtedy przyjd? z wynikami i pomo?emy dalej.
Wysłany: 2016-02-11, 19:21
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
function Bilet1 ()
takePlayerMoney ( source , 750 )
setElementPosition ( thePlayer , xx , xx , xx )
end
addEventHandler ( "onClientGUIClick" , przycisk1 , Butto1 )
Co? takiego?
Brakuje:
- marker?w na gui
- myszki w gui
- chowanie gui po kliknieciu w ka?dy button
Wysłany: 2016-02-11, 19:37
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
function Bilet1 ()
takePlayerMoney ( localPlayer , 750 )
setElementPosition ( localPlayer , xx , xx , xx )
end
addEventHandler ( "onClientGUIClick" , przycisk1 , Bilet1 )
Wysłany: 2016-02-11, 19:38
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Jak ma by? marker skoro go nie utworzy?e??, Marker tworzysz po s-side, a kursor
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
LSF = guiCreateWindow (( screenW - 545 ) / 2 , ( screenH - 315 ) / 2 , 545 , 315 , "Bilety" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
showCursor ( true )
GUIEditor . button [ 1 ] = guiCreateButton ( 68 , 104 , 161 , 89 , "Bilet do Los Santos - 750z?" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 2 ] = guiCreateButton ( 304 , 104 , 161 , 89 , "Bilet do Las Venturas - 800z?" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 3 ] = guiCreateButton ( 493 , 279 , 42 , 26 , "X" , false , GUIEditor . window [ 1 ])
end
)
LSF = createMarker ( xx . xx , xx , "cylinder" , xx , xx , xx )
function panell ( thePlayer )
onPlayerMarkerHit then
guiSetVisible LSF ( thePlayer )
end
onClientGUIClick ( GUIEditor . button [ 1 ] ) then
takePlayerMoney ( source , 750 )
setElementPosiotion ( thePlayer , xx , xx , xx )
Wysłany: 2016-02-11, 19:39
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
ok, do s side cos jeszcze ?
Ostatnio zmieniony przez Axmell 2016-02-11, 19:46, w całości zmieniany 1 raz
Wysłany: 2016-02-11, 19:42
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Pr?buj dzia?a? sam z wiki, bo ja widz?, ?e oczekujesz gotowca. My ci tu pomo?emy, wyt?umaczymy dzia?anie itd, ale nie odwalimy roboty za ciebie.
i
Wysłany: 2016-02-11, 19:43
TheGuruPolska
Wiek: 36 Na forum: 3767 dni Posty: 65
Nick w MP: TheGuru
Piwa : 47
Usu? wszystko i wklej to
Kod: local screenW, screenH = guiGetScreenSize()
okno = guiCreateWindow((screenW - 545) / 2, (screenH - 315) / 2, 545, 315, "Bilety", false)
guiWindowSetSizable(okno, false)
btt1 = guiCreateButton(68, 104, 161, 89, "Bilet do Los Santos - 750z?", false, okno)
guiSetProperty(btt1, "NormalTextColour", "FFAAAAAA")
btt2 = guiCreateButton(304, 104, 161, 89, "Bilet do Las Venturas - 800z?", false, okno)
guiSetProperty(btt2, "NormalTextColour", "FFAAAAAA")
btt3 = guiCreateButton(493, 279, 42, 26, "X", false, okno)
guiSetVisible(okno,false)
lsfm = createMarker (xx,xx,xx,"cylinder",xx,xx,xx)
function panell ()
showCursor(true)
guiSetVisible(okno,true)
end
addEventHandler("onClientMarkerHit",lsfm,panell)
addEventHandler("onClientGUIClick", btt1,
function()
takePlayerMoney(getLocalPlayer, 750)
end)
addEventHandler("onClientGUIClick", btt3,
function()
guiSetVisible(okno,false)
showCursor(false)
end)
Wysłany: 2016-02-11, 20:10
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
TheGuruPolska , nie dzia?a, zrobi?em marker pod s-side i jak podpi?c gui?
Wysłany: 2016-02-11, 20:16
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
addEventHandler ( "onClientMarkerHit" , resourceRoot ,
function ( el , md )
if not md or el ~= localPlayer then return end
showCursor ( true )
guiSetVisible ( okno , true )
end
)
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-11, 20:23
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
ERROR
loading script failed xxx.lua/c-side.lua:20:'=' expected near 'then'
Wysłany: 2016-02-11, 20:24
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
He ? , Poka? 20 linijke.
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-11, 20:26
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
Wysłany: 2016-02-11, 20:28
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Wys?a?em tobie dzia?aj?cy kod. Wklej go na c-side i stw?rz marker TE? na c-side.
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-11, 20:35
Axmell
E-Commerce
Wiek: 24 Na forum: 3810 dni Posty: 279
Nick w MP: %Axmell
Piwa : 224
Co? nie dzia?a, poka?esz jak ma to wyglada??
Tagi: panelek
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: