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

Wysłany: 2017-05-14, 19:24


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Witam, w jaki spos?b mo?na zrobi? jak przyk?adowo na Its Your World jak dostaniemy jaki? hajs, to si? pojawia w dxDrawText "+..hajs..PLN" i odlicza np. dostali?my 2000 to odlicza od 2000 do 0 i znika napis?

Mniej wi?cej mam nadziej? ?e zrozumiecie, w innej sytuacji dam ssa

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-14, 19:34


Kuksss

guwno






Wiek: 22
Na forum: 3922 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Kalizman, Do funkcji daj?cej hajs dopisz:
        addEventHandler("onClientRender",root,render2_pr)
        setTimer(renderstop2_pr,1000,1) --to jest to odliczanie do znikni?cia


A p??niej zr?b nowe funkcje, tj.
function render2_pr()
dxDrawText("Tekst wyswietlajacy sie u gracza", screenW * 0.3656, screenH * 1.3553, screenW * 0.6273, screenH * 0.3193, tocolor(255, 0, 0), 1.5, "default", "center", "center", false, false, false, false, false)
end


I ni?ej:
function renderstop2_pr()
removeEventHandler("onClientRender",root,render2_pr)
end


Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-14, 19:35


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

P?tla for w kt?rej iterator to liczba(kasa) kt?ra ma si? zmniejsza? o ile? i to wy?wietlasz textem. Tyle

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-14, 19:36


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Kuksss, Co do kodu wy?ej o to mi chodzi, ale chc? uzyska? efekt taki, ?e jak otrzymamy np. 100 PLN to na dxDrawText odlicza nam do 0 od 100 czyli 100->99->98->97 itp...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-14, 20:09


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

"o ile?" - mo?esz sobie nawet sprawdza?, czy liczba jest wi?ksza od 100 a mniejsza od 400 to zmiejszasz o 7, wieksza od 400 ale mniejsza od 5k to zmiejszasz o 70 itp.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-20, 14:06


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Jaki? przyk?ad? Chocia?by bez tego odliczania tylko, ?eby pokazywa?o przyk?adowo +500PLN przez kilka sec...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-20, 14:28


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Kalizman, Pisa?em to pare miesi?cy temu jak zaczyna?em si? uczy? i nie wiem czy dzia?a bo nie testowa?em :P
if lstMoney~=getPlayerMoney() then
      lstMoneyDiff=getPlayerMoney()-lstMoney
      lstMoneyTs=getTickCount()

      lstMoney=getPlayerMoney()
    end

    if tmpMoney~=getPlayerMoney() then
      local roznica=math.abs(getPlayerMoney()-tmpMoney)
      if roznica<2 then
        tmpMoney=getPlayerMoney()
      elseif roznica<100 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1
        end
      elseif roznica<1000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-100
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+100
        end
      elseif roznica<10000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1000
        end
      else
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-10000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+10000
        end
      end
    end
    local waluta=string.format("%01s",tmpMoney)


                dxDrawBorderedText("PLN "..waluta, screenW * 0.8236, screenH * 0.0208, screenW * 0.9773, screenH * 0.0664, tocolor(5, 98, 2, 255), 1.06, font, "center", "center", false, false, false, false, false)
if lstMoneyDiff~=0 and getTickCount()-lstMoneyTs<5000 then
      local t=string.format("%s%d", lstMoneyDiff<0 and "" or "+", lstMoneyDiff)
      local a=1-(getTickCount()-lstMoneyTs)/5000

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,tocolor(0,0,0,a*255), 1.02, font2, "right", "center", false, false, false, false, false)

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,lstMoneyDiff<0 and tocolor(5, 98, 2,a*255) or tocolor(5, 98, 2,a*255), 1.02, font2, "right", "center", false, false, false, false, false)
    end
end
end


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-20, 20:11


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Wercio., kilka miesi?cy temu to ty nie wiedzia?e? co to lua, nie dzi?ki, taki urywek kodu te? mog? wzi?? z paczki skyGame :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-20, 20:13


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Kalizman, Sk?d wiesz, ?e nie wiedzia?em?? I ja nawet na kompie nie mam tej paczki :)

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-20, 20:26


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Wercio., "tw?j autorski" kod:

if lstMoney~=getPlayerMoney() then
      lstMoneyDiff=getPlayerMoney()-lstMoney
      lstMoneyTs=getTickCount()

      lstMoney=getPlayerMoney()
    end

    if tmpMoney~=getPlayerMoney() then
      local roznica=math.abs(getPlayerMoney()-tmpMoney)
      if roznica<2 then
        tmpMoney=getPlayerMoney()
      elseif roznica<100 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1
        end
      elseif roznica<1000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-100
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+100
        end
      elseif roznica<10000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1000
        end
      else
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-10000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+10000
        end
      end
    end
    local waluta=string.format("%01s",tmpMoney)


                dxDrawBorderedText("PLN "..waluta, screenW * 0.8236, screenH * 0.0208, screenW * 0.9773, screenH * 0.0664, tocolor(5, 98, 2, 255), 1.06, font, "center", "center", false, false, false, false, false)
if lstMoneyDiff~=0 and getTickCount()-lstMoneyTs<5000 then
      local t=string.format("%s%d", lstMoneyDiff<0 and "" or "+", lstMoneyDiff)
      local a=1-(getTickCount()-lstMoneyTs)/5000

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,tocolor(0,0,0,a*255), 1.02, font2, "right", "center", false, false, false, false, false)

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,lstMoneyDiff<0 and tocolor(5, 98, 2,a*255) or tocolor(5, 98, 2,a*255), 1.02, font2, "right", "center", false, false, false, false, false)
    end
end
end


a wycinek IDENTYCZNEGO kodu z HUDu skyGame:

   if lstMoney~=getPlayerMoney() then
      lstMoneyDiff=getPlayerMoney()-lstMoney
      lstMoneyTs=getTickCount()

      lstMoney=getPlayerMoney()
    end

    if tmpMoney~=getPlayerMoney() then
      local roznica=math.abs(getPlayerMoney()-tmpMoney)
      if roznica<2 then
        tmpMoney=getPlayerMoney()
      elseif roznica<100 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1
        end
      elseif roznica<1000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-100
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+100
        end
      elseif roznica<10000 then
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-1000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+1000
        end
      else
        if tmpMoney>getPlayerMoney() then
          tmpMoney=tmpMoney-10000
        elseif tmpMoney<getPlayerMoney() then
          tmpMoney=tmpMoney+10000
        end
      end
    end
    local waluta=string.format("%01s",tmpMoney)


                dxDrawBorderedText("PLN "..waluta, screenW * 0.8236, screenH * 0.0208, screenW * 0.9773, screenH * 0.0664, tocolor(5, 98, 2, 255), 1.06, font, "center", "center", false, false, false, false, false)
if lstMoneyDiff~=0 and getTickCount()-lstMoneyTs<5000 then
      local t=string.format("%s%d", lstMoneyDiff<0 and "" or "+", lstMoneyDiff)
      local a=1-(getTickCount()-lstMoneyTs)/5000

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,tocolor(0,0,0,a*255), 1.02, font2, "right", "center", false, false, false, false, false)

      dxDrawBorderedText(t, screenW * 0.8775, screenH * 0.3021, screenW * 0.9861, screenH * 0.3477,lstMoneyDiff<0 and tocolor(5, 98, 2,a*255) or tocolor(5, 98, 2,a*255), 1.02, font2, "right", "center", false, false, false, false, false)
    end
end
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Fokus243
Tagi: hajs
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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