Jump to content

Please help meh with ingame downloading


jingzhi

Recommended Posts

Scripts

function download(resource) 
    if resource == getThisResource() then 
        outputChatBox("Download started") 
        downloadFile("rhino.txd") 
        downloadFile("rhino.dff") 
    end 
end 
addEventHandler("onClientResourceStart",getRootElement(),download) 
  

meta

    "JingZhi" type="script" /> 
    

Hey guys I know I have asked a lot of questions these day, please don't get annoyed cause i'm a noobie, and noobies need help :) So i am trying to make this ingame downloader, but it always say the file doesnt exist, is there any problem in my scipts?

Link to comment
Show updated code.
function download(resource) 
    if resource == getThisResource() then 
        outputChatBox("Download started") 
        downloadFile("rhino.txd") 
        downloadFile("rhino.dff") 
    end 
end 
  
addEventHandler("onClientResourceStart",getRootElement(),download) 
  
function replacemod(success) 
    if success == true then 
        local txd = engineLoadTXD ( "rhino.txd" ) 
        local dff = engineLoadDFF ( "rhino.dff", 432 ) 
        engineImportTXD ( txd, 432 ) 
        engineReplaceModel ( dff, 432 ) 
    else 
        outputChatBox("Download was failed") 
    end 
end 
  
addEventHandler("onClientFileDownloadComplete",getRootElement(),replacemod) 

This is the full code

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...