[YARDIM] Joinquit

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
: 28 Mart 2018, 18:21:13
Selamun Aleyküm Beyler Ben Joinquit deki anımasyonlu gelmesı ıstemıyorum sabıt cıkıp ustune gelemesini istiyorum bırı gırdıgınde altan cıkıyor uste 3 5 saniye sonra gidiyor yapabilirsenız mutlu olurum.

Kod: lua
-- 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)/1200
x, w, h = sx/2-(360/2), 360, 20
scale = 1
font = "default-bold"
length = dxGetTextWidth(text, scale, font, true)
_, y, alpha = interpolateBetween(0, sy, 0, 0, sy-(80+(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, y, w+x, h+y, tocolor(255, 255, 255, alpha1), scale, font, "center", "center", false, false, false, true, false)
    end
end
end)

-- Joing quit as a test, if you gonna use it out side this script you have to export, method exports.notif:showText("Text")  --  carefully do NEVER change this resource name!
addEventHandler('onClientPlayerJoin', root,
function()
showText(getPlayerName(source).." #666666Sunucuya #0078ffGiriş #666666Yaptı")
end)     

addEventHandler('onClientPlayerQuit', root,
function(reason)
showText(getPlayerName(source).." #666666Sunucudan #0078ffÇıkış #666666Yaptı #0078ff("..reason..").")
end)

addEventHandler('onClientPlayerChangeNick', root,
function(oldNick, newNick)
showText("#0078ff"..oldNick.." #666666adını #0078ff" ..newNick.." #666666olarak değiştirdi")
end)
« Son Düzenleme: 29 Mart 2018, 20:11:15 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Joinquit
« : 28 Mart 2018, 18:21:13 »

Çevrimdışı Mahlukat

  • Uzman Üye
  • *
    • İleti: 637
Yanıtla #1 : 28 Mart 2018, 18:38:22
Kod: lua
-- 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 = 255;
 
-- 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)/1200
                        x, w, h = sx/2-(360/2), 360, 20
                        scale = 1
                        font = "default-bold"
                        length = dxGetTextWidth(text, scale, font, true)
                        y, alpha = sy-(80+(h*i)),255
if (progress >= 8) then
table.remove(lisrMSG, i)
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, y, w+x, h+y, tocolor(255, 255, 255, alpha1), scale, font, "center", "center", false, false, false, true, false)
        end
        end
end)

bindKey("c", "down", function()
showText("sadasd"..math.random(9999))
end)
 
-- Joing quit as a test, if you gonna use it out side this script you have to export, method exports.notif:showText("Text")  --  carefully do NEVER change this resource name!
addEventHandler('onClientPlayerJoin', root,
function()
        showText(getPlayerName(source).." #666666Sunucuya #0078ffGiriş #666666Yaptı")
end)     
       
addEventHandler('onClientPlayerQuit', root,
function(reason)
        showText(getPlayerName(source).." #666666Sunucudan #0078ffÇıkış #666666Yaptı #0078ff("..reason..").")
end)
       
addEventHandler('onClientPlayerChangeNick', root,
function(oldNick, newNick)
        showText("#0078ff"..oldNick.." #666666adını #0078ff" ..newNick.." #666666olarak değiştirdi")
end)
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #2 : 28 Mart 2018, 18:43:57
eyvallah tesekkür ederim istedigim oldu  :-\ :-\
« Son Düzenleme: 28 Mart 2018, 18:56:18 Gönderen: ByCash »