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

Wysłany: 2015-09-04, 21:32


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Siema. Kolejny i (mam nadziej?) ostatni problem. A raczej 2.

1. Jak kto? wjedzie w marker pokazuj?cy GUI to ka?demu si? pokazuje
2. Nie dzia?aj? markery na usuni?cie opisu

Kod:

local sw,sh guiGetScreenSize()
local gieldaMarker createMarker994.17,2205.20,10.41"cylinder" ,525111,25,25 )
local strefa createColSphere 929.294555664062204.3554687512.280563354492 54.52)

local usuniecie_opisu = {
{929.294555664062204.3554687511.58056335449},
{994.18,2200.49,10.42},
}
for kv in ipairs (usuniecie_opisu) do
      local cuboid123 createMarker v[1], v[2], v[3], "cylinder"32552550100)
end
addCommandHandler"vopisusun",
  function ( el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(el)
    if not veh then return end
    setElementData(veh,"pojazd_opis",false)
  end
)

buttonWystaw guiCreateButton(1142/1440*sw479/900*sh264/1440*sw94/900*sh"Wstaw Cene!"false)

editWystaw guiCreateEdit(1137/1440*sw383/900*sh278/1440*sw64/900*sh""false)    

guiSetVisible(buttonWystawfalse)
guiSetVisible(editWystawfalse)

function dxPokaz()

        dxDrawRectangle(1124/1440*sw284/900*sh306/1440*sw311/900*shtocolor(000198), false)
        dxDrawRectangle(1112/1440*sw256/900*sh328/1440*sw28/900*shtocolor(163730207), false)
        dxDrawText("Black Life[PL]"1111/1440*sw254/900*sh1440/1440*sw284/900*shtocolor(255255255255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1127/1440*sw284/900*sh1427/1440*sw377/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1127/1440*sw282/900*sh1427/1440*sw375/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1125/1440*sw284/900*sh1425/1440*sw377/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1125/1440*sw282/900*sh1425/1440*sw375/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1126/1440*sw283/900*sh1426/1440*sw376/900*shtocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
end


addEventHandler("onClientMarkerLeave"gieldaMarker, function(elmd)
    if guiGetVisible(buttonWystaw) == true then
        guiSetVisible(buttonWystawfalse)
        guiSetVisible(editWystawfalse)
        showCursor(false)
        removeEventHandler('onClientRender'rootdxPokaz)
    end
end)

addEventHandler('onClientMarkerHit'gieldaMarker, function(hitElementmatchingDimension)
    if hitElement == localPlayer then
            local pojazdy getElementsWithinColShape(strefa,"vehicle")
            if #pojazdy>40 then
                outputChatBox("Na gie?dzie jest 40 Aut. Poczekaj a? si? zwoli miejsce")
                return
            end
            guiSetVisible(buttonWystawtrue)
            guiSetVisible(editWystawtrue)
            showCursor(truefalse)
            addEventHandler("onClientRender"rootdxPokaz)
    end
end)

function wystaw( )
    local cenaPobierz guiGetText editWystaw )
    local cena tonumber(cenaPobierz)
    local pojazd getPedOccupiedVehicle(localPlayer)
    local car getVehicleName(pojazd)
    local owner getElementData(pojazd"car_owner")
    local id getElementData(pojazd"car_id")
    local przebiegg getElementData(pojazd"pojazd_przebieg")
    local przebieg math.floor(przebiegg)
    if cena >500 then
    --triggerServerEvent "wystawEvent"resourceRootpojazdcenawlascicielidprzebieg )
    setElementData(pojazd,"pojazd_opis","------------------\nPojazd: "..car.."\nCena: "..cena.."ZL\nPrzebieg: "..przebieg.."km\nSprzedaj?cy: "..owner.."\nID Pojazdu: "..id.."\n------------------" )
    --"Cena: "..cena.."$\nPrzebieg: "..przebieg.."km\nSprzedaj?cy: "..owner.."\nID Pojazdu: "..id.."" )
    else --jesli cena to nie 750
    outputChatBox("* Cena minimalna wynosi 500 PLN!")
end
end
addEventHandler "onClientGUIClick"buttonWystaw wystaw )

--33
addEventHandler('onClientMarkerHit'cuboid123, function(el,md)
    if not md or el ~= localPlayer then return end
    if wstep then return end
    wstep=true
end)

addEventHandler("onClientMarkerHit"cuboid123, function(el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(el)
    if not veh then return end
    setElementData(veh,"pojazd_opis",false)
end)


Za pomoc dam :piwo: i R* :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-04, 22:06


Kurczak23







Wiek: 32
Na forum: 5032 dni
Posty: 30

Piwa: 499

Respekt: 115,3
Respekt: 115,3


--[[
ZMIANY JAKIE ZROBI?EM TO WYWALENIE NIE POTRZEBNYCH RZECZY (JAKIES MARKERY oraz np PRZEBIEGG w funkcji wystaw) , PRZEROBIENIE ICH (dziwna komenda vopisusunORAZ DODANIE OPTYMALIZACJI DLA KODU PATRZ FUNKCJA dxPokaz
DODALEM USUNIECIE NAPISU
]]--

--- Ustawienia

local sw,sh guiGetScreenSize()
local gieldaMarker createMarker994.17,2205.20,10.41"cylinder" ,525111,25,25 )
local strefa createColSphere 929.294555664062204.3554687512.280563354492 54.52)

addEventHandler("onResourceStart"root, function()
buttonWystaw guiCreateButton(1142/1440*sw479/900*sh264/1440*sw94/900*sh"Wstaw Cene!"false)

editWystaw guiCreateEdit(1137/1440*sw383/900*sh278/1440*sw64/900*sh""false)    

guiSetVisible(buttonWystawfalse)
guiSetVisible(editWystawfalse)
end)
--- END


function dxPokaz()
        --dxSetAspectRatioAdjustmentEnabledtrue ) --OD BEZPIECZ TO JEZELI CHCESZ BY TWOJ KOD BYL ZGODNY Z WSZYSTKIMI ROZDZIELCZOSCIAMI
        dxDrawRectangle(1124/1440*sw284/900*sh306/1440*sw311/900*shtocolor(000198), false)
        dxDrawRectangle(1112/1440*sw256/900*sh328/1440*sw28/900*shtocolor(163730207), false)
        dxDrawText("Black Life[PL]"1111/1440*sw254/900*sh1440/1440*sw284/900*shtocolor(255255255255), 1.00"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1127/1440*sw284/900*sh1427/1440*sw377/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1127/1440*sw282/900*sh1427/1440*sw375/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1125/1440*sw284/900*sh1425/1440*sw377/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1125/1440*sw282/900*sh1425/1440*sw375/900*shtocolor(000255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
        dxDrawText("Wpisz cen? auta jaka ci? interesuje\n(Minimum 500$)"1126/1440*sw283/900*sh1426/1440*sw376/900*shtocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsetruefalse)
end


addEventHandler("onClientMarkerLeave"gieldaMarker, function(elmd)
    if el ~= localPlayer then return end
    guiSetVisible(buttonWystawfalse)
    guiSetVisible(editWystawfalse)
    showCursor(false)
    removeEventHandler("onClientRender"localPlayerdxPokaz)
end)

addEventHandler('onClientMarkerHit'gieldaMarker, function(hitElementmatchingDimension)
    if hitElement ~= localPlayer then return end
        local pojazdy getElementsWithinColShape(strefa,"vehicle")
        if #pojazdy>40 then
            outputChatBox("Na gie?dzie jest 40 Aut. Poczekaj a? si? zwoli miejsce")
            return
        end
        guiSetVisible(buttonWystawtrue)
        guiSetVisible(editWystawtrue)
        showCursor(truefalse)
        addEventHandler("onClientRender"localPlayerdxPokaz)
end)

function wystaw( )
    local cenaPobierz guiGetText editWystaw )
    local cena tonumber(cenaPobierz)
    local pojazd getPedOccupiedVehicle(localPlayer)
    local car getVehicleName(pojazd)
    local owner getElementData(pojazd"car_owner")
    local id getElementData(pojazd"car_id")
    local przebieg math.floor(getElementData(pojazd"pojazd_przebieg"))
    if cena >500 then
    --triggerServerEvent "wystawEvent"resourceRootpojazdcenawlascicielidprzebieg )
    setElementData(pojazd,"pojazd_opis","------------------\nPojazd: "..car.."\nCena: "..cena.."ZL\nPrzebieg: "..przebieg.."km\nSprzedaj?cy: "..owner.."\nID Pojazdu: "..id.."\n------------------" )
    setElementData(pojazd,"pojazd_gielda"true)
    --"Cena: "..cena.."$\nPrzebieg: "..przebieg.."km\nSprzedaj?cy: "..owner.."\nID Pojazdu: "..id.."" )
    else --jesli cena to nie 750
    outputChatBox("* Cena minimalna wynosi 500 PLN!")
end
end
addEventHandler "onClientGUIClick"buttonWystaw wystaw )

addEventHandler("onClientColShapeLeave"strefa, function(el,md)
    if not md or el ~= localPlayer then return end
    local veh=getPedOccupiedVehicle(el)
    if not veh then return end
    if getElementData(veh"pojazd_gielda"then setElementData(veh"pojazd_opis"false); setElementData(veh,"pojazd_gielda"false) return end
end)

addCommandHandler"vopisusun",function(cmd,_)
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then outputChatBox("* Najpierw musisz byc w pojezdzie") return end
    setElementData(veh,"pojazd_opis",false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-05, 10:39


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
1. :32: Bad Argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil]
2. W?a?nie nie pokazuje si? to gui
3. A gdzie s? te markery na usuni?cie opisu??

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-05, 13:09


Kurczak23







Wiek: 32
Na forum: 5032 dni
Posty: 30

Piwa: 499

Respekt: 115,3
Respekt: 115,3

Wybacz moje b??dy jak masz onresourcestart zamien na onClientResourceStart
oraz przy addeventhandler z dxpokaz tam masz localPlayer mozesz sobie zamienic na root

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-05, 15:02


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"Kurczak23" napisał/a:


oraz przy addeventhandler z dxpokaz tam masz localPlayer mozesz sobie zamienic na root


A to gdzie jest? :-?

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Tagi: giełda
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