/seebugs cmd
#2

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;
}
Reply


Messages In This Thread
/seebugs cmd - by SHoCK44 - 13.06.2015, 12:02
Re: /seebugs cmd - by Yashas - 14.06.2015, 05:30
Re: /seebugs cmd - by Konstantinos - 14.06.2015, 10:37
Re: /seebugs cmd - by shocktheripper - 15.06.2015, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)