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

Wysłany: 2021-11-06, 16:17


Kaziutka1







Wiek: 47
Na forum: 1673 dni
Posty: 4
Nick w MP: Kazik



Respekt: 50

s=Vector2(guiGetScreenSize())
msgs={}

types={
[1]={"succes.png"},
[2]={"info.png"},
[3]={"error.png"},
}

function newNoti(el,txt,type)
if el==localPlayer then
if type>3 or type<0 or not tonumber(type) then
type=2
end
local type=types[type][1]
table.insert(msgs,{txt=txt,typ=type,easingFunction="Linear",startTime=getTickCount(),endTime=getTickCount()+5000})
end
end

addCommandHandler("dodaj",function(cmd,typ,...)
local msg=table.concat({...}," ")
newNoti(localPlayer,msg,tonumber(type))
end)

addEventHandler("onClientRender",root,function()
offset=0
for _,v in ipairs(msgs)do
local now = getTickCount()
local elapsedTime = now - v.startTime
local duration = v.endTime - v.startTime
local progress = elapsedTime / duration

local fAnimationTime = getEasingValue(progress, v.easingFunction)

local alpha = (1-fAnimationTime)*255
if alpha<0 then
table.remove(msgs,1)
end
dxDrawRectangle(15, 638+offset, 391, 62, tocolor(57, 57, 57, 182), false)
dxDrawImage(201, 676+offset, 0, 0, v.typ, 0, 0, 0, tocolor(255, 255, 255, alpha), false)
dxDrawImage(822, 428+offset, 0, 0,v.typ, 0, 0, 0, tocolor(255, 255, 255, alpha), false)
dxDrawImage(742, 393+offset, 0, 53, v.typ, 0, 0, 0, tocolor(255, 255, 255, alpha), false)
dxDrawImage(15, 636+offset, 391, 64, v.typ, 0, 0, 0, tocolor(255, 255, 255, alpha), false)
dxDrawLine(85, 646+offset, 85, 687+offset, tocolor(255, 255, 255, 255), 3, false)
dxDrawText("Ban 30dni dla Kazik za bugowanie gry! essa byku", 99, 647+offset, 396, 686+offset, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, true, false, false, false)
offset=offset+70
end
end)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-06, 17:02


NorbiTTT

Nbi#1824






Wiek: 27
Na forum: 3207 dni
Posty: 193
Nick w MP: Nbi

Piwa: 698

Respekt: 60

Kt?ra to 13 linijka?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-06, 18:53


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
tam gdzie dodajesz masz

newNoti(localPlayer,msg,tonumber(type))


a type nie istnieje wi?c jest nil

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-06, 21:57


Kaziutka1







Wiek: 47
Na forum: 1673 dni
Posty: 4
Nick w MP: Kazik



Respekt: 50

"xyzzz^" napisał/a:

tam gdzie dodajesz masz

newNoti(localPlayer,msg,tonumber(type))


a type nie istnieje wi?c jest nil


a pokazalbys jak to powinno wygladac? bo juz oszalalem :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-08, 14:02


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
zamiast type wstaw jak?? liczb? od 1 do 3... przeanalizuje tabele "types" i dowiesz si? jaka liczba odpowiada rodzaju notyfikacji

Postaw piwo autorowi tego posta
 

 
Tagi: attempt :: compare :: number :: with :: nil :: pokazuje :: linia :: blad
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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