Problem with OnPlayerRequestDownload - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with OnPlayerRequestDownload (
/showthread.php?tid=664653)
Problem with OnPlayerRequestDownload -
ShadowMortar - 06.03.2019
I'm having a problem with OnPlayerRequestDownload.
I've artwork 1 defined in server.cfg, but the download does not redirect.
Код:
new SERVER_DOWNLOAD[] = "https://github.com/SORRY?CENSORED?/FILES";
public OnPlayerRequestDownload(playerid, type, crc)
{
if(!IsPlayerConnected(playerid)) return 0;
new asdas[64], filefound, final_url[256];
if(type == DOWNLOAD_REQUEST_TEXTURE_FILE) filefound = FindTextureFileNameFromCRC(crc, asdas, sizeof(asdas));
else if(type == DOWNLOAD_REQUEST_MODEL_FILE) filefound = FindModelFileNameFromCRC(crc, asdas, sizeof(asdas));
if(filefound)
{
format(final_url, sizeof(final_url), "%s/%s", SERVER_DOWNLOAD, asdas);
RedirectDownload(playerid, final_url);
printf("%s HAS STARTED DOWNLOADING ALL FILES FROM %s", PlayerOOCName(playerid), SERVER_DOWNLOAD);
}
return 1;
}
My server.log is empty.
Can you help me, thanks.
Re: Problem with OnPlayerRequestDownload -
TokicMajstor - 06.03.2019
If SERVER_DOWNLOAD is a string why it hasn't size [ new SERVER_DOWNLOAD[128]; ]
Re: Problem with OnPlayerRequestDownload -
SymonClash - 06.03.2019
https://sampforum.blast.hk/showthread.php?tid=656282