Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////////////////////////////////
- // a_gvars.inc -> Por Bruno
- #if !defined varGet
- #define varGet(%0) getproperty(0,%0)
- #endif
- #if !defined varSet
- #define varSet(%0,%1) setproperty(0, %0, %1)
- #endif
- // defina aqui o máximo de downloads que podem ser feitos
- #define MAX_DOWNLOADS 500
- ///////////////////////////////////////////////////////////////////////////////
- new szSiteDownload[MAX_DOWNLOADS][128];
- new szFileDownload[MAX_DOWNLOADS][064];
- new giDownloads;
- native URLDownloadToFileInterno(site[], arquivo[]);
- stock URLDownloadToFile(site[], arquivo[])
- {
- static strBuff[64];
- format(strBuff, 64, "%s", arquivo);
- URLDownloadToFileInterno(site, strBuff);
- varSet(strBuff, SetTimerEx("gDown_CHKFile", 900, true, "i", giDownloads));
- format(szFileDownload[giDownloads], 64, arquivo);
- format(szSiteDownload[giDownloads], 00128, site);
- giDownloads++;
- return true;
- }
- forward gDown_CHKFile(fileid);
- public gDown_CHKFile(fileid)
- {
- if(szFileDownload[fileid][0]) {
- static stmpHeCK[64];
- format(stmpHeCK, 64, "%s_OX_", szFileDownload[fileid]);
- if(fexist(stmpHeCK)) {
- KillTimer(varGet(szFileDownload[fileid]));
- // public OnURlDownloaded(site[], file[])
- CallLocalFunction("OnURlDownloaded", "ss", szSiteDownload[fileid], szFileDownload[fileid]);
- fremove(stmpHeCK);
- }
- }
- return true;
- }
- forward OnURlDownloaded(site[], arquivo[]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement