Jump to page content
English English   Polish Polish   Dutch Dutch   Russian Russian   German German   Hungarian Hungarian   Norwegian Norwegian   Swedish Swedish   Finnish Finnish   Romanian Romanian   Spanish Spanish   Portuguese Portuguese   Latvian Latvian  
Homepage
Home
Register
Login

Resources
Forum
Wiki
Servers

rssDownload (download)

Category:script
Author(s):xownage
Downloads:2342
Rate:You need to be logged in to vote
Rating:3.6 (17 Votes)
Description:
This resource is no longer being developed due to similar functions being added by mta. (http://wiki.multitheftauto.com/wiki/DownloadFile)(1.4 only+)

A new way of downloading files to your client, you can now download files from the resources directory and make it download to the client without forcing the client to download the file when they join your server and no big download bar in your way.

This script right now only contains exported functions for scripters to use.

Client functions:
downloadFile (string fileFromServer, string saveAs, int interval)
- Interval is how long between each time the server sends the client some data, I'd reccomend this being at about 200 to avoid lagging the server.

getClientFileSize (string theFile, string type)
- Types: "MB", "KB", if blank will return bytes.

Server functions:
getServerFileSize (string theFile, string type)

Server events:
onDownloadFail
Parameters: String serverFile, String clientFile
onDownloadComplete
Parameters: String serverFile, String clientFile
onDownloadPreStart
Parameters: string clientFile, int interval, bytes fileSize, int transferTimes

Client events:
onClientDownloadPreStart
Parameters: string clientFile, int interval, bytes fileSize, int transferTimes
onClientDownloadComplete
Parameters: string clientFile
onClientDownloadFail
Parameters: String serverFile, String clientFile


Future features:
- Add small red text at the bottom right of the screen with download percentage.
- Add settings containing allowed file types

Note:
Avoid downloading lua files from this script or anything that the user may be able to edit, it's a good idea to check the clients file size when they join the server to make sure it hasn't been modified.

Known issues:
onClientDownloadComplete returns the path of the file

Forum topic: http://forum.mtasa.com/viewtopic.php?f=108&t=38024
...

(more)

Download latest version | Report

Version history

Version Publish Date Changes
1.0.1 2011-12-20 18:43:16 Changed an event name and removed a few pointless parameters Download
1.0.0 2011-12-20 17:18:48 First public release Download