MTASA TÜRK
Türkiye'nin En Güncel MTA Platformu


[YARDIM] AFK Mod Downloader

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı MHochste

  • Yeni Üye
  • *
    • İleti: 12
  • Avery Gaming
    • Avery Gaming
: 27 Şubat 2017, 18:14:21
Selam. Yeni bir script denedim fakat debug da şöyle hatalar alıyorum;
Yardımcı olabilirseniz sevinirim.
« Son Düzenleme: 27 Şubat 2017, 18:32:37 Gönderen: Narkoz »
 


MTASA TÜRK

[YARDIM] AFK Mod Downloader
« : 27 Şubat 2017, 18:14:21 »

Çevrimdışı Samsunlee

  • Acemi Üye
  • *
    • İleti: 167
Yanıtla #1 : 27 Şubat 2017, 18:17:35
Client dosyasının kodlarını paylaş buraya
 


Çevrimdışı ertrldtcu

  • Uzman Üye
  • *
    • İleti: 529
Yanıtla #2 : 27 Şubat 2017, 18:19:15
Belirtilen konumdaki dosyaları bulamıyor. Bi kontrol et. files/skin54.txd
Script yazmak için kod bilmek yetmez
 


Çevrimdışı MHochste

  • Yeni Üye
  • *
    • İleti: 12
  • Avery Gaming
    • Avery Gaming
Yanıtla #3 : 27 Şubat 2017, 18:27:21
Linki görebilmek için Kayıt olun yada Giriş yapın.
Belirtilen konumdaki dosyaları bulamıyor. Bi kontrol et. files/skin54.txd
files klasöründe var dosyalar ama

Linki görebilmek için Kayıt olun yada Giriş yapın.
Client dosyasının kodlarını paylaş buraya

Kod: lua
local sx, sy = guiGetScreenSize()
local queue = {}
local modQueue = {}
local progress = 0
local downloadSize = 0
local modsSize = 0
local scriptVersion = 1.1
local canShowTheFuckingGUI = false
local window, language, guiColorR, guiColorG, guiColorB
local gridClicked = 0
local gridCache = 1
local gridRows = 10

addEvent(resname .. ":startDownload", true)
addEventHandler(resname .. ":startDownload", localPlayer,
function(table, size, lang, colorR, colorG, colorB)
queue = table
language = lang
guiColorR, guiColorG, guiColorB = colorR, colorG, colorB
for index = 1, #queue do
local data = queue[index]
if fileExists(data[1]) then
local cf = fileOpen(data[1])
local cfSize = fileGetSize(cf)
if cfSize ~= data[3] then
fileDelete(cf)
else
size = size - cfSize
fileClose(cf)
end
end
end
modsSize = size
if modsSize > 0 then
window = "request"
showCursor(true)
downloadButton = guiCreateButton((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, "", false)
guiSetAlpha(downloadButton, 0)
cancelButton = guiCreateButton((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, "", false)
guiSetAlpha(cancelButton, 0)
addEventHandler("onClientGUIClick", root,
function()
if source == downloadButton then
showCursor(false)
destroyElement(downloadButton)
destroyElement(cancelButton)
window = nil
download()
elseif source == cancelButton then
for index = 1, #queue do
local data = queue[index]
if not fileExists(data[1]) then
queue[index] = nil
end
end
showCursor(false)
destroyElement(downloadButton)
destroyElement(cancelButton)
window = nil
download()
end
end
)
else
download()
end
end
)
triggerServerEvent("afkdownloader:startDownload", localPlayer, localPlayer)

function download()
if #queue >= 1 then
downloadFile(queue[#queue][1])
else
queue = {}
modsSize = 0
downloadSize = 0
progress = 0
canShowTheFuckingGUI = true
end
end

function calculateW(w, progress)
if w and progress then
local w = w-2
local width = ((w*progress)/100)
return width
end
return false
end

local lastUpdate = 0
local lastName = ""

function updateDownloadSize(size)
if lastName == queue[#queue] then
downloadSize = (downloadSize-lastUpdate) + size
else
downloadSize = downloadSize + size
end
lastName = queue[#queue]
lastUpdate = size
end

addEventHandler("onClientRender", root,
    function()
if #queue ~= 0 then
if window == "request" then
dxDrawRectangle((520/1366)*sx, (267/768)*sy, (307/1366)*sx, (125/768)*sy, tocolor(0, 0, 0, 150), true)
dxDrawRectangle((520/1366)*sx, (267/768)*sy, (307/1366)*sx, (23/768)*sy, tocolor(0, 0, 0, 150), true)
dxDrawText("AFK Mod Downloader v" .. scriptVersion, (520/1366)*sx, (267/768)*sy, (827/1366)*sx, (290/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(translations[language].request_firstText .. "\n" .. translations[language].request_secondText .. ": " .. sizeFormat(modsSize), (520/1366)*sx, (295/768)*sy, (827/1366)*sx, (338/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, true, true, false, false)
if getKeyState("mouse1") and isCursorHover((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then
dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 50), true)
dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
elseif isCursorHover((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then
dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 100), true)
dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 200), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
else
dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 150), true)
dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
end
if getKeyState("mouse1") and isCursorHover((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then
dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 50), true)
dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
elseif isCursorHover((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then
dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 100), true)
dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 200), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
else
dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 150), true)
dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
end
else
if fileExists(queue[#queue][1]) then
openedFile = fileOpen(queue[#queue][1])
if openedFile then
local fileSize = fileGetSize(openedFile)
fileClose(openedFile)
updateDownloadSize(fileSize)
end
end
dxDrawRectangle((413/1366)*sx, (599/768)*sy, (548/1366)*sx, (118/768)*sy, tocolor(0, 0, 0, 150), true)
dxDrawRectangle((413/1366)*sx, (599/768)*sy, (548/1366)*sx, (23/768)*sy, tocolor(0, 0, 0, 150), true)
dxDrawText("AFK Mod Downloader v" .. scriptVersion, (412/1366)*sx, (599/768)*sy, (961/1366)*sx, (622/768)*sy, tocolor(255, 255, 255, 254), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(translations[language].firstText .. "\n" .. translations[language].secondText .. ": " .. queue[#queue][1]:gsub("files/", ""), (412/1366)*sx, (622/768)*sy, (961/1366)*sx, (666/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
local x, y, w, h = (421/1366)*sx, (673/768)*sy, (532/1366)*sx, (34/768)*sy
progress = ((downloadSize*100)/modsSize)
local width = calculateW(w, progress)
dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 200), true)
dxDrawRectangle(x+1, y+1, w-2, h-2, tocolor(guiColorR, guiColorG, guiColorB, 50), true)
dxDrawRectangle(x+1, y+1, width, h-2, tocolor(guiColorR, guiColorG, guiColorB, 150), true)
dxDrawText(sizeFormat(downloadSize) .. "/" .. sizeFormat(modsSize) .. " (" .. math.floor(progress) .. "%)", x, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false)
end
end

2000 karakter sınırı olduğu için bu kadar verebildim kusura bakma.
 


Çevrimdışı Samsunlee

  • Acemi Üye
  • *
    • İleti: 167
Yanıtla #4 : 27 Şubat 2017, 19:50:59
Meta xmlsinide paylaş
 


Çevrimdışı MHochste

  • Yeni Üye
  • *
    • İleti: 12
  • Avery Gaming
    • Avery Gaming
Yanıtla #5 : 27 Şubat 2017, 20:22:57
Kod: lua
<meta>
<info author="Dannys (AFK)" name = "AFK Mod Downloader" version="1.1.2" type="script"/>

<!-- Avalible languages: EN -> English, ES -> Spanish, PT/BR -> Portugues/Brazilian.
-->
<!-- You can change the button and gridlist color. Example: <gui r="255" g="0"  b="200"/>
Default color: <gui r="255" g="51" b="51"/>
-->
<translation language="EN"/>
<gui r="255" g="51" b="51"/>
<script src="util.lua" type="shared"/>
<script src="downloader_s.lua"/>
<script src="translate.lua" type="client"/>
<script src="downloader_c.lua" type="client"/>
<export function="download" type="server"/>
<min_mta_version server="1.5.0" client="1.5.0"/>
<!-- FILES HERE
<file src="files/name.extension" model = "model" displayName = "This is a mod" download="false"/>
DFF and TXD must have same name of file. Example: namesd.dff|namesd.txd
!!!!!! displayName -> Is name of the mod when player open the selection GUI. !!!!!!!!!
-->
<file src="files/skin54.dff" model="54" displayName = "Military Clothes" download="false"/>
<file src="files/skin54.txd" model="54" displayName = "Military Clothes" download="false"/>
</meta>
 


MTASA TÜRK

Ynt: [YARDIM] AFK Mod Downloader
« Yanıtla #5 : 27 Şubat 2017, 20:22:57 »

Çevrimdışı Samsunlee

  • Acemi Üye
  • *
    • İleti: 167
Yanıtla #6 : 27 Şubat 2017, 21:01:35
Hacı komple at ben bı kontrol ediyim burdan olcak gibi deil özelden yolla
 


Çevrimdışı MHochste

  • Yeni Üye
  • *
    • İleti: 12
  • Avery Gaming
    • Avery Gaming
Yanıtla #7 : 27 Şubat 2017, 21:29:28
Linki görebilmek için Kayıt olun yada Giriş yapın.
Hacı komple at ben bı kontrol ediyim burdan olcak gibi deil özelden yolla
Gönderdim.