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

Wysłany: 2015-07-28, 00:21


MikeY







Wiek: 25
Na forum: 4109 dni
Posty: 3
Nick w MP: Retro



Respekt: 50

Witam! M?g?by kto? zrobi? GUI pod ten kod oraz wyt?umaczy? mi krok po kroku? Za pomoc oczywi?cie :piwko:.

S-Side
local bikes = (x,y,z, "cylinder", 1.2, 255,0,0)
    createBlipAttachedTo(bikes, 52)

function wpbike (hitElement)
    local element = getElementType( hitElement )}
    createVehicle = ("481", pos [1], pos [2], poa [3] + 5)
end

addEventHandler("onMarkerHit", bikes, wpbike)

function zsbike (element)
    if getElementModel( source ) == 481 then
        setElementData(element, wpbike, false)
        destroyElement (source)
    end
end

addEventHandler("onVehicleExit", getRootElement(), zsbike)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-28, 08:57


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Jak ma to GUI wygl?da??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-28, 10:28


MikeY







Wiek: 25
Na forum: 4109 dni
Posty: 3
Nick w MP: Retro



Respekt: 50

Maximerr, Sorry zapomnia?em powiedzie? :D , kiedy gracz wejdzie w marker to poka?? si? okno z przyciskiem wypo?ycz rower. Dalej ju? nie musz? t?umaczy?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-28, 12:14


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Nie testowane

W razie bledow w /debugscript 3, podaj je tutaj


-- C-side
        t_Window = guiCreateWindow(427, 360, 418, 301, "Wypozycz rower", false)
        guiWindowSetSizable(t_Window, false)
        guiWindowSetMovable(t_Window, false)

        zresp = guiCreateButton(16, 91, 147, 96, "Wypozycz rower", false, t_Window)
        wyjdz = guiCreateButton(261, 91, 147, 96, "Wyjdz", false, t_Window)
        guiSetVisible(t_Window, false)
        
        
addEvent("showGUI", true)
addEventHandler("showGUI", resourceRoot, function()
guiSetVisible(t_Window, true)
showCursor(true)
end
)

addEvent("destroyGUI", true)
addEventHandler("destroyGUI", resourceRoot, function()
guiSetVisible(t_Window, false)
showCursor(false)
end
)


addEventHandler("onClientGUIClick", root, function(btn)
    if btn == "left" then
        if source == zresp then
            triggerServerEvent("respBike", localPlayer, localPlayer)
            outputChatBox("Wydano rower")
        elseif source == wyjdz then
            guiSetVisible(t_Window, false)
            showCursor(false)
        end
    end
end)





        
        -- S SIDE
        
local bikes = createMarker(x,y,z, "cylinder", 1.2, 255,0,0, 150)
    createBlipAttachedTo(bikes, 52)

addEventHandler("onMarkerHit", bikes, function (he, md)
if getElementType(he) == "player" then
    triggerClientEvent(he, "showGUI", he)
end
end)

addEventHandler("onMarkerLeave", bikes, function(he, md)
if getElementType(he) == "player" then
    triggerClientEvent(he, "destroyGUI", he)
end
end)
    

addEvent("respBike", true)
addEventHandler("respBike", resourceRoot, function(player)
    if getElementData(player, "wpbike") == false then
            x, y, z = getElementPosition(player)
            rower = createVehicle(481, x, y, z + 1)
            setElementData(player, "wpbike", true)
            setElementData(rower, "respiony", true)
            warpPedIntoVehicle(player, rower)
    end
end)

addEventHandler("onVehicleExit", getRootElement(), function(plr, int, jacker)
    if getElementModel(source) == 481 then
        if getElementData(source, "respiony") == true then
            setElementData(plr, "wpbike", false)
            destroyElement(source)
        end
    end
end)
            


[ Dodano: 2015-07-28, 12:15 ]
uzupelnij sobie w markerze tylko, gdzie ma powstac marker

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
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