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

Wysłany: 2018-12-14, 18:55


NoKill1997

Online






Wiek: 29
Na forum: 3365 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 783

Respekt: 80,5

Witam mam problem z bramkami, mianowicie nie wczytuje mi kodu. Jestem osoba zielona w LUA, wiec mam problemy w wykonaniu tego kodu :V


local screenW, screenH = guiGetScreenSize()
panel = false
local object=createObject(2000, -1371.53, 866.27, 46.88, 0, 270, -90),
local marker=createMarker(-1371.53, 866.27, 46.88-1, "cylinder", 9, 0, 0, 0, 0),
setElementData(object,"zamknieta",true)

function Okienko()
        end

addEvent("Gbrama", true)
addEventHandler("Gbrama", resourceRoot, function()
if panel == false then
      addEventHandler("onClientRender",root,Okienko)
                tick = getTickCount()
                panel = true
                showCursor (true)
                
    end
end)

function zamknij()
    if getElementData(object,"otwarta") then
        moveObject(object,1000, 1655.64, -25.45, 36.25+0.25,-0.00, -90, 0)
        setElementData(object,"zamknieta",true)
        setElementData(object,"otwarta",false)
    end
end

function ZamknijOkno(button, state)
    if panel and button == "left" and state == "down" then
           if cursorPosition(screenW * 0.5508, screenH * 0.5482, screenW * 0.1426, screenH * 0.0495) then
                        removeEventHandler("onClientRender",root,Okienko)
                        panel = false
                        showCursor (false) 
         end
    end
end
addEventHandler("onClientClick", getRootElement(), ZamknijOkno)

function Otworzbrame(button, state)
if panel and button == "left" and state == "down" then
        if cursorPosition(screenW * 0.3018, screenH * 0.5495, screenW * 0.1426, screenH * 0.0495) then
        moveObject(object,1000,2000, -22.01,2338.95,24.14,+0.25,0,90,0)
        setElementData(object,"zamknieta",false)
        setElementData(object,"otwarta",true)
        setTimer ( zamknij, 6000, 1 )
        removeEventHandler("onClientRender",root,Okienko)
                        panel = false
                        showCursor (false) 
   end
end
end
addEventHandler("onClientClick", getRootElement(), Otworzbrame)

function cursorPosition(x, y, w, h)
    if (not isCursorShowing()) then
        return false
    end
    local mx, my = getCursorPosition()
    local fullx, fully = guiGetScreenSize()
    cursorx, cursory = mx*fullx, my*fully
    if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
        return true
    else
        return false
    end
end

Za pomoc oczywiscie nagrodze zimniutkim piwerkiem i R*

Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-14, 19:10


Mikołajj







Wiek: 23
Na forum: 3026 dni
Posty: 303
Nick w MP: Mikołaj

Piwa: 132

Respekt: 91

B??dy db3?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-14, 19:13


NoKill1997

Online






Wiek: 29
Na forum: 3365 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 783

Respekt: 80,5

@c Naprawilem ;)

Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Tagi: bramki
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