Jump to content

[Solved] Basic Download System


3B00DG4MER

Recommended Posts

Hello,I made today a Command which Can Download the Model,Vehicles,Weapons,Skins

When you do the Command /download,it should be start downloading the Model,But It's not work

Help please

Meta:

"false" src="fortune.dff"/> 
"false" src="fortune.txd"/> 

Client:

function downloadfile() 
     outputChatBox ( "The Download has started" ) 
     downloadFile ( "fortune.txd" ) 
     downloadFile ( "fortune.dff" ) 
end 
addCommandHandler ( "download", downloadfile ) 
function onDownloadFinish ( file, success ) 
    if ( source == resourceRoot ) then                            -- if the file relates to this resource 
        if ( success ) then                                       -- if the file was downloaded successfully 
        if ( file == "fortune.txd" ) and ( file == "fortune.dff" )  then                        -- if the file name is what we were expecting 
        outputChatBox ( "the file has succesfully finnised " ) 
        txd = engineLoadTXD ( "fortune.txd" ) 
        engineImportTXD ( txd, 526 ) 
        dff = engineLoadDFF ( "fortune.dff", 526 ) 
        engineReplaceModel ( dff, 526 ) 
            end 
        else                                                      -- if the file wasn't downloaded successfully 
        if ( file == "fortune.txd" ) and ( file == "fortune.dff" ) then 
            outputChatBox ( "fortune failed to download" ) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) 

Error:

client.lua:3: attempt to call global 'downloadFile' (a nil value)

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...