29.06.2016, 19:21
PHP код:
Log(type, string[], group = -1)
{
new File:logfile, logstring[300];
format(logstring, sizeof(logstring), "[%s] %s\r\n", GetDateFormat(gettime(), 2), string);
switch(type)
{
case 0: // Server
{
logfile = fopen("Logs/Server.log", io_append);
fwrite(logfile, logstring);
fclose(logfile);
}
}
}
-------------------------
Quote:
Quote:
Yes I have chmodded my entire SA:MP directory to 777, that is not the issue.
|
Quote:
But it is a terribly bad idea. Besides, if the file exists in the folder but the server does not have permission to write in it then it can still be the issue. Execute these commands in the main server directory:
Код:
whoami Код:
ls -la Код:
ls -la scriptfiles |
PHP код:
root@---:~/SAMP# whoami
root
root@---:~/SAMP# ls -la
total 4376
drwxrwxrwx 6 root root 4096 Jun 29 14:47 .
drwxrwxrwx 6 root root 4096 Jun 27 01:26 ..
-rwxrwxrwx 1 root root 10936 Jan 24 2015 announce
drwxrwxrwx 2 root root 4096 Jun 24 02:55 filterscripts
drwxrwxrwx 2 root root 4096 Jun 24 03:12 gamemodes
-rwxrwxrwx 1 root root 2387912 Jun 19 2010 libmysqlclient.so.15
-rwxrwxrwx 1 root root 3777 Aug 9 2010 LICENSE
drwxrwxrwx 2 root root 4096 Jun 29 14:40 plugins
-rwxrwxrwx 1 root root 1416792 Jul 14 2015 samp03svr
-rwxrwxrwx 1 root root 591652 Jul 11 2015 samp-npc
drwxrwxrwx 3 root root 4096 Jun 29 14:20 scriptfiles
-rwxrwxrwx 1 root root 393 Jun 29 14:42 server.cfg
-rwxrwxrwx 1 root root 309 Jun 24 03:42 server.cfg.save
-rwxrwxrwx 1 root root 18987 Jun 29 14:59 server_log.txt
root@---:~/SAMP# ls -la scriptfiles
total 12
drwxrwxrwx 3 root root 4096 Jun 29 14:20 .
drwxrwxrwx 6 root root 4096 Jun 29 14:47 ..
drwxrwxrwx 2 root root 4096 Jun 29 14:20 Logs