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

Wysłany: 2016-08-15, 08:37


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
Jak wchodz? w marker , nie pokazuje mi si? gui , gdzie le?y problem ?

addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(415, 222, 543, 390, "", false)
        guiWindowSetSizable(napad, false)
   buy = guiCreateButton(38, 108, 105, 33, "Ak47", false, napad)
end)

local marker = createMarker(2295.04639, -1686.69812, 13.62975, "cylinder")

addEventHandler("onClientMarkerHit", marker, 
    function(hitElement, md)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napad, true)
    showCursor(true, false)
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end 

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayer, marker) then
            dff = engineLoadDFF ( "ak47.dff", 355 )
            engineReplaceModel ( dff, 355 )
            txd = engineLoadTXD ( "ak47.txd" )
            engineImportTXD ( txd, 355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napad, false)
            showCursor(false)
        end
        end
    end
end
addEventHandler("onClientGUIClick", root, podmien)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 12:06


AteX







Wiek: 27
Na forum: 4156 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Pewnie dlatego, ?e gui pokazuje si? tu? po w??czeniu skryptu, a nie wej?ciu w marker. Po utworzeniu gui schowaj je.
addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(415, 222, 543, 390, "", false)
        guiWindowSetSizable(napad, false)
   buy = guiCreateButton(38, 108, 105, 33, "Ak47", false, napad)
   guiSetVisible(napad,false)
end)

Kod testowany, nie ma mo?liwo?ci, aby nie dzia?a?.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 12:26


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
Dobra dzia?a dzi?ki

Postaw piwo autorowi tego posta
 

 
Tagi: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » GUI 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