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

Wysłany: 2015-07-11, 12:55


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

To nie mam :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:02


piotr172







Wiek: 26
Na forum: 4417 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

To masz tutaj, wklej go do jakiego? pliku, mo?esz nawet nowy stworzy? po stronie clienta.


local sw,sh=guiGetScreenSize()

addEventHandler("onClientRender"getRootElement(), function()
    local rootxrootyrootz getCameraMatrix()
    
    for ivehicle in ipairs(getElementsByType("vehicle"roottrue)) do
        local pojazd_opis getElementData(vehicle"pojazd_opis")
        if (pojazd_opisthen
            local x,y,getElementPosition(vehicle)
            local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)
            if (distance<=50then
                local sxsy getScreenFromWorldPosition(x,y,z200)
                if (sx and sythen
                    dxDrawText(pojazd_opissx-(sw/5),sy,sx+(sw/5),sytocolor(255255255), 1"default-small""center""center"falsetrue)
                end
            end
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:23


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

piotr172, Panie jak to tera usun?? xD :)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:32


piotr172







Wiek: 26
Na forum: 4417 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Mozesz to zrobic na komende:


addCommandHandler("usun", function(plr)
    local veh=getPedOccupiedVehicle(plr)
    if (vehthen
removeElementData(veh,"pojazd_opis")
end
end)


Lub stworzy? niewidzialny marker przy wyje?dzie kt?ry to b?dzie usuwa? tak jak ja to zrobi?em.


local xy=guiGetScreenSize()

        window guiCreateWindow(220/800*x118/600*y339/800*x321"Gie?da pojazd?w."false)
        guiWindowSetSizable(windowfalse)

        label1 guiCreateLabel(10/800*x43/600*y56/800*x24/600*y"Cena:"falsewindow)
        edit1 guiCreateEdit(84/800*x42/600*y239/800*x31/600*y""falsewindow)
        button guiCreateButton(89/800*x140/600*y177/800*x39/600*y"Zatwierdz"falsewindow)
        button2 guiCreateButton(89/800*x190/600*y177/800*x39/600*y"Wyjdz"falsewindow)
        label3 guiCreateLabel(24/800*x217/600*y289/800*x86/600*y"Po wpisaniu ceny i zatwierdzeniu\nodstaw auto na jakie? wolne miejsce."falsewindow)
        guiLabelSetHorizontalAlign(label3"center"false)
        guiLabelSetVerticalAlign(label3"center")    
        guiSetVisible(windowfalse)
        
e_marker createMarker(xyz"cylinder"725500130)  -- marker GUIsprzedazy
l_marker createMarker(xyz"corona"1025500130) --  marker usuwania je?li chcesz aby byniewidoczny  zamiast 130 wpisz 0



addEventHandler("onClientMarkerHit"e_marker, function(el)
    local veh getPedOccupiedVehicle el )
if (veh and getVehicleController(veh)==elthen
if getElementData(veh,"sprzedaz") == false then
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
            guiSetVisible(windowtrue)
            showCursor(true)
end
end
end)

addEventHandler("onClientMarkerHit"l_marker, function(el)
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
    local veh getPedOccupiedVehicle el )
    if veh then
    if getElementData(veh,"sprzedaz") == true then
sElementData(veh,"pojazd_opis""")
sElementData(veh,"sprzedaz"false)
end
end
end)

addEventHandler("onClientMarkerLeave"e_marker, function(el)
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
    guiSetVisible(windowfalse)
    showCursor(false)
end)

function setDescription(btn)
   local veh getPedOccupiedVehicle localPlayer )
   local model getElementModel(veh)
   local nazwa=getVehicleNameFromModel(model)
   local id getElementData(veh,"car_id")
   local przebieg2 getElementData(veh,"pojazd_przebieg")
   local przebiegstring.format("%.02f",(przebieg2))
   local nick getPlayerName(localPlayer)
    if btn == "left" then
        local cena guiGetText(edit1)
            if not tonumber(cenathen return end
            if cena "999999" then return end
            if cena "0" then return end
            if veh then
            setElementData(veh,"pojazd_opis""Typ pojazdu:"..nazwa.."\n Numer pojazdu(id):"..id.."\n Przebieg pojazdu:"..przebieg.." \n Sprzedaj?cy:"..nick.."\n Cena:"..cena.."")
            setElementData(veh,"sprzedaz"true)
                guiSetVisible(windowfalse)
                showCursor(false)
end
end
end
addEventHandler("onClientGUIClick"buttonsetDescription)

function setDescription2()
                guiSetVisible(windowfalse)
                showCursor(false)
end
addEventHandler("onClientGUIClick"button2setDescription2)


Ostatnio zmieniony przez piotr172 2015-07-11, 13:38, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:35


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

piotr172, Czyli mam ca?y kod wklei? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:40


piotr172







Wiek: 26
Na forum: 4417 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Tak, tylko p??niej we? x,y,z w marker zmie?, ten niewidzialny ustaw przy wyje?dzie. i to 4n zamie? na \n

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:45


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Nie znika napis :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 13:52


piotr172







Wiek: 26
Na forum: 4417 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

OO b??d by? nie zauwa?y?em. Teraz powinno dzia?a?:


addEventHandler("onClientMarkerHit"l_marker, function(el)
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
    local veh getPedOccupiedVehicle el )
    if veh then
    if getElementData(veh,"sprzedaz") == true then
setElementData(veh,"pojazd_opis""")
setElementData(veh,"sprzedaz"false)
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 14:13


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

piotr172, teraz to w og?le nie dzia?a :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 14:20


piotr172







Wiek: 26
Na forum: 4417 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Masz tutaj ca?y kod, podmie? go:


local xy=guiGetScreenSize()

        window guiCreateWindow(220/800*x118/600*y339/800*x321"Gie?da pojazd?w."false)
        guiWindowSetSizable(windowfalse)

        label1 guiCreateLabel(10/800*x43/600*y56/800*x24/600*y"Cena:"falsewindow)
        edit1 guiCreateEdit(84/800*x42/600*y239/800*x31/600*y""falsewindow)
        button guiCreateButton(89/800*x140/600*y177/800*x39/600*y"Zatwierdz"falsewindow)
        button2 guiCreateButton(89/800*x190/600*y177/800*x39/600*y"Wyjdz"falsewindow)
        label3 guiCreateLabel(24/800*x217/600*y289/800*x86/600*y"Po wpisaniu ceny i zatwierdzeniu\nodstaw auto na jakie? wolne miejsce."falsewindow)
        guiLabelSetHorizontalAlign(label3"center"false)
        guiLabelSetVerticalAlign(label3"center")    
        guiSetVisible(windowfalse)
        
e_marker createMarker(1640.18945+2, -1139.36218+222.8"cylinder"725500130l_marker createMarker(1637.15454+0.5, -1147.35291-322.8"corona"1025500130addEventHandler("onClientMarkerHit"e_marker, function(el)
    local veh getPedOccupiedVehicle el )
if (veh and getVehicleController(veh)==elthen
if getElementData(veh,"sprzedaz") == false then
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
            guiSetVisible(windowtrue)
            showCursor(true)
end
end
end)

addEventHandler("onClientMarkerHit"l_marker, function(el)
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
    local veh getPedOccupiedVehicle el )
    if veh then
    if getElementData(veh,"sprzedaz") == true then
setElementData(veh,"pojazd_opis","")
setElementData(veh,"sprzedaz"false)
end
end
end)

addEventHandler("onClientMarkerLeave"e_marker, function(el)
    if not el then return end
    if not getPedOccupiedVehicle(elthen return end
    if el ~= getLocalPlayer() then return end
    guiSetVisible(windowfalse)
    showCursor(false)
end)

function setDescription(btn)
   local veh getPedOccupiedVehicle localPlayer )
   local model getElementModel(veh)
   local nazwa=getVehicleNameFromModel(model)
   local id getElementData(veh,"car_id")
   local przebieg2 getElementData(veh,"pojazd_przebieg")
   local przebiegstring.format("%.02f",(przebieg2))
   local nick getPlayerName(localPlayer)
    if btn == "left" then
        local cena guiGetText(edit1)
            if not tonumber(cenathen return end
            if cena "999999" then return end
            if cena "0" then return end
            if veh then
            setElementData(veh,"pojazd_opis""Typ pojazdu:"..nazwa.."\n Numer pojazdu(id):"..id.."\n Przebieg pojazdu:"..przebieg.." \n Sprzedaj?cy:"..nick.."\n Cena:"..cena.."")
            setElementData(veh,"sprzedaz"true)
                guiSetVisible(windowfalse)
                showCursor(false)
end
end
end
addEventHandler("onClientGUIClick"buttonsetDescription)

function setDescription2()
                guiSetVisible(windowfalse)
                showCursor(false)
end
addEventHandler("onClientGUIClick"button2setDescription2)


U mnie normlanie dzia?a. Podmien tylko kordy marker?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-11, 15:04


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

piotr172, ok, dzia?a Dzi?ki :)

Postaw piwo autorowi tego posta
 

 
Tagi: sprzedaż :: pojazdów
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » sprzedaż pojazdów 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