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

Wysłany: 2019-05-13, 21:41


AsterBonzo

Otwórz ogień






Wiek: 19
Na forum: 2465 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Witam tak jak w temacie mam pytanie jak zmieni? animacje markera skryptu z own world ?

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-13, 21:43


Wilq







Wiek: 22
Na forum: 3926 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wy?lij kod marker?w, jakie posiadasz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-14, 15:41


AsterBonzo

Otwórz ogień






Wiek: 19
Na forum: 2465 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Posiadam srkypt edytowany z own worlda ( z tego co wiem )


local strzalka dxCreateTexture("strzalka.png")
local marker dxCreateTexture("marker.png")
local tick getTickCount()
rot 0

function getDistance(element)
    local x1,y1,z1 getElementPosition(element)
    local x2,y2,z2 getElementPosition(localPlayer)
    local distance getDistanceBetweenPoints3D(x1y1z1x2y2z2)
    if tonumber(distancethen
        return tonumber(distance)
    end
    return false
end

function dxDrawTextElement(elementtext)
    if not getElementData(localPlayer"player:logged"then return end
    if isPlayerMapVisible() then return end
    local xygetElementPosition(element)
    = (z+1.3)-math.sin(getTickCount()/500)*0.07
    local distance getDistance(element)
    local sx,sy getScreenFromWorldPosition(xyz)
    local rootx,rooty,rootz getCameraMatrix()
    if ~= and ~= and ~= and sx and sy and distance 10 and isLineOfSightClear(rootx,rooty,rootz,x,y,z,false,false,falsethen
    end
end

function dxDrawImageElement(element)
    local xygetElementPosition(element)
    local size getMarkerSize(element)
    local r,g,255,255,0
    local distance 1.3
    if size >= 3 then
        distance 1.4
    end
    z z+distance
    dxDrawMaterialLine3D(xyz+1xyzstrzalka1tocolor(rgb)) 
end

addEventHandler("onClientRender"root, function()
    for i,v in ipairs(getElementsByType("marker")) do
        if getMarkerType(v) == "cylinder" and getElementDimension(v) == getElementDimension(localPlayer) and getElementInterior(v) == getElementInterior(localPlayer)  then
            if getElementAlpha(v) ~= 0 then
                setElementAlpha(v0)
            end
            local x,y,getElementPosition(v)
            if ~= and ~= and ~= 0 then
                z z+0.05
                local size getMarkerSize(v)
                local text getElementData(v"text") or ""
                dxDrawTextElement(vtext)
                dxSetRenderTarget()
                dxDrawImageElement(v)
                local r,g,255,255,0
                a interpolateBetween(1300015000, (getTickCount()-tick)/2400"SineCurve")
                rot rot 0.0001
                rx,ry math.cos(rot) * size,  math.sin(rot) * size
                if not getElementData(v"selling"then
                    dxDrawMaterialLine3D(rxyryzrxyryzmarkersize*2tocolor(rgba), xyz+500000000)
                end
            end
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-14, 16:39


Wilq







Wiek: 22
Na forum: 3926 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Funkcja

Więcej informacji znajdziesz w Wikipedii MTA:

interpolateBetween

odpowiada za wykonywani animacji - w tym przypadku jest to przezroczysto?? obrazu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-14, 18:00


AsterBonzo

Otwórz ogień






Wiek: 19
Na forum: 2465 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Nie wiem jak to zrobi? nadal poka?esz kawa?ek kodu ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-14, 21:10


Wilq







Wiek: 22
Na forum: 3926 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Ten kod masz ju? u siebie, zobacz argument na wiki i por?wnaj z tym co masz w kodzie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-15, 15:58


AsterBonzo

Otwórz ogień






Wiek: 19
Na forum: 2465 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

ten kod ma tylko by zmienia? si? poziom widoczno?ci co pare sekund a ja chce ?eby m?g? si? kreci np jak na paradise i nie wiem jak to zrobi?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-15, 21:33


Wilq







Wiek: 22
Na forum: 3926 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Na logik?: zmieniasz przezroczysto?? na k?t rotacji i u?ywasz tego, wystarczy pokombinowa?. Pr?by mo?esz wykonywa? na lokalnym serwerze, te? nie jest to ?aden problem.

Mo?esz spr?bowa? u?y? wykonanej funkcji do animacji:

Więcej informacji znajdziesz w Wikipedii MTA:

animate


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-16, 14:01


AsterBonzo

Otwórz ogień






Wiek: 19
Na forum: 2465 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

jest dla mnie jeden problem nie wiem kt?re odpowiada za przezroczysto?? .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-16, 16:56


Wilq







Wiek: 22
Na forum: 3926 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Przezroczysto??:
czwarty argument funkcji

Więcej informacji znajdziesz w Wikipedii MTA:

tocolor


Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zmienić :: animacje :: markera
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak zmienić animacje markera 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