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: 25
Na forum: 3438 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 screenWscreenH guiGetScreenSize()

local marker=createMarker(-1811.351195.68, -27.95-0.955"cylinder"1255800)
setElementDimension(marker1)
setElementInterior(marker1)

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

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.280.370.450.22true)
guiGridListAddColumn(wm.gridlist"ID"0.3)
guiGridListAddColumn(wm.gridlist"Nazwa"0.3)
guiGridListAddColumn(wm.gridlist"Organizacja"0.3)
guiSetVisible(wm.gridlistfalse)
guiSetAlpha(wm.gridlist0.8)
guiSetFont(wm.gridlist"default-bold-small")

addEventHandler("onClientClick"root, function(btnstate)
    if btn == "left" and state == "down" then
    if przepisywanie == true then
    if mysz(screenW 0.2792screenH 0.6037screenW 0.0818screenH 0.0370then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
        if selectedRow 0 then return end
        local id=tostring(guiGridListGetItemText(wm.gridlistselectedRow1))
        local name=tostring(guiGridListGetItemText(wm.gridlistselectedRow2))
        triggerServerEvent("org:check"resourceRootidname)
        end
    end 
    if przepisywanie == true then
    if mysz(screenW 0.6380screenH 0.6037screenW 0.0818screenH 0.0370then
        if guiGetVisible(wm.gridlist) == true then
            showCursor(false)
            guiSetVisible(wm.gridlistfalse)
            removeEventHandler("onClientRender"rootgui_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.gridlistrow1v.idfalsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v.model), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v.ownedGroup falsefalse)
    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.gridlistthen
        showCursor(true)
        guiSetVisible(wm.gridlisttrue)
        if przepisywanie == false then
        addEventHandler("onClientRender"rootgui_przepisywanie)
        przepisywanie true
        triggerServerEvent("org:download"resourceRootel)
    end
    end
end)



function gui_przepisywanie()
        dxDrawLine((screenW 0.2708) - 1, (screenH 0.3657) - 1, (screenW 0.2708) - 1screenH 0.6500tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7302, (screenH 0.3657) - 1, (screenW 0.2708) - 1, (screenH 0.3657) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.2708) - 1screenH 0.6500screenW 0.7302screenH 0.6500tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7302screenH 0.6500screenW 0.7302, (screenH 0.3657) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.2708screenH 0.3657screenW 0.4594screenH 0.2843tocolor(000210), false)
        dxDrawLine((screenW 0.2766) - 1, (screenH 0.3731) - 1, (screenW 0.2766) - 1screenH 0.5926tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7250, (screenH 0.3731) - 1, (screenW 0.2766) - 1, (screenH 0.3731) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.2766) - 1screenH 0.5926screenW 0.7250screenH 0.5926tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7250screenH 0.5926screenW 0.7250, (screenH 0.3731) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.2766screenH 0.3731screenW 0.4484screenH 0.2194tocolor(1000), false)
        dxDrawLine((screenW 0.2792) - 1, (screenH 0.6037) - 1, (screenW 0.2792) - 1screenH 0.6407tocolor(255550255), 1false)
        dxDrawLine(screenW 0.3609, (screenH 0.6037) - 1, (screenW 0.2792) - 1, (screenH 0.6037) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.2792) - 1screenH 0.6407screenW 0.3609screenH 0.6407tocolor(255550255), 1false)
        dxDrawLine(screenW 0.3609screenH 0.6407screenW 0.3609, (screenH 0.6037) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.2792screenH 0.6037screenW 0.0818screenH 0.0370tocolor(000255), false)
        dxDrawLine((screenW 0.6380) - 1, (screenH 0.6037) - 1, (screenW 0.6380) - 1screenH 0.6407tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7198, (screenH 0.6037) - 1, (screenW 0.6380) - 1, (screenH 0.6037) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.6380) - 1screenH 0.6407screenW 0.7198screenH 0.6407tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7198screenH 0.6407screenW 0.7198, (screenH 0.6037) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.6380screenH 0.6037screenW 0.0818screenH 0.0370tocolor(000255), false)
        dxDrawText("Przepisz", (screenW 0.2786) - 1, (screenH 0.6028) - 1, (screenW 0.3609) - 1, (screenH 0.6407) - 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Przepisz", (screenW 0.2786) + 1, (screenH 0.6028) - 1, (screenW 0.3609) + 1, (screenH 0.6407) - 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Przepisz", (screenW 0.2786) - 1, (screenH 0.6028) + 1, (screenW 0.3609) - 1, (screenH 0.6407) + 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Przepisz", (screenW 0.2786) + 1, (screenH 0.6028) + 1, (screenW 0.3609) + 1, (screenH 0.6407) + 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Przepisz"screenW 0.2786screenH 0.6028screenW 0.3609screenH 0.6407tocolor(000255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij", (screenW 0.6380) - 1, (screenH 0.6028) - 1, (screenW 0.7203) - 1, (screenH 0.6407) - 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij", (screenW 0.6380) + 1, (screenH 0.6028) - 1, (screenW 0.7203) + 1, (screenH 0.6407) - 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij", (screenW 0.6380) - 1, (screenH 0.6028) + 1, (screenW 0.7203) - 1, (screenH 0.6407) + 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij", (screenW 0.6380) + 1, (screenH 0.6028) + 1, (screenW 0.7203) + 1, (screenH 0.6407) + 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij"screenW 0.6380screenH 0.6028screenW 0.7203screenH 0.6407tocolor(000255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?"763 1353 11141 1393 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?"763 1353 11141 1393 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?"763 1353 11141 1393 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Panel Przepisywania Pojazd?w Na Organizacj?"763 1353 11141 1393 1tocolor(255550255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
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: 4428 dni
Posty: 3410

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: 25
Na forum: 3438 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: 4428 dni
Posty: 3410

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: 25
Na forum: 3438 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: 3732 dni
Posty: 249
Nick w MP: adaskOO

Piwa: 3168

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: 25
Na forum: 3438 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 » Niedziałające przyciski 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