[YARDIM] Dx Joinquit

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
: 02 Nisan 2019, 16:53:53
Arkadaşlar bendeki joinquit'in bir sınırı yok yani 10 kişi aynı anda girse 10 tane üst üste geliyor sohbetin oraya kadar yükseliyor ben buna sınır koymak istiyorum 5 bilgiden sonra silinsin bunu yapabilecek biri var mı?

Kod
-- Notifications system
local sx,sy = guiGetScreenSize()
local r,g,b = 255, 60, 0
local lisrMSG = {}

-- The same function as outputChatBoxing to make it more easier.
function showText(message)
if not (message and type(message) == "string") then error("Bad argument @ 'showText' [Expected player at argument 1, got "..type(message).."]") return false end
return table.insert(lisrMSG, {message, getTickCount()})
end
addEvent("onClientShowText",true)
addEventHandler("onClientShowText", root, showText)

alpha1 = 0;

-- Rendering.
addEventHandler("onClientRender", root,
function ()
if (#lisrMSG > 0) then
for i, messages in ipairs(lisrMSG) do
text, started = unpack(messages)
now = getTickCount()
progress = (now-started)/1000
x, w, h = sx/2-((sx-20)/2), 360, 20
scale = 1
font = "default-bold"
length = dxGetTextWidth(text, scale, font, true)
_, y, alpha = interpolateBetween(0, sy, 0, 0, sy-(300+(h*i)), 255, progress, "OutBack")
if (progress >= 8) then
table.remove(lisrMSG, i)
if alpha1 >= 255 then
alpha1 = 255
end
end
alpha1 = alpha1 + 3;
if alpha1 >= 255 then
alpha1 = 255;
end

    --dxDrawRectangle((x-5)-(tonumber(length)/2)+180, y-1, tonumber(length)+8, h+2, tocolor(r, g, b, alpha1), false)
    --dxDrawRectangle((x-4)-(tonumber(length)/2)+180, y, tonumber(length)+6, h, tocolor(22, 22, 22, alpha1), false)
    dxDrawText(tostring(text), x, sy-(280+(h*i)), w+x, h+sy-(280+(h*i)), tocolor(255, 255, 255, alpha1), scale, font, "left", "center", false, false, false, true, false)
    end
end
end)

addEventHandler('onClientPlayerJoin', root,
function()
showText(getPlayerName(source).." #FF9900Sunucuya Giriş Yaptı. #999999[#33FF00Giriş#999999]")
end)     

addEventHandler('onClientPlayerQuit', root,
function(reason)
showText(getPlayerName(source).." #FF9900Sunucudan Çıkış Yaptı.#999999[#FF0000"..reason.."#999999]")
end)

addEventHandler('onClientPlayerChangeNick', root,
function(oldNick, newNick)
showText("#FFFFFF"..oldNick.." #FF9900ismini değiştirdi : #FFFFFF" ..newNick.."")
end)
« Son Düzenleme: 11 Nisan 2019, 08:11:30 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Dx Joinquit
« : 02 Nisan 2019, 16:53:53 »

Çevrimdışı Mahlukat

  • Uzman Üye
  • *
    • İleti: 637
Yanıtla #1 : 03 Nisan 2019, 11:44:56
Kod
-- Notifications system
local sx,sy = guiGetScreenSize()
local scale = 1
local font = "default-bold"
local r,g,b = 255, 60, 0
local lisrMSG = {}

-- The same function as outputChatBoxing to make it more easier.
function showText(message)
if not (message and type(message) == "string") then error("Bad argument @ 'showText' [Expected player at argument 1, got "..type(message).."]") return false end
table.insert(lisrMSG, {message, getTickCount()})
if #lisrMSG > 5 then
table.remove(lisrMSG,1)
end
end
addEvent("onClientShowText",true)
addEventHandler("onClientShowText", root, showText)

alpha1 = 0;

-- Rendering.
addEventHandler("onClientRender", root,function()
if (#lisrMSG > 0) then
for i, messages in ipairs(lisrMSG) do
text, started = unpack(messages)
now = getTickCount()
progress = (now-started)/1000
x, w, h = sx/2-((sx-20)/2), 360, 20
length = dxGetTextWidth(text, scale, font, true)
_, y, alpha = interpolateBetween(0, sy, 0, 0, sy-(300+(h*i)), 255, progress, "OutBack")
if (progress >= 8) then
table.remove(lisrMSG, i)
if alpha1 >= 255 then
alpha1 = 255
end
end
alpha1 = alpha1 + 3;
if alpha1 >= 255 then
alpha1 = 255;
end

    --dxDrawRectangle((x-5)-(tonumber(length)/2)+180, y-1, tonumber(length)+8, h+2, tocolor(r, g, b, alpha1), false)
    --dxDrawRectangle((x-4)-(tonumber(length)/2)+180, y, tonumber(length)+6, h, tocolor(22, 22, 22, alpha1), false)
    dxDrawText(tostring(text), x, sy-(280+(h*i)), w+x, h+sy-(280+(h*i)), tocolor(255, 255, 255, alpha1), scale, font, "left", "center", false, false, false, true, false)
    end
end
end)

addEventHandler('onClientPlayerJoin', root,function()
showText(getPlayerName(source).." #FF9900Sunucuya Giriş Yaptı. #999999[#33FF00Giriş#999999]")
end)     

addEventHandler('onClientPlayerQuit', root,function(reason)
showText(getPlayerName(source).." #FF9900Sunucudan Çıkış Yaptı.#999999[#FF0000"..reason.."#999999]")
end)

addEventHandler('onClientPlayerChangeNick', root,function(oldNick, newNick)
showText("#FFFFFF"..oldNick.." #FF9900ismini değiştirdi : #FFFFFF" ..newNick.."")
end)
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
Yanıtla #2 : 04 Nisan 2019, 19:14:16
Alıntı
yapılan bir iyiliğe karşı duyulan gönül borcunu ve hoşnutluğu sözle ya da davranışla anlatmak, özellikle “teşekkür ederim” demek.
Sözünü kullanarak sana Teşekkür Ediyorum sorunum düzeldi.

dx yazı ilk geldiğinde alpha olarak açılıyor, sonraki yazılarda direk geliyor bunu düzeltebilir misin?
Linki görebilmek için Kayıt olun yada Giriş yapın.

İlk derken script yeni açıldığında çıkan ilk yazı sonrakilerde animasyon olmuyor yani