samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed.
#1

Fixed it I suppose thanks to ViruZz!
Reply
#2

pawn Код:
AjailLog(string);
Post the "AjailLog" function.

Could be overbuffer from the file variable.
Reply
#3

Fixed it I suppose thanks to ViruZz!
Reply
#4

Quote:
Originally Posted by SilmiK
Посмотреть сообщение
pawn Код:
funktsioon AjailLog(string[])
{
    new entry[256];
    format(entry, sizeof(entry), "%s\r\n",string);
    new File:hFile;
    hFile = fopen("GM/Logs/Ajail.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
    return 1;
}
Try this

pawn Код:
stock AjailLog(string[])
{
    new szEntry[256], szFile: logfile;
   
    format(szEntry, sizeof(szEntry), "%s\r\n", string);

    if(logfile)
    {  
        fclose(logfile);
    }
    if(!fexist("GM/Logs/Ajail.log"))
    {
        logfile = fopen("GM/Logs/Ajail.log", io_write);
    }
    else {
        logfile = fopen("GM/Logs/Ajail.log", io_append);
    }
   
    if(logfile)
    {
        fwrite(logfile, szEntry);
        fclose(logfile);
    }
    return 1;
}
It's because you're using Linux as your platform so the variable must be opened already with a previous file AKA overbuffer.
Reply
#5

Quote:

(12862) : warning 213: tag mismatch
(12866) : warning 213: tag mismatch
(12869) : warning 213: tag mismatch
(12874) : warning 213: tag mismatch
(12875) : warning 213: tag mismatch

These lines are:
Quote:

fclose(logfile);
logfile = fopen("GM/Logs/Ajail.log", io_write);
logfile = fopen("GM/Logs/Ajail.log", io_append);
fwrite(logfile, szEntry);
fclose(logfile);

Reply
#6

Quote:
Originally Posted by SilmiK
Посмотреть сообщение
These lines are:
I failed, I just gave you my custom File identifier.

Replace

pawn Код:
szFile: logfile
With

pawn Код:
File: logfile
Reply
#7

Okay.

I guess I also found out what may had caused the issue aswell. I still rather write the logging functions as you've showed out here. Thanks!

I will +rep you right away.
Reply
#8

Quote:
Originally Posted by SilmiK
Посмотреть сообщение
Okay.

I guess I also found out what may had caused the issue aswell. I still rather write the logging functions as you've showed out here. Thanks!

I will +rep you right away.
No problem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)