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

Wysłany: 2018-08-19, 20:02


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

GUIEditor = {
    staticimage = {}
}
    function tuning()
        GUIEditor.staticimage[1] = guiCreateStaticImage(387167554410":K_pojazdy-tuning/TLO/tlo.png"true)
        GUIEditor.staticimage[2] = guiCreateStaticImage(2924138134":K_pojazdy-tuning/US/ulepszsilnik.png"true) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(39024139136":K_pojazdy-tuning/NAPED/AWD.png"true)
        GUIEditor.staticimage[4] = guiCreateStaticImage(30254137135":K_pojazdy-tuning/NAPED/FWD.png"true) 
        GUIEditor.staticimage[5] = guiCreateStaticImage(390254137136":K_pojazdy-tuning/NAPED/RWD.png"true) 
        GUIEditor.staticimage[6] = guiCreateStaticImage(2401687574":K_pojazdy-tuning/EXIT/EXIT.png"true)
    end
marker createMarker ( -2328.54297, -168.0212933.83862"cylinder"3.000180200 )

addEventHandler("onClientMarkerHit"marker, function()
    guiSetVisible(GUIEditor.staticimage[1], true)
    guiSetVisible(GUIEditor.staticimage[2], true)
    guiSetVisible(GUIEditor.staticimage[3], true)
    guiSetVisible(GUIEditor.staticimage[4], true)
    guiSetVisible(GUIEditor.staticimage[5], true)
    guiSetVisible(GUIEditor.staticimage[6], true)
    showCursor(false)
end)


nie wiem jak to zrobi? jak kto? wie to pomo?e kto??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-19, 20:21


_jvneczek







Wiek: 22
Na forum: 4326 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

?apaj, licze na piwko i respekcik, powinno dzialac ;p

local screenWscreenH guiGetScreenSize()
pokaz false
GUIEditor = {
    staticimage = {}
}
    function tuning()
        GUIEditor.staticimage[1] = guiCreateStaticImage(387167554410":K_pojazdy-tuning/TLO/tlo.png"true)
        GUIEditor.staticimage[2] = guiCreateStaticImage(2924138134":K_pojazdy-tuning/US/ulepszsilnik.png"true) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(39024139136":K_pojazdy-tuning/NAPED/AWD.png"true)
        GUIEditor.staticimage[4] = guiCreateStaticImage(30254137135":K_pojazdy-tuning/NAPED/FWD.png"true) 
        GUIEditor.staticimage[5] = guiCreateStaticImage(390254137136":K_pojazdy-tuning/NAPED/RWD.png"true) 
        GUIEditor.staticimage[6] = guiCreateStaticImage(2401687574":K_pojazdy-tuning/EXIT/EXIT.png"true)
    end
marker createMarker ( -2328.54297, -168.0212933.83862"cylinder"3.000180200 )

addEventHandler("onClientMarkerHit"marker, function()
    guiSetVisible(GUIEditor.staticimage[1], true)
    guiSetVisible(GUIEditor.staticimage[2], true)
    guiSetVisible(GUIEditor.staticimage[3], true)
    guiSetVisible(GUIEditor.staticimage[4], true)
    guiSetVisible(GUIEditor.staticimage[5], true)
    guiSetVisible(GUIEditor.staticimage[6], true)
    showCursor(false)
end)

function pokazuj)
    if pokaz == false then
        addEventHandler ("onClientRender"roottuning)
    pokaz true
    else
        removeEventHandler ("onClientRender"roottuning)
        pokaz false 
    end
end
bindKey ("F5""down"tuning)

tu gdzie F5 ustalasz pod jakim przyciskiem gui sie odpala

Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-19, 20:46


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

client
function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

tuningmarker1 createMarker ( -2328.19092, -168.6867233.83862"cylinder"30255180 )
tuning_gui1 false

    function tuningpojazdu()     
        dxDrawImage(323151697443":K_pojazdy-tuning/TLO/tlo.png"000tocolor(255255255255), false)
        dxDrawImage(362427144145":K_pojazdy-tuning/US/ulepszsilnik.png"000tocolor(255255255255), false)
        dxDrawImage(524426144145":K_pojazdy-tuning/NAPED/AWD.png"000tocolor(255255255255), false)
        dxDrawImage(842425144146":K_pojazdy-tuning/NAPED/FWD.png"000tocolor(255255255255), false)
        dxDrawImage(684426144145":K_pojazdy-tuning/NAPED/RWD.png"000tocolor(255255255255), false)
        dxDrawText("Witaj w panelu tuningu mechanicznego pojazd?w.\nPoni?ej masz opcje kt?re mo?esz tutaj zamontowa? :)"501 1267 1814 1309 1tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu tuningu mechanicznego pojazd?w.\nPoni?ej masz opcje kt?re mo?esz tutaj zamontowa? :)"501 1267 1814 1309 1tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu tuningu mechanicznego pojazd?w.\nPoni?ej masz opcje kt?re mo?esz tutaj zamontowa? :)"501 1267 1814 1309 1tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu tuningu mechanicznego pojazd?w.\nPoni?ej masz opcje kt?re mo?esz tutaj zamontowa? :)"501 1267 1814 1309 1tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu tuningu mechanicznego pojazd?w.\nPoni?ej masz opcje kt?re mo?esz tutaj zamontowa? :)"501267814309tocolor(585858255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(9631683330":K_pojazdy-tuning/EXIT/EXIT.png"000tocolor(255255255255), false)
    end

addEventHandler("onClientMarkerHit"tuningmarker1, function()
    if tuning_gui1 == false then
        addEventHandler("onClientRender"roottuningpojazdu)
        showCursor(true)
        tuning_gui1 true
    end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuning_gui1 == true then
            if isMouseInPosition(9631683330then
                removeEventHandler("onClientRender"roottuningpojazdu)
                showCursor(false)
                tuning_gui1 false
            end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuning_gui1 == true then
            if isMouseInPosition(362427144145then
                triggerServerEvent("ulepszsilnik"localPlayer)
                removeEventHandler("onClientRender"roottuningpojazdu)
                showCursor(false)
                tuning_gui1 false
            end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuning_gui1 == true then
            if isMouseInPosition(524426144145then
                triggerServerEvent("AWD"localPlayer)
                removeEventHandler("onClientRender"roottuningpojazdu)
                showCursor(false)
                tuning_gui1 false
            end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuning_gui1 == true then
            if isMouseInPosition(842425144146then
                triggerServerEvent("FWD"localPlayer)
                removeEventHandler("onClientRender"roottuningpojazdu)
                showCursor(false)
                tuning_gui1 false
            end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuning_gui1 == true then
            if isMouseInPosition(684426144145then
                triggerServerEvent("RWD"localPlayer)
                removeEventHandler("onClientRender"roottuningpojazdu)
                showCursor(false)
                tuning_gui1 false
            end
        end
    end
end
)
end
end
end
)
end
end
end
)
end
end
end
)
end
end
end
)
end
)

server
addEvent("ulepszslinik"true)
addEventHandler("ulepszsilnik"root, function()
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
local money getPlayerMoney(thePlayer)
if (money 65000then 
        takePlayerMoney(source65000)
        outputChatBox"#6699FFPomy?lnie zamontowano ulepszony silnik!"getRootElement(), 255255255true )
setVehicleHandling(pojazd"maxVelocity"250.0 )
setVehicleHandling(pojazd"engineAcceleration"16.0 )
end

addEvent("AWD"true)
addEventHandler("AWD"root, function()
pojazd getPedOccupiedVehicle(source)
local money getPlayerMoney(thePlayer)
if not pojazd then return end
if (money 65000then 
        takePlayerMoney(source65000)
        outputChatBox"#6699FFPomy?lnie zamontowano nap?d AWD"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""awd")
end

addEvent("RWD"true)
addEventHandler("RWD"root, function()
pojazd getPedOccupiedVehicle(source)
local money getPlayerMoney(thePlayer)
if not pojazd then return end
if (money 65000then 
        takePlayerMoney(source65000)
        outputChatBox"#6699FFPomy?lnie zamontowano nap?d RWD"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""rwd")
end

addEvent("FWD"true)
addEventHandler("FWD"root, function()
pojazd getPedOccupiedVehicle(source)
local money getPlayerMoney(thePlayer)
if not pojazd then return end
if (money 65000then 
        takePlayerMoney(source65000)
        outputChatBox"#6699FFPomy?lnie zamontowano nap?d FWD"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""fwd")
end
end
)
end
)
end
)
end
)                


zrobi?em to tak i wyskakuje ERROR:Client (czlowiekjaja) triggered serverside event ulepszsilnik, but event is not added serverside

[ Dodano: 2018-08-20, 12:29 ]
dobra uda?o mi si? do zamkni?cia

Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zrobić :: żeby :: gui :: się :: włączało
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » jak zrobić żeby gui się włączało 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