Jump to content

Please help meh with ingame downloading


jingzhi

Recommended Posts

Posted

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?

Posted

um try replacing

    "rhino.txd" download="false">
    "rhino.dff" download="false">

with

    "rhino.txd" download="false" /> 
    "rhino.dff" download="false" /> 

Posted
um try replacing
    "rhino.txd" download="false">
    "rhino.dff" download="false">

with

    "rhino.txd" download="false" /> 
    "rhino.dff" download="false" /> 

I made it as you said now the "file doesnt exist" is gone but the download is still a failure :|

Posted
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

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