14.06.2015, 05:30
I have given an idea.It is now left to you to improve the code.
Код:
CMD:bugs(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COL_LIGHTRED, "You can't do that.");
new File:handle = fopen("Bugs.txt", io_read);
new string[256],lines = 0,pid = strval(params); //Use sscanf , this code is dangerous
if(fexist("Bugs.txt"))
{
while(fread(handle, string))
{
if(++lines < pid*MAX_LINES_PER_PAGE) continue;
if(lines%MAX_LINES_PER_PAGE)
{
format(string,sizeof(string),"%s\n\r", string);
SendClientMessage(playerid, -1, string);
}
else break;
}
}
else
{
SCM(playerid, COLOR_YELLOW, "There are no bugs.");
}
fclose(handle);
return 1;
}

