Wieso funktioniert dein alter nicht? Irgendwo wird es ja hapern
local screenW, screenH = guiGetScreenSize()
addEvent ( "downloadFiles_Bonus", true )
local screenX, screenY = guiGetScreenSize()
local dx, dy= guiGetScreenSize()
local dxHalbe, dyHalbe= dx/2, dy/2
local sx, sy = screenX/1920, screenY/1080
local filepaths = {}
local fileamounts = 0
local downloadcounter = 1
local function drawDownloadProgress ( )
dxDrawRectangle(dxHalbe-310, dyHalbe+120, 600, 25, tocolor(0, 0, 0, DoAlpha ))
dxDrawRectangle(dxHalbe-310, dyHalbe+120, 600*( downloadcounter / fileamounts ), 25, tocolor(0,205,0, 200 ))
dxDrawText ( "Download ("..downloadcounter.." of "..fileamounts.." files)", dxHalbe-70, dyHalbe+120, dxHalbe+76, dyHalbe-120, tocolor ( 0, 0, 0, 150 ), 1.5)
end
function loadNextFile_Bonus ( fileName )
if fileName == filepaths[downloadcounter] then
if downloadcounter < fileamounts then
downloadcounter = downloadcounter + 1
downloadFile ( filepaths[downloadcounter] )
else
-- if NewPlayer== false then
removeEventHandler ( "onClientFileDownloadComplete", root, loadNextFile_Bonus )
removeEventHandler ( "onClientRender", root, drawDownloadProgress )
-- else
-- StartIntro()
-- end
end
end
end
addEventHandler ( "downloadFiles_Bonus", root, function ( filepathsarray )
fileamounts = #filepathsarray
for i=1, fileamounts do
filepaths[i] = filepathsarray[i]
end
addEventHandler ( "onClientFileDownloadComplete", root, loadNextFile_Bonus )
addEventHandler ( "onClientRender", root, drawDownloadProgress )
downloadFile ( filepaths[downloadcounter] )
starttick = getTickCount()
end )
function start ( )
outputChatBox("test")
triggerServerEvent ( "clientLoadedResource_Bonus", localPlayer )
outputDebugString("Download Client wurde Erfolgreich Gestartet!")
end
addEventHandler("onResourcePreStart",getRootElement(), start)
Alles anzeigen
addEvent ( "clientLoadedResource_Bonus", true )
local filepaths = {}
local playersdownloaded = {} -- Anti-Abuse
addEventHandler ( "onResourceStart", resourceRoot, function ( )
local meta = xmlLoadFile ( "meta.xml" )
local nodes = xmlNodeGetChildren ( meta )
if nodes and nodes[1] then
local j = 0
for i=1, #nodes do
if xmlNodeGetName ( nodes[i] ) == "file" then
j = j + 1
filepaths[j] = xmlNodeGetAttribute ( nodes[i], "src" )
end
end
end
xmlUnloadFile ( meta )
end )
addEventHandler ( "clientLoadedResource_Bonus", root, function ( )
if filepaths[1] and not playersdownloaded[client] then
playersdownloaded[client] = true
triggerLatentClientEvent ( client, "downloadFiles_Bonus", 30000, false, client, filepaths )
end
end )
addEventHandler ( "onPlayerQuit", root, function ( )
playersdownloaded[source] = nil
end )
Alles anzeigen
so habe ich es gemacht. aber ich bekomme keine errors oder warnings. und funktionieren tut es leider auch nicht. komme da leider nicht weiter