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

Wysłany: 2020-03-03, 19:12


Pyrek24







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

Piwa: 10

Respekt: 50

Witam ot?? mam problem, chcia?em zrobi? texture kamienia, ?e jak klikniemy raz wy-renderuje nam zniszczony kamie? w postaci nowego obrazu, drugi raz jeszcze bardziej zniszczony itd.
tak pr?bowa?em

                if  target[0] then
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000,"nowy.png")
                elseif target[1] then        
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000,"nowy.png")                
                elseif target[2] then        
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000,"sredni.png")                
                elseif target[3] then            
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000,"max.png")                
                end    


local mousePoints = {
{screenW * 0.3932, screenH * 0.4787, screenW * 0.0323, screenH * 0.0509},
{screenW * 0.4516, screenH * 0.5213, screenW * 0.0323, screenH * 0.0509},
{screenW * 0.5495, screenH * 0.5528, screenW * 0.0323, screenH * 0.0509},
{screenW * 0.5969, screenH * 0.5065, screenW * 0.0198, screenH * 0.0296},
}
target=0
addEventHandler("onClientMarkerHit", startPracy, function(h)
    if h ~= localPlayer then return end
    if isPedInVehicle(localPlayer) then return end    
    setElementData(localPlayer, "praca:kopalnia:gui", true)
    showCursor(true)
end)

function isMouseIn ( x, y, width, height )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sx, sy = guiGetScreenSize ( )
    local cx, cy = getCursorPosition ( )
    local cx, cy = ( cx * sx ), ( cy * sy )
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        return true
    else
        return false
    end
end

setElementData(localPlayer, "kopalnia:zakonczono", false)

function tworzenieMarkera()
    rnd = math.random(1, #punktykopalnia)
    markerRandomowy = createMarker(punktykopalnia[rnd][1], punktykopalnia[rnd][2], punktykopalnia[rnd][3], 'cylinder', 1.5)
    blipRandomowy = createBlipAttachedTo(markerRandomowy, 41)    
end

        function onRandom(h)
        if h ~= localPlayer then return end
        if isPedInVehicle(localPlayer) then return end
            target = target+1
            setElementData(localPlayer, "kopalnia:zakonczono", false)
                setPedAnimation(localPlayer, "BASEBALL", "Bat_4", 1000, false, false ,false, false, 250, false)                    
            addEventHandler("onClientRender", root, function()
                if getElementData(localPlayer, "kopalnia:zakonczono") then return end            
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000,"nowy.png")
                dxDrawImage(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4],"kolo.png")
            end)
            showCursor(true)
            destroyElement(source)
            destroyElement(blipRandomowy)
        end

Za pomoc zimne piwko i +rep

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-03, 19:17


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

?le sprawdzasz zmienn? target. R?b tak:
if target == 1 then

Oczywi?cie tak samo z reszt?.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2020-03-06, 15:28


Pyrek24







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

Piwa: 10

Respekt: 50

dzk temat do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: podmienianie :: obrazó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 » Podmienianie obrazów dx 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