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

Wysłany: 2019-04-21, 20:34


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? mam niedzia?aj?ce przyciski, gui si? wy?wietla lecz przycisk nie dzia?a
kod
local screenW, screenH = guiGetScreenSize()

local marker=createMarker(-1811.35, 1195.68, -27.95-0.955, "cylinder", 1, 255, 80, 0)
setElementDimension(marker, 1)
setElementInterior(marker, 1)

local t=createElement("text")
setElementPosition(t,-1811.35, 1195.68, -27.95+1.5)
setElementData(t,"name","Przepisywanie pojazd?w\nna organizacj?")
setElementDimension(t, 1)
setElementInterior(t, 1)

przepisywanie = false

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local wm={}
wm.gridlist=guiCreateGridList(0.28, 0.37, 0.45, 0.22, true)
guiGridListAddColumn(wm.gridlist, "ID", 0.3)
guiGridListAddColumn(wm.gridlist, "Nazwa", 0.3)
guiGridListAddColumn(wm.gridlist, "Organizacja", 0.3)
guiSetVisible(wm.gridlist, false)
guiSetAlpha(wm.gridlist, 0.8)
guiSetFont(wm.gridlist, "default-bold-small")

addEventHandler("onClientClick", root, function(btn, state)
    if btn == "left" and state == "down" then
    if przepisywanie == true then
    if mysz(screenW * 0.2792, screenH * 0.6037, screenW * 0.0818, screenH * 0.0370) then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
        if selectedRow < 0 then return end
        local id=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 1))
        local name=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 2))
        triggerServerEvent("org:check", resourceRoot, id, name)
        end
    end 
    if przepisywanie == true then
    if mysz(screenW * 0.6380, screenH * 0.6037, screenW * 0.0818, screenH * 0.0370) then
        if guiGetVisible(wm.gridlist) == true then
            showCursor(false)
            guiSetVisible(wm.gridlist, false)
            removeEventHandler("onClientRender", root, gui_przepisywanie)
            przepisywanie = false
        end
        end
        end
        end
end)



addEvent("org:refresh", true)
addEventHandler("org:refresh", resourceRoot, function(result)
    guiGridListClear(wm.gridlist)
    for i,v in pairs(result) do
        if string.len(v.plateText) < 1 then v.plateText="Brak" end
        local row=guiGridListAddRow(wm.gridlist)
        if tostring(v.ownedGroup) == "0" then v.ownedGroup = "Brak" end
        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.ownedGroup , false, false)
    end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
    if el~=localPlayer then return end
    if not getElementData(el,"player:organization") then outputChatBox("* Nie posiadasz organizacji !") return end
    if not guiGetVisible(wm.gridlist) then
        showCursor(true)
        guiSetVisible(wm.gridlist, true)
        if przepisywanie == false then
        addEventHandler("onClientRender", root, gui_przepisywanie)
        przepisywanie = true
        triggerServerEvent("org:download", resourceRoot, el)
    end
    end
end)



function gui_przepisywanie()
        dxDrawLine((screenW * 0.2708) - 1, (screenH * 0.3657) - 1, (screenW * 0.2708) - 1, screenH * 0.6500, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7302, (screenH * 0.3657) - 1, (screenW * 0.2708) - 1, (screenH * 0.3657) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine((screenW * 0.2708) - 1, screenH * 0.6500, screenW * 0.7302, screenH * 0.6500, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7302, screenH * 0.6500, screenW * 0.7302, (screenH * 0.3657) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.2708, screenH * 0.3657, screenW * 0.4594, screenH * 0.2843, tocolor(0, 0, 0, 210), false)
        dxDrawLine((screenW * 0.2766) - 1, (screenH * 0.3731) - 1, (screenW * 0.2766) - 1, screenH * 0.5926, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7250, (screenH * 0.3731) - 1, (screenW * 0.2766) - 1, (screenH * 0.3731) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine((screenW * 0.2766) - 1, screenH * 0.5926, screenW * 0.7250, screenH * 0.5926, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7250, screenH * 0.5926, screenW * 0.7250, (screenH * 0.3731) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.2766, screenH * 0.3731, screenW * 0.4484, screenH * 0.2194, tocolor(1, 0, 0, 0), false)
        dxDrawLine((screenW * 0.2792) - 1, (screenH * 0.6037) - 1, (screenW * 0.2792) - 1, screenH * 0.6407, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.3609, (screenH * 0.6037) - 1, (screenW * 0.2792) - 1, (screenH * 0.6037) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine((screenW * 0.2792) - 1, screenH * 0.6407, screenW * 0.3609, screenH * 0.6407, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.3609, screenH * 0.6407, screenW * 0.3609, (screenH * 0.6037) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.2792, screenH * 0.6037, screenW * 0.0818, screenH * 0.0370, tocolor(0, 0, 0, 255), false)
        dxDrawLine((screenW * 0.6380) - 1, (screenH * 0.6037) - 1, (screenW * 0.6380) - 1, screenH * 0.6407, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7198, (screenH * 0.6037) - 1, (screenW * 0.6380) - 1, (screenH * 0.6037) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine((screenW * 0.6380) - 1, screenH * 0.6407, screenW * 0.7198, screenH * 0.6407, tocolor(255, 55, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7198, screenH * 0.6407, screenW * 0.7198, (screenH * 0.6037) - 1, tocolor(255, 55, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.6380, screenH * 0.6037, screenW * 0.0818, screenH * 0.0370, tocolor(0, 0, 0, 255), false)
        dxDrawText("Przepisz", (screenW * 0.2786) - 1, (screenH * 0.6028) - 1, (screenW * 0.3609) - 1, (screenH * 0.6407) - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Przepisz", (screenW * 0.2786) + 1, (screenH * 0.6028) - 1, (screenW * 0.3609) + 1, (screenH * 0.6407) - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Przepisz", (screenW * 0.2786) - 1, (screenH * 0.6028) + 1, (screenW * 0.3609) - 1, (screenH * 0.6407) + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Przepisz", (screenW * 0.2786) + 1, (screenH * 0.6028) + 1, (screenW * 0.3609) + 1, (screenH * 0.6407) + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Przepisz", screenW * 0.2786, screenH * 0.6028, screenW * 0.3609, screenH * 0.6407, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij", (screenW * 0.6380) - 1, (screenH * 0.6028) - 1, (screenW * 0.7203) - 1, (screenH * 0.6407) - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij", (screenW * 0.6380) + 1, (screenH * 0.6028) - 1, (screenW * 0.7203) + 1, (screenH * 0.6407) - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij", (screenW * 0.6380) - 1, (screenH * 0.6028) + 1, (screenW * 0.7203) - 1, (screenH * 0.6407) + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij", (screenW * 0.6380) + 1, (screenH * 0.6028) + 1, (screenW * 0.7203) + 1, (screenH * 0.6407) + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij", screenW * 0.6380, screenH * 0.6028, screenW * 0.7203, screenH * 0.6407, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?", 763 - 1, 353 - 1, 1141 - 1, 393 - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?", 763 + 1, 353 - 1, 1141 + 1, 393 - 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?", 763 - 1, 353 + 1, 1141 - 1, 393 + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?", 763 + 1, 353 + 1, 1141 + 1, 393 + 1, tocolor(255, 55, 0, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
end


DB3
https://imgur.com/Z9mrZiR

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-21, 20:52


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Popraw funkcj?:

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*psx,cy*psy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-04-21, 20:59


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Teraz nie dzia?aj? przyciski
b??dy
DB3
https://imgur.com/evGTcM5

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-21, 21:25


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jeste? pewny, ?e koordynaty dobre u?y?e??

Wyczy?? debug (chyba /cleardebug) i wtedy spr?buj klikn??, dopiero wtedy zr?b screenshota.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-21, 22:13


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Mordko tutaj b?ad zobacz w DB3
https://imgur.com/IaSRq7P

[ Dodano: 2019-04-22, 14:26 ]
Taki b??d w DB3
Kod:

ogrpg-offices\organization\c_org.lua'is not encoded in UTF-8. Loading as ANSI...


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-22, 21:26


adaskOO

Ten który patrzy






Wiek: 24
Na forum: 3873 dni
Posty: 249
Nick w MP: adaskOO

Piwa: 3172

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

Pyrek24, ustaw w np. notepadzie++ kodowanie na UTF-8, i sprawd? rezultaty.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-04-22, 22:14


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Dzk temat do zamkniecia.

Postaw piwo autorowi tego posta
 

 
Tagi: niedziałające :: przyciski
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