How can i read a file and get a line from that file.
#5

pawn Код:
stock GetAdminLevel(playerid)
{
    new name[64];
    GetPlayerName(playerid, name, sizeof name);
    format(name, sizeof name, "ladmin/users/%s.sav", name);

    new File:file = fopen("file.sav", io_read), line[128];
    while(fread(file, line))
    {
        new first = strfind(line, "=", true);
        if(strcmp(line, "level", true, first) == 0)
        {
            new value[32];
            strmid(value, line, first + 1, strlen(line));
            return strval(value);
        }
    }
    return 0;
}
ok when i use this the server doesnt load, so ahow can i fix it to make it load properly and read the file?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)