Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-02-11, 19:09


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        LSF guiCreateWindow((screenW 545) / 2, (screenH 315) / 2545315"Bilety"false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(6810416189"Bilet do Los Santos - 750z?"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(30410416189"Bilet do Las Venturas - 800z?"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(4932794226"X"falseGUIEditor.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 (source750)
setElementPosiotion (thePlayerxx,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 :piwo:

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 19:13


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
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"przycisk1nazwa)


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.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 19:21


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

function Bilet1()
takePlayerMoney (source750)
setElementPosition (thePlayerxx,xx,xx)

end
addEventHandler("onClientGUIClick"przycisk1Butto1)

Co? takiego?
Brakuje:
- marker?w na gui
- myszki w gui
- chowanie gui po kliknieciu w ka?dy button

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 19:37


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

function Bilet1()
takePlayerMoney (localPlayer750)
setElementPosition (localPlayerxx,xx,xx)

end
addEventHandler("onClientGUIClick"przycisk1Bilet1)


Postaw piwo autorowi tego posta
 

 
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

Respekt: 1436,8
Respekt: 1436,8

Jak ma by? marker skoro go nie utworzy?e??, Marker tworzysz po s-side, a kursor

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        LSF guiCreateWindow((screenW 545) / 2, (screenH 315) / 2545315"Bilety"false)
        guiWindowSetSizable(GUIEditor.window[1], false)
       
         showCursor(true)

        GUIEditor.button[1] = guiCreateButton(6810416189"Bilet do Los Santos - 750z?"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(30410416189"Bilet do Las Venturas - 800z?"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(4932794226"X"falseGUIEditor.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 (source750)
setElementPosiotion (thePlayerxx,xx,xx)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 19:39


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

ok, do s side cos jeszcze ?

Podpis
Ostatnio zmieniony przez Axmell 2016-02-11, 19:46, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
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

Respekt: 1436,8
Respekt: 1436,8

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.


Więcej informacji znajdziesz w Wikipedii MTA:

createMarker

i

Więcej informacji znajdziesz w Wikipedii MTA:

guiSetVisible


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 19:43


TheGuruPolska







Wiek: 36
Na forum: 3767 dni
Posty: 65
Nick w MP: TheGuru

Piwa: 47

Respekt: 50

Usu? wszystko i wklej to :D

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:10


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

TheGuruPolska, nie dzia?a, zrobi?em marker pod s-side i jak podpi?c gui?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:16


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
addEventHandler("onClientMarkerHit",resourceRoot,
    function (el,md)
    if not md or el~=localPlayer then return end
    showCursor(true) 
    guiSetVisible(okno,trueend
)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:23


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

ERROR
loading script failed xxx.lua/c-side.lua:20:'=' expected near 'then'


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:24


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
He ? , Poka? 20 linijke.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:26


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

    onPlayerMarkerHit then


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:28


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
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
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-11, 20:35


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

Co? nie dzia?a, poka?esz jak ma to wyglada??

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: panelek
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku