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

Wysłany: 2017-11-13, 19:12


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Witajcie! Jak zrobi? tutaj aby animacja wykonywa?a si? za ka?dym w??czeniem (kikni?ciem L) Jak narazie wykonuje si? animacja lecz po wykonaniu jej trzeba zresetowa? skrypt aby znowu by?a

local startTicking getTickCount()
local pokatel false
function pokaz_telefon()
    dxDrawRectangle(screenW 0.4107screenH 0.2829 interpolateBetween(35500000, (getTickCount()-startTicking)/10000"Linear")    , screenW 0.1786screenH 0.4352tocolor(000200), false)
end

function pokaTeL()
    local wysun interpolateBetween(35500000, (getTickCount()-startTicking)/10000"Linear")    
    
    if not getElementData(localPlayer"user:telefon"then return end
    if getElementData(localPlayer"user:telefon"then
    if pokatel == false then
        addEventHandler("onClientRender"rootpokaz_telefon)
        pokatel true
    else
        removeEventHandler("onClientRender"rootpokaz_telefon)
        pokatel false
    end
 end
end
 bindKey ("l""down"pokaTeL)


Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-13, 19:31


mistereq







Wiek: 22
Na forum: 3386 dni
Posty: 28
Nick w MP: MisterPL/Mistereq

Piwa: 288

Respekt: 45,3

Kod:


local startTicking = getTickCount()
local pokatel = false
function pokaz_telefon()
dxDrawRectangle(screenW * 0.4107, screenH * 0.2829 + interpolateBetween(x, 0, 0, x2, 0, 0, (getTickCount()-startTicking)/10000, "Linear") , screenW * 0.1786, screenH * 0.4352, tocolor(0, 0, 0, 200), false)
end

function pokaTeL()
x=355
x2=0
local wysun = interpolateBetween(355, 0, 0, 0, 0, 0, (getTickCount()-startTicking)/10000, "Linear")

if not getElementData(localPlayer, "user:telefon") then return end
if getElementData(localPlayer, "user:telefon") then
if pokatel == false then
addEventHandler("onClientRender", root, pokaz_telefon)
pokatel = true
else
removeEventHandler("onClientRender", root, pokaz_telefon)
pokatel = false
end
end
end
bindKey ("l", "down", pokaTeL)

powinno dzialac

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-13, 20:01


neku^







Wiek: 24
Na forum: 3522 dni
Posty: 461
Nick w MP: neku^

Piwa: 1186

Respekt: 320,5
Respekt: 320,5Respekt: 320,5Respekt: 320,5

mistereq, plz nie wypowiadaj si?, jak nie wiesz.


local startTicking getTickCount()
local pokatel false
function pokaz_telefon()
    dxDrawRectangle(screenW 0.4107screenH 0.2829 interpolateBetween(35500000, (getTickCount()-startTicking)/10000"Linear")    , screenW 0.1786screenH 0.4352tocolor(000200), false)
end

function pokaTeL()
    local wysun interpolateBetween(35500000, (getTickCount()-startTicking)/10000"Linear")    
    
    if not getElementData(localPlayer"user:telefon"then return end
    if getElementData(localPlayer"user:telefon"then
    if pokatel == false then
        startTicking getTickCount ()
        addEventHandler("onClientRender"rootpokaz_telefon)
        pokatel true
    else
        removeEventHandler("onClientRender"rootpokaz_telefon)
        pokatel false
    end
 end
end
 bindKey ("l""down"pokaTeL)

Po prostu za ka?dym razem gdy w??czysz telefon trzeba aktualizowa? zmienna startTicking

Postaw piwo autorowi tego posta
 

 
Tagi: interpolatebeetwen
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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