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

Wysłany: 2013-05-05, 00:06


PanGrzybulek







Wiek: 29
Na forum: 4964 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
Czesc. Stworzylem sobie gui na dawanie aut, lecz po odpaleniu skryptu, pol zawartosci gui sie odpala a drugie pol po wejsciu do markera ktory oznaczylem jako glowny, czyli dopiero po wejsciu do niego ma sie okno otwierac.

local marker = createMarker(-4, 1219, 18, "cylinder", 2, 0, 255, 255, 30)


GUIEditor = {

    label = {},
    button = {},
    window = {},
    gridlist = {}
    

}

        okno = guiCreateWindow(569, 203, 386, 435, "Server Polskiego RPG", false)
        guiWindowSetSizable(okno, false)

        GUIEditor.gridlist[2] = guiCreateGridList(24, 149, 149, 254, false, okno)
        guiGridListAddColumn(GUIEditor.gridlist[2], "Pojazd", 0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.4)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Buffalo", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "402", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Bullet", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "541", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Elegy", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "582", false, false)
        GUIEditor.label[1] = guiCreateLabel(25, 118, 148, 21, "Przyk?adowe pojazdy", false, okno)
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
        guiLabelSetVerticalAlign(GUIEditor.label[1], "center")
        zamknij = guiCreateButton(340, 400, 31, 25, "X", false, okno)
        guiSetFont(zamknij, "default-bold-small")
        edit = guiCreateEdit(211, 183, 135, 28, "", false, okno)
        kup = guiCreateButton(197, 310, 155, 34, "KUP", false, okno)  
        
        
        function guitekst()
        dxDrawText("Salon Samochodowy", 611, 245, 926, 291, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Wpisz ID", 776, 344, 927, 376, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Wpisz ID", 776, 342, 927, 374, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Wpisz ID", 774, 344, 925, 376, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Wpisz ID", 774, 342, 925, 374, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Wpisz ID", 775, 343, 926, 375, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawLine(753, 330, 753, 595, tocolor(255, 255, 255, 255), 1, true)
        dxDrawText("Cena:\n10000$", 775, 428, 926, 460, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Copyright by @BrudnyAnal\nWi?cej na originalgta.pl", 609, 611, 743, 643, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", false, false, true, false, false)
        end

function abrir ( hitElement )
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
guiSetVisible(okno, true)
showCursor(true)
addEventHandler ( "onClientRender", getRootElement(), guitekst )
outputChatBox ( "Witamy w salonie Fort Carson!", 255, 0, 0 )
end
end
addEventHandler("onClientMarkerHit", marker, abrir)

function cerrarv()
    guiSetVisible ( okno, false )
    showCursor ( false )
    guiSetInputEnabled ( false )
    removeEventHandler ( "onClientRender", getRootElement(), guitekst )
end
addEventHandler("onClientGUIClick", zamknij, cerrarv, false)

function darskin()
local pMoney = getPlayerMoney(source)
if pMoney >= 10000 then
takePlayerMoney ( 10000 )
createVehicle(tonumber( guiGetText ( edit ) ), 1, 1219, 20 )
outputChatBox ( "Kupi?e? auto ! Twoje auto stoi przed wjazdem !", 0, 255, 0 )
else
outputChatBox ( "Nie sta? Ci? na to.", 255, 0, 0 )
end
end
addEventHandler("onClientGUIClick", kup, darskin, false)

Gdzie znowu zrobilem blad?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-05, 10:34


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

        okno = guiCreateWindow(569, 203, 386, 435, "Server Polskiego RPG", false)
        guiWindowSetSizable(okno, false)

        GUIEditor.gridlist[2] = guiCreateGridList(24, 149, 149, 254, false, okno)
        guiGridListAddColumn(GUIEditor.gridlist[2], "Pojazd", 0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.4)
        for i = 1, 3 do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Buffalo", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "402", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Bullet", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "541", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Elegy", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "582", false, false)
        GUIEditor.label[1] = guiCreateLabel(25, 118, 148, 21, "Przyk?adowe pojazdy", false, okno)
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
        guiLabelSetVerticalAlign(GUIEditor.label[1], "center")
        zamknij = guiCreateButton(340, 400, 31, 25, "X", false, okno)
        guiSetFont(zamknij, "default-bold-small")
        edit = guiCreateEdit(211, 183, 135, 28, "", false, okno)
        kup = guiCreateButton(197, 310, 155, 34, "KUP", false, okno)
       guiSetVisible(okno, false)
       


Domy?lnie GUI jest pokazywane graczowi, dlatego by je schowa? musimy u?y? guiSetVisible ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-05, 12:26


PanGrzybulek







Wiek: 29
Na forum: 4964 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
Dzieki :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: cos :: nie :: tak
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