[İSTEK] Bilgilendirme Scripti

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı emretanu2005

  • QS | FreeRoam
  • Yeni Üye
  • *
    • İleti: 13
    • Quality Server's FR
: 09 Şubat 2021, 19:03:15
Uzun Süredir Her Yerde Bir Tür Bilgilendirme Scripti Arıyorum. Bu Script Oyun Tarafından Otomatik Olarak Yazı Çıkarıyor. İnternette Bunun Hakkında Araştırma Yaptığımda Hep Karşıma "ShoutAll" Scripti Çıkıyor. Amacım Oyunun Kendi Kendine Bilgilendirmesi.

(Belkide İsmini Yanlış Aratıyorum)

Bu da Bir Örneği:

Linki görebilmek için Kayıt olun yada Giriş yapın.
« Son Düzenleme: 14 Haziran 2022, 12:41:42 Gönderen: Quadro »
185.255.92.67:22843

Quality Server's FreeRoam
 


MTASATURK

[İSTEK] Bilgilendirme Scripti
« : 09 Şubat 2021, 19:03:15 »

Çevrimdışı Casti

  • C-se (Discord - Casti#9795)
  • Deneyimli Üye
  • *
    • İleti: 307
Yanıtla #1 : 09 Şubat 2021, 20:01:48
client.lua
Kod
local displayWidth, displayHeight = guiGetScreenSize();

local notificationData = {};

local notificationFont = dxCreateFont('Dosyalar/roboto.ttf', 12 * 2, false);
local iconsFont = dxCreateFont('Dosyalar/icons.ttf', 12 * 2, false);

addEventHandler('onClientRender', root,
function()
for k, v in pairs(notificationData) do
if (v.State == 'fadeIn') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 255;
end

if (alphaProgress > 1) then
v.Tick = getTickCount();
v.State = 'openTile';
end
elseif (v.State == 'fadeOut') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 0;
end

if (alphaProgress > 1) then
notificationData = {};
end
elseif (v.State == 'openTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

if (tileProgress > 1) then
v.State = 'fixTile';

setTimer(function()
v.Tick = getTickCount();
v.State = 'closeTile';
end, string.len(v.Text) * 45 + 5000, 1);
end
elseif (v.State == 'closeTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.StartX;
v.CurrentWidth = 0;
end

if (tileProgress > 1) then
v.AlphaTick = getTickCount();
v.State = 'fadeOut';
end
elseif (v.State == 'fixTile') then
v.Alpha = 255;
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true);
dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true);

if (v.Alpha == 255) then
dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true);
end

if (v.Type == 'error') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'warning') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'info') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'success') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
end
end
end
)

addEvent('lsgmesaj', true);
function lsgmesaj(text, type)
if (text and type) then
if (notificationData ~= nil) then
table.remove(notificationData, #notificationData);
end

table.insert(notificationData,
{
StartX = (displayWidth / 2) - (25 / 2),
EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2),
Text = text,
Width = dxGetTextWidth(text, 0.40, notificationFont) + 20,
Alpha = 0,
State = 'fadeIn',
Tick = 0,
AlphaTick = getTickCount(),
CurrentX = (displayWidth / 2) - (25 / 2),
CurrentWidth = 0,
Type = type or 'info'
}
);

playSoundFrontEnd(11);
end
end
addEventHandler('lsgmesaj', root, lsgmesaj);

function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
if (x and y and w and h) then
if (not borderColor) then
borderColor = tocolor(0, 0, 0, 200);
end

if (not bgColor) then
bgColor = borderColor;
end

--> Background
dxDrawRectangle(x, y, w, h, bgColor, postGUI);

--> Border
dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
end
end



mesaj.lua
Kod
lsgmesaj("Lütfen kullanıcı adınızı giriniz.",'error');
>:( >:( >:( >:( >:( >:( >:( >:( >:( >:(
 


Çevrimdışı emretanu2005

  • QS | FreeRoam
  • Yeni Üye
  • *
    • İleti: 13
    • Quality Server's FR
Yanıtla #2 : 10 Şubat 2021, 12:37:45
Linki görebilmek için Kayıt olun yada Giriş yapın.
client.lua
Kod
local displayWidth, displayHeight = guiGetScreenSize();

local notificationData = {};

local notificationFont = dxCreateFont('Dosyalar/roboto.ttf', 12 * 2, false);
local iconsFont = dxCreateFont('Dosyalar/icons.ttf', 12 * 2, false);

addEventHandler('onClientRender', root,
function()
for k, v in pairs(notificationData) do
if (v.State == 'fadeIn') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 255;
end

if (alphaProgress > 1) then
v.Tick = getTickCount();
v.State = 'openTile';
end
elseif (v.State == 'fadeOut') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 0;
end

if (alphaProgress > 1) then
notificationData = {};
end
elseif (v.State == 'openTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

if (tileProgress > 1) then
v.State = 'fixTile';

setTimer(function()
v.Tick = getTickCount();
v.State = 'closeTile';
end, string.len(v.Text) * 45 + 5000, 1);
end
elseif (v.State == 'closeTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.StartX;
v.CurrentWidth = 0;
end

if (tileProgress > 1) then
v.AlphaTick = getTickCount();
v.State = 'fadeOut';
end
elseif (v.State == 'fixTile') then
v.Alpha = 255;
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true);
dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true);

if (v.Alpha == 255) then
dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true);
end

if (v.Type == 'error') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'warning') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'info') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'success') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
end
end
end
)

addEvent('lsgmesaj', true);
function lsgmesaj(text, type)
if (text and type) then
if (notificationData ~= nil) then
table.remove(notificationData, #notificationData);
end

table.insert(notificationData,
{
StartX = (displayWidth / 2) - (25 / 2),
EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2),
Text = text,
Width = dxGetTextWidth(text, 0.40, notificationFont) + 20,
Alpha = 0,
State = 'fadeIn',
Tick = 0,
AlphaTick = getTickCount(),
CurrentX = (displayWidth / 2) - (25 / 2),
CurrentWidth = 0,
Type = type or 'info'
}
);

playSoundFrontEnd(11);
end
end
addEventHandler('lsgmesaj', root, lsgmesaj);

function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
if (x and y and w and h) then
if (not borderColor) then
borderColor = tocolor(0, 0, 0, 200);
end

if (not bgColor) then
bgColor = borderColor;
end

--> Background
dxDrawRectangle(x, y, w, h, bgColor, postGUI);

--> Border
dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
end
end



mesaj.lua
Kod
lsgmesaj("Lütfen kullanıcı adınızı giriniz.",'error');

Mesaj Lua Üzerinde Kullanıcı Adı Yazıyor?

Mesaj Birleştirildi: [time]10 Şubat 2021, 12:42:14[/time]
Linki görebilmek için Kayıt olun yada Giriş yapın.
Mesaj Lua Üzerinde Kullanıcı Adı Yazıyor?

Şimdi Fark Ettim. Bu Script Bir Kayıt Sistemi Üzerinden Alınmış. Bunu Fark Edememişim.

Yanıtın İçin Teşekkürler.

Mesaj Birleştirildi: 10 Şubat 2021, 13:44:36
Linki görebilmek için Kayıt olun yada Giriş yapın.
client.lua
Kod
local displayWidth, displayHeight = guiGetScreenSize();

local notificationData = {};

local notificationFont = dxCreateFont('Dosyalar/roboto.ttf', 12 * 2, false);
local iconsFont = dxCreateFont('Dosyalar/icons.ttf', 12 * 2, false);

addEventHandler('onClientRender', root,
function()
for k, v in pairs(notificationData) do
if (v.State == 'fadeIn') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 255;
end

if (alphaProgress > 1) then
v.Tick = getTickCount();
v.State = 'openTile';
end
elseif (v.State == 'fadeOut') then
local alphaProgress = (getTickCount() - v.AlphaTick) / 650;
local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear');

if (alphaAnimation) then
v.Alpha = alphaAnimation;
else
v.Alpha = 0;
end

if (alphaProgress > 1) then
notificationData = {};
end
elseif (v.State == 'openTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

if (tileProgress > 1) then
v.State = 'fixTile';

setTimer(function()
v.Tick = getTickCount();
v.State = 'closeTile';
end, string.len(v.Text) * 45 + 5000, 1);
end
elseif (v.State == 'closeTile') then
local tileProgress = (getTickCount() - v.Tick) / 350;
local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear');
local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear');

if (tilePosition and tileWidth) then
v.CurrentX = tilePosition;
v.CurrentWidth = tileWidth;
else
v.CurrentX = v.StartX;
v.CurrentWidth = 0;
end

if (tileProgress > 1) then
v.AlphaTick = getTickCount();
v.State = 'fadeOut';
end
elseif (v.State == 'fixTile') then
v.Alpha = 255;
v.CurrentX = v.EndX;
v.CurrentWidth = v.Width;
end

roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true);
dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true);

if (v.Alpha == 255) then
dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true);
end

if (v.Type == 'error') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'warning') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'info') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
elseif (v.Type == 'success') then
dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true);
end
end
end
)

addEvent('lsgmesaj', true);
function lsgmesaj(text, type)
if (text and type) then
if (notificationData ~= nil) then
table.remove(notificationData, #notificationData);
end

table.insert(notificationData,
{
StartX = (displayWidth / 2) - (25 / 2),
EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2),
Text = text,
Width = dxGetTextWidth(text, 0.40, notificationFont) + 20,
Alpha = 0,
State = 'fadeIn',
Tick = 0,
AlphaTick = getTickCount(),
CurrentX = (displayWidth / 2) - (25 / 2),
CurrentWidth = 0,
Type = type or 'info'
}
);

playSoundFrontEnd(11);
end
end
addEventHandler('lsgmesaj', root, lsgmesaj);

function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
if (x and y and w and h) then
if (not borderColor) then
borderColor = tocolor(0, 0, 0, 200);
end

if (not bgColor) then
bgColor = borderColor;
end

--> Background
dxDrawRectangle(x, y, w, h, bgColor, postGUI);

--> Border
dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
end
end



mesaj.lua
Kod
lsgmesaj("Lütfen kullanıcı adınızı giriniz.",'error');


Bu Arada Söylemeyi Unutmuşum. Meta Dosyasını da Yazmam Gerek. Buraya Ne Yazmalıyım?
« Son Düzenleme: 10 Şubat 2021, 13:44:36 Gönderen: emretanu2005 »
185.255.92.67:22843

Quality Server's FreeRoam
 
Mesajı Beğenenler: Casti


Çevrimdışı Loisdeny

  • Yeni Üye
  • *
    • İleti: 56
Yanıtla #3 : 10 Şubat 2021, 16:25:45
Meta.xml yi diyorsan buyur

Kod
<meta>
 <info author="bilgilendirme" type="client" version="0.5" />
 <script src="client.lua" type="client" />
</meta>
 


Çevrimdışı emretanu2005

  • QS | FreeRoam
  • Yeni Üye
  • *
    • İleti: 13
    • Quality Server's FR
Yanıtla #4 : 10 Şubat 2021, 17:25:36
Linki görebilmek için Kayıt olun yada Giriş yapın.
Meta.xml yi diyorsan buyur

Kod
<meta>
 <info author="bilgilendirme" type="client" version="0.5" />
 <script src="client.lua" type="client" />
</meta>

Meta İçin Teşekkürler. Ancak Client Kodu Sanırım Kayıt Sistemine Uygun Olduğu İçin Otomatik Olarak Çıkmıyor. Bunu Nasıl Otomatiğe Bağlayabilirim?

Örn: 50 Saniyede Bir Bilgilendirme
185.255.92.67:22843

Quality Server's FreeRoam
 


Çevrimdışı Loisdeny

  • Yeni Üye
  • *
    • İleti: 56
Yanıtla #5 : 10 Şubat 2021, 21:43:50
Kardeşım onu boşver gelışmış bilgilendirme scripti bu al at 5 veya 10 saniye de bir atıyor
Eyer script hakkında konuşmak ıstersen discord dan ulaş yardımcı olurum

Spoiler for Hiden:
Linki görebilmek için Kayıt olun yada Giriş yapın.

Spoiler for Hiden:
Discord : LoisDeny#4312
 


MTASATURK

Ynt: Bilgilendirme Scripti
« Yanıtla #5 : 10 Şubat 2021, 21:43:50 »

Çevrimdışı shephard^

  • Uzman Üye
  • *
    • İleti: 776
  • decay.
Yanıtla #6 : 11 Şubat 2021, 02:03:41
Mtasa notif olarak araştıracak sin

Örnekler

Linki görebilmek için Kayıt olun yada Giriş yapın.

Linki görebilmek için Kayıt olun yada Giriş yapın.

Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı emretanu2005

  • QS | FreeRoam
  • Yeni Üye
  • *
    • İleti: 13
    • Quality Server's FR
Yanıtla #7 : 11 Şubat 2021, 14:59:46
Linki görebilmek için Kayıt olun yada Giriş yapın.
Mtasa notif olarak araştıracak sin

Örnekler

Linki görebilmek için Kayıt olun yada Giriş yapın.

Linki görebilmek için Kayıt olun yada Giriş yapın.

Linki görebilmek için Kayıt olun yada Giriş yapın.

Herşey İçin Çok Teşekkürler. Sonunda Bunu Bulabildim.
185.255.92.67:22843

Quality Server's FreeRoam