06.08.2016, 15:44
The folder must exist and you don't check if the file handle is valid. If it is not and it is used in a file function, that function will crash the server.
Returning any value inside a loop breaks, thus won't be sent to the rest of the admins. Creating a string inside a loop is also bad.
pawn Code:
Admin(const string[])
{
new File: hFile = fopen("ServerInfo/log.log", io_append);
if (!hFile) return; // invalid handle, don't proceed
fwrite(hFile, string);
fwrite(hFile, "\r\n");
fclose(hFile);
}
Quote:
Try this
PHP Code:
|