[HELP] fread problem...
#1

Here is code and It somewhy doesn`t work at all. I created file and wrote my name inside, but the problem still exists
pawn Код:
#include <a_samp>

public OnFilterScriptInit()
{
    new BP_String[64];
    print("\n\t********************\n\tFilterScript Launched\n\tList Of Banned Players:\n");
    new File:BP = fopen("Banned_Players.txt", io_read);
    new num = 0;
    while(fread(BP, BP_String))
    {
        num++;
        printf("\t%i - %s", num, BP_String);
    }
    print("\t********************\n");
    fclose(BP);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has joined the server.", name);
    new BP_String[64];
    new File:BP = fopen("Banned_Players.txt", io_read);
   
    while(fread(BP, BP_String))
    {
        if(strcmp(BP_String, name, true) == 0)
        {
            Kick(playerid);
        }
    }
    fclose(BP);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)