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

Wysłany: 2021-01-23, 19:46


NekeYT







Wiek: 23
Na forum: 2669 dni
Posty: 58
Nick w MP: Cytrus

Piwa: 6

Respekt: 50

tak jak w temacie mam jasn? po?wiat?
zdj

kod:

local screenW, screenH = guiGetScreenSize()
local marker=createMarker(1570.51, -1392.72, 14.02-1, "cylinder", 1.35, 255,255,255,0)
        setElementData(marker, "markery3", true)
local sphere=createColSphere(1560.52, -1392.68, 14.02-1, 5)

local wm={} 
wm.gridlist=guiCreateGridList(0.34, 0.39, 0.333, 0.24, true)
guiGridListAddColumn(wm.gridlist, "ID Pojazdu", 0.3)
guiGridListAddColumn(wm.gridlist, "Model", 0.3) 
guiGridListAddColumn(wm.gridlist, "Kierowca", 0.3)
guiSetVisible(wm.gridlist, false)

panel = false

function PrzechoGUI()
local Alpha, Alpha2 = interpolateBetween(0, 0, 0, 255, 180, 0, ((getTickCount() - czas) / 2500), "Linear") 
local r2,g2,b2=interpolateBetween(255,255,255,20,250,0,(getTickCount()-czas)/1100,"SineCurve")
local r,g,b=interpolateBetween(255,255,255,255,0,0,(getTickCount()-czas)/1100,"SineCurve") 
dxDrawImage(screenW * 0.3016, screenH * 0.2786, screenW * 0.4092, screenH * 0.4805, "okn.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
if not cursorPosition(screenW * 0.3367, screenH * 0.6406, screenW * 0.1054, screenH * 0.0469) then --Wyjmij
dxDrawImage(screenW * 0.3053, screenH * 0.5768, screenW * 0.1794, screenH * 0.1693, "przycisk.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Wyjmij pojazd", (screenW * 0.3382) + 1, (screenH * 0.6419) + 1, (screenW * 0.4422) + 1, (screenH * 0.6875) + 1, tocolor(255, 255, 255, Alpha), 1.0, "normalFont", "center", "center", false, false, false, false, false)
  
else 
dxDrawImage(screenW * 0.3053, screenH * 0.5768, screenW * 0.1794, screenH * 0.1693, "przycisk.png", 0, 0, 0, tocolor(255,255,255, 255), false)
dxDrawText("Wyjmij pojazd", (screenW * 0.3382) + 1, (screenH * 0.6419) + 1, (screenW * 0.4422) + 1, (screenH * 0.6875) + 1, tocolor(180, 180, 180, 255), 1.00, "normalFont", "center", "center", false, false, false, false, false)
  
end 

if not cursorPosition(screenW * 0.5688, screenH * 0.6432, screenW * 0.1054, screenH * 0.0469) then --Wyjmij
dxDrawImage(screenW * 0.5351, screenH * 0.5768, screenW * 0.1794, screenH * 0.1693, "przycisk.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Zamknij okno", (screenW * 0.5688) + 1, (screenH * 0.6432) + 1, (screenW * 0.6728) + 1, (screenH * 0.6888) + 1, tocolor(255, 255, 255, Alpha), 1.00, "normalFont", "center", "center", false, false, false, false, false)
else 
dxDrawImage(screenW * 0.5351, screenH * 0.5768, screenW * 0.1794, screenH * 0.1693, "przycisk.png", 0, 0, 0, tocolor(255,255,255, 255), false)
dxDrawText("Zamknij okno", (screenW * 0.5688) + 1, (screenH * 0.6432) + 1, (screenW * 0.6728) + 1, (screenH * 0.6888) + 1, tocolor(180, 180, 180, 255), 1.00, "normalFont", "center", "center", false, false, false, false, false)
end 

dxDrawText("Przechowalnia Pojazd?w!", (screenW * 0.3375) + 1, (screenH * 0.3503) + 1, (screenW * 0.6728) + 1, (screenH * 0.3893) + 1, tocolor(0, 0, 0, Alpha), 1.50, "normalFont", "center", "center", false, false, false, false, false)
dxDrawText("Przechowalnia Pojazd?w!", screenW * 0.3375, screenH * 0.3503, screenW * 0.6728, screenH * 0.3893, tocolor(255,255,255, Alpha), 1.50, "normalFont", "center", "center", false, false, false, false, false)
       
end

addEvent("onParkingGetVehicles", true)
addEventHandler("onParkingGetVehicles", root, function(result)
    guiGridListClear(wm.gridlist)
    if not result then return end
    for i,v in pairs(result) do
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlist, row, 1, v["id"], false, false)
        guiGridListSetItemText(wm.gridlist, row, 2, getVehicleNameFromModel(v["model"]), false, false)
        guiGridListSetItemText(wm.gridlist, row, 3, v["driver"]:gsub("#%x%x%x%x%x%x",""), false, false)
    end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(el) then return end
    if guiGetVisible(wm.gridlist) == false then
                if panel == false then
                  addEventHandler("onClientRender",root,PrzechoGUI)
                  czas = getTickCount()
        panel = true
        showCursor(true)
        guiSetVisible(wm.gridlist,true)
        triggerServerEvent("onParkingGetRekords", localPlayer)
        --etCameraMatrix(-2056.26, 468.77, 38.49, -2048.08, 467.73, 35.17)
    end
       end
end)

function Przechowyjmij(button, state)
if panel and button == "left" and state == "down" then
           if cursorPosition(screenW * 0.3367, screenH * 0.6406, screenW * 0.1054, screenH * 0.0469) then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow < 0 then return end
                        local vehicles=getElementsWithinColShape(sphere,"vehicle")
        if #vehicles > 0 then
                                                 outputChatBox("* Nie ma miejsca aby wyciagnac pojazd!", 255, 0, 0)
            return
        end
        local id=guiGridListGetItemText(wm.gridlist, selectedRow, 1)
        guiGridListRemoveRow(wm.gridlist, selectedRow)
        triggerServerEvent("onParkingVehicleSpawn", localPlayer, tonumber(id))
    end
   end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)

function Zamknij(button, state)
    if panel and button == "left" and state == "down" then
           if cursorPosition(screenW * 0.5688, screenH * 0.6432, screenW * 0.1054, screenH * 0.0469) then
                panel = false 
                removeEventHandler ("onClientRender", root, PrzechoGUI)
                showCursor(false)
                guiSetVisible(wm.gridlist, false)
         end
    end
end
addEventHandler("onClientClick", getRootElement(), Zamknij)

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

function filedelet ()
if fileExists("c_parking.lua") then
   fileDelete("c_parking.lua")
 end
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), filedelet)
addEventHandler("onClientPlayerQuit", getRootElement(), filedelet)
addEventHandler("onClientPlayerJoin", getRootElement(), filedelet)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-23, 21:58


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

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

Wydaje mi si?, ?e to mo?e by? wina grafiki, na pewno tej po?wiaty nie masz w grafice?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 00:11


NekeYT







Wiek: 23
Na forum: 2669 dni
Posty: 58
Nick w MP: Cytrus

Piwa: 6

Respekt: 50

"satan_" napisał/a:

Wydaje mi si?, ?e to mo?e by? wina grafiki, na pewno tej po?wiaty nie masz w grafice?

w grafice nie ma

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 00:58


dioR







Wiek: 21
Na forum: 2188 dni
Posty: 18
Nick w MP: dioR

Piwa: 753

Respekt: 50

usun to z kodu
--etCameraMatrix(-2056.26, 468.77, 38.49, -2048.08, 467.73, 35.17)
i sprawdz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 01:01


MrVip615

witam






Wiek: 22
Na forum: 4448 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3

"dioR" napisał/a:

usun to z kodu
--etCameraMatrix(-2056.26, 468.77, 38.49, -2048.08, 467.73, 35.17)
i sprawdz


Co to ma zmienic? To jest w komentarzu i do tego funkcja setCameraMatrix nie ma nic wspolnego z tym, co chce osiagnac autor.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 07:49


Mikołajj







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

Piwa: 132

Respekt: 91

Stw?rz texture tych obrazk?w i ustaw w niej parametry 'argb', true i edge na 'clamp'

Postaw piwo autorowi tego posta
 

 
Tagi: poświata :: 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 Odpowiedz do tematu

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