04.03.2018, 13:33
Estava olhando seu include, tenho algumas sugestхes:
- Renomear OnPlayerStartedDownload para OnPlayerStartedDownloading apenas para concordвncia com OnPlayerFinishedDownloading
- OnPlayerStartedDownload suportar virtualworlds
- Adicionar funзхes para medir a quantidade baixada.(Use estб lуgica abaixo)
PHP код:static
downloadBytes[MAX_PLAYERS],
finishedDownload[MAX_PLAYERS char]
;
public OnPlayerStartedDownload(playerid, virtualworld); {
downloadBytes[playerid] = NetStats_BytesSent(playerid);
}
public OnPlayerFinishedDownloading(playerid, virtualworld) {
downloadBytes[playerid] = GetDownloadedBytes(playerid);
finishedDownload{playerid} = 1;
return 1;
}
GetDownloadedBytes(playerid)
{
if(finishedDownload{playerid})
return downloadBytes[playerid];
return NetStats_BytesSent(playerid) - downloadBytes[playerid];
}
- Agora que temos como medir a quantidade baixada, adicionar tambйm:
- GetDownloadBytesRemaing total_bytes - downloaded_bytes
- GetDownloadSpeed started_time / downloaded_bytes
- GetDownloadTimeRemaing download_speed / bytes_remaing