SA-MP Forums Archive
[Ajuda] io_read - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] io_read (/showthread.php?tid=601531)



io_read - Lucas_HenryK - 22.02.2016

PHP Code:
stock readLog(playerid color filename []) {
    new
        
str 128 ],
        
readString 128 ],
        
FilelogFile;
    if(!
fexist(filename))
        return 
format(str 70 "Archive %s not found." filename) , SendClientMessage(playerid color str);
    
logFile fopen(filename io_read);
    while(
fread(logFile readString)) {
        
format(str sizeof str " {FF0000}%s"readString);
        
SendClientMessage(playerid color str);
    }
    return 
1;

como posso por pra ler somente as ultimas 10 linhas?