#1

PHP код:
//OnPlayerSpawn
        
new hour,minute,seconds,year,day,month;
        
gettime(hour,minute,seconds);
        
getdate(day,month,year);
    new 
NewLog[100+1000];
    
format(NewLog,sizeof(NewLog),"%s - Level: %d (Last logged in %d/%d/%d %d:%d:%d)",GetName(playerid), pData[playerid][Admin], yearmonthdayhourminuteseconds);
    
LogInLog(NewLog);
    ForEach(
iMAX_PLAYERS)
    {
        if(
pData[playerid][Admin] >= 3)
        {
            
SendClientMessage(i0x00FF0054NewLog);
        }
    } 
When player spawn the server get down why? i mean server automaticly stops
Reply
#2

What's ForEach(i, MAX_PLAYERS)?
Reply
#3

probably its crashing so use crashdetect plugin with third debug value on your script and tell us what being printed in server.log after the shut down / crash.

Crashdetect:
https://sampforum.blast.hk/showthread.php?tid=262796

third debug:
https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply
#4

Quote:
Originally Posted by jlalt
Посмотреть сообщение
probably its crashing so use crashdetect plugin with third debug value on your script and tell us what being printed in server.log after the shut down / crash.

Crashdetect:
https://sampforum.blast.hk/showthread.php?tid=262796

PHP код:
[11:30:12] [joinMartex has joined the server (0:127.0.0.1)
[
11:30:20] [debugServer crashed while executing ZoneX.amx
[11:30:20] [debugAMX backtrace:
[
11:30:20] [debug#0 native fwrite () from samp-server.exe
[11:30:20] [debug#1 0004d844 in public LogInLog (NewLog[]=@00c24ff0 "Martex - Level: 10 (Last logged in 25/4/2017 11:30:20)") at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:3757
[11:30:20] [debug#2 0004e910 in public OnPlayerSpawn (playerid=0) at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:3846
[11:30:21] [debugNative backtrace:
[
11:30:21] [debug#0 77ae7322 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[11:30:21] [debug#1 00498bb8 in ?? () from samp-server.exe
[11:30:21] [debug#2 0040531e in ?? () from samp-server.exe 
third debug:
https://github.com/Zeex/samp-plugin-...ith-debug-info
Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
What's ForEach(i, MAX_PLAYERS)?
Код:
#define ForEach(%0,%1) \
	for(new %0 = 0; %0 != %1; %0++) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))
Reply
#5

PHP код:
LogInLog(NewLog); 
->
PHP код:
[11:30:20] [debug#0 native fwrite () from samp-server.exe 
You're trying to write inside a file which doesn't exist!

https://sampwiki.blast.hk/wiki/Fwrite
Quote:

Using an invalid handle will crash your server! Get a valid handle by using fopen or ftemp.

so go on LogInLog function and see which file it writes on it and create it manually!
Reply
#6

so should i type the folder name InLog or the file which inside the folder wish is logs.log
Reply
#7

Quote:
Originally Posted by Loinal
Посмотреть сообщение
so should i type the folder name InLog or the file which inside the folder wish is logs.log
the file which this function writes in it seems to be not created yet so all you have to do it creating it. [ ex create .txt file then change its name extension ]
Reply
#8

Quote:
Originally Posted by jlalt
Посмотреть сообщение
the file which this function writes in it seems to be not created yet so all you have to do it creating it. [ ex create .txt file then change its name extension ]
PHP код:
forward LogInLog(NewLog[]);
public 
LogInLog(NewLog[])
{
    new 
Log[100+1000];
    
format(Log,sizeof(Log),"%s"NewLog);
    new 
File:hFile;
    
hFile fopen("InLogs/login.log");
    
fwrite(hFileLog);
    
fclose(hFile);

Reply
#9

go to script files folder see if there's a folder called InLogs if no then create it and also be sure login.log file exist inside it.
Reply
#10

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)