SA-MP Forums Archive
Reading A Briefcase error. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Reading A Briefcase error. (/showthread.php?tid=585574)



Reading A Briefcase error. - iTakelot - 15.08.2015

Guys I wanted to read the banned folder, and then show me, but when I type the command the server closes on time if anyone knows WHAT could be happening please help me.

PHP код:
//Comando para exibir a lista de banidos.
CMD:banidos(playeridparams[]){
    
Ler("Players_Banidos"playerid); printf("lendo banidos");
    return 
1;

PHP код:
//Stock que faz a leitura
stock Ler(name[], playerid)
{
    new 
nomes[255];
    new 
File:archive;
    
archive fopen(nameio_read);
    while(
fread(archivenomes))
        
SendClientMessage(playerid0xFFFFFFFFnomes);
    
fclose(archive);




Re: Reading A Briefcase error. - Weponz - 15.08.2015

pawn Код:
//Stock que faz a leitura
stock Ler(name[], playerid)
{
    new nomes[255];
    new File:archive;
    archive = fopen(name, io_read);
    while(fread(archive, nomes))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, nomes);
        fclose(archive);
    }
    return 1;
}
Try this.


Re: Reading A Briefcase error. - iTakelot - 15.08.2015

@WeponZ

Not work, have another way to read files and send WHAT is in it for you in the message?


Re: Reading A Briefcase error. - Weponz - 15.08.2015

pawn Код:
//Stock que faz a leitura
stock Ler(name[], playerid)
{
    new nomes[255];
    new File:archive;
    archive = fopen(name, io_read);
    while(fread(archive, nomes))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, nomes);
    }
    fclose(archive);
    return 1;
}
Wait try this.


Re: Reading A Briefcase error. - iTakelot - 15.08.2015

in will mano, it turns off immediately. of to of using dof2?


Re: Reading A Briefcase error. - Weponz - 15.08.2015

Does the file exist? If you use io_read and the file doesn't exist, it will return a NULL reference.

EDIT:

Also change to this:

pawn Код:
CMD:banidos(playerid, params[]){
    Ler("Players_Banidos.txt", playerid); printf("lendo banidos");
    return 1;
}



Re: Reading A Briefcase error. - iTakelot - 15.08.2015

There yes, I checked it first ta everything right the folder with the name and banned inside.


Re: Reading A Briefcase error. - Weponz - 15.08.2015

Make sure the file is a .txt extension.


Re: Reading A Briefcase error. - iTakelot - 15.08.2015

Is not .txt, it is a folder inside another folder. :O


Re: Reading A Briefcase error. - Weponz - 15.08.2015

fread can only read files from scriptfiles.