SA-MP Forums Archive
If the server crashed.. - 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: If the server crashed.. (/showthread.php?tid=484727)



If the server crashed.. - MahdiGames - 01.01.2014

Hi, if the server crashed everyday 1 time with out reason i mean no logs no crash detects iv VPS , what could that be?
That before and after moments from the crash
OnPlayerDeath CODE IN GM:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    if( IsPlayerConnected( killerid ) )
    {
        if( IsPlayerConnected( GetPVarInt( playerid, "LastKilled" ) ) && GetPVarInt( playerid, "LastKilled" ) == killerid )
        {
            if( ( GetPVarInt( playerid, "LastKilledTickcount" ) - GetTickCount( ) ) < 500 )
            {
                SetPVarInt( playerid, "LastKilledTick", GetPVarInt( playerid, "LastKilledTick" ) + 1 );
                if( GetPVarInt( playerid, "LastKilledTick" ) > 1 ) Kick( playerid );
            }
            SetPVarInt( playerid, "LastKilledTickcount", GetTickCount( ) );
        }
        SetPVarInt( playerid, "LastKilled", killerid );
    }
	if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1) Ban(playerid);
	SetPVarInt(playerid,"PlayerLastDeath",gettime());*/

	//EndfunAntiFakeKill
	SendDeathMessage(killerid, playerid, reason);
	TotalKills[killerid]++;
	TotalDeaths[playerid]++;
    new file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME];
    new KilledByName[MAX_PLAYER_NAME];
	GetPlayerName(giveplayerid, name, sizeof(name));
	GetPlayerName(playerid,Name,sizeof(Name));
	GetPlayerName(killerid,KilledByName,sizeof(KilledByName));
	WhoKilledYou[playerid] = KilledByName;
	GetPlayerIp(playerid,Ip,sizeof(Ip));
	format(file,sizeof(file),PlayerFile,Name);
	if(IsPlayerConnected(killerid)) {

			//SetPlayerWantedLevel(killerid, (GetPlayerWantedLevel(killerid) + 1));
	    	GameTextForPlayer(killerid,"~w~+2 Score~R~~N~+2 kill~N~ ~g~+1000$", 5000, 1);
	    	SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
	}
	//SetPlayerWantedLevel(playerid, 0);
	if( DMZone[killerid] >= 1)
	{
		GivePlayerMoney(killerid, 1000);
		GivePlayerMoney(playerid, -1000);
		SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
//	    GameTextForPlayer(playerid, "~r~~N~~N~~N~~N~~N~~N~YOUR KILLER~N~~W~RESPAWN AFTER ~R~5 ~W~SECONDS..", 5000, 5);
		PlayCrimeReportForPlayer(killerid, killerid, 3);
	}
	if( DMZone[killerid] == 0)
	{
		GivePlayerMoney(killerid, 1000);
		GivePlayerMoney(playerid, -1000);
        SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
		PlayCrimeReportForPlayer(killerid, killerid, 3);
//	    GameTextForPlayer(playerid, "~r~~N~~N~~N~~N~~N~~N~YOUR KILLER~N~~W~RESPAWN AFTER ~R~5 ~W~SECONDS..", 5000, 5);
	}
	return 1;
    }
I got that in CrashDetector please help! (when i do /kill)
Код:

[14:43:45]+ [debug] AMX backtrace:
[14:43:45]+ [debug] #0 00033ff4 in public OnPlayerDeath (0x00000000, 0x0000ffff, 0x000000ff) from SPA.amx
[14:43:45]+ [death] Mahdi died 255
[14:43:49]+ [debug] Run time error 4: "Array index out of bounds"
[14:43:49]+ [debug]  Accessing element at index 65535 past array upper bound 499
[14:43:49]+ [debug] AMX backtrace:
[14:43:49]+ [debug] #0 00033ff4 in public OnPlayerDeath (0x00000000, 0x0000ffff, 0x000000ff) from SPA.amx
[14:43:49]+ [death] Mahdi died 255



Re: If the server crashed.. - Mey6155 - 01.01.2014

Well... Maybe contact one of the high commands of you're VPS.


Re: If the server crashed.. - NikO1 - 01.01.2014

Get the plugin crashdetect it will find the problem.


Re: If the server crashed.. - MahdiGames - 01.01.2014

Quote:
Originally Posted by NikO1
Посмотреть сообщение
Get the plugin crashdetect it will find the problem.
I m using it , i tried to use all the detecting crash nothing help


Re: If the server crashed.. - NikO1 - 01.01.2014

How does it crash like what happens.


Re: If the server crashed.. - MahdiGames - 01.01.2014

Well, its linux host VPS ,server just got offline in different times and iv to start it again from control panel


Re: If the server crashed.. - Konstantinos - 01.01.2014

The version for the plugins sscanf and crashdetect is old. It may also be an old version for the rest of the plugins that doesn't say the version in the console so make sure that every plugin and include is updated.

Crashdetect: https://github.com/Zeex/samp-plugin-...ases/tag/v4.12
Sscanf: https://sampforum.blast.hk/showthread.php?tid=120356


Re: If the server crashed.. - MahdiGames - 01.01.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The version for the plugins sscanf and crashdetect is old. It may also be an old version for the rest of the plugins that doesn't say the version in the console so make sure that every plugin and include is updated.

Crashdetect: https://github.com/Zeex/samp-plugin-...ases/tag/v4.12
Sscanf: https://sampforum.blast.hk/showthread.php?tid=120356
Thank you , i will try i dont know but if the problem from the gm should be show that in logs?


Re: If the server crashed.. - MahdiGames - 01.01.2014

I got that now
Код:
[12:34:14]+ [debug] Run time error 5: "Invalid memory access"
[12:34:14]+ [debug] AMX backtrace:
[12:34:14]+ [debug] #0 00006da0 in public OnPlayerConnect () from AdminSystem.amx



Re: If the server crashed.. - Konstantinos - 01.01.2014

You may need to re-compile your scripts with debug info (-d3) for more details related to the runtime error: https://github.com/Zeex/samp-plugin-...ith-debug-info

It's not a runtime error that I know very well and according to this: https://sampforum.blast.hk/showthread.php?tid=482429

you will most likely need to debug your code in OnPlayerConnect manually (printing message line by line to see where the code stops etc).

EDIT:

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

Quote:
Originally Posted by MahdiGames
Посмотреть сообщение
Problem with Connection , after death (SPA is my GM) , thats causing crash to my server please help.
Код:
[12:40:49]+ [join] ShuffleLP has joined the server (5:212.185.222.106)
[12:40:49]+ [debug] Run time error 5: "Invalid memory access"
[12:40:49]+ [debug] AMX backtrace:
[12:40:49]+ [debug] #0 00006da0 in public OnPlayerConnect () from AdminSystem.amx
[12:41:06]+ [debug] Run time error 4: "Array index out of bounds"
[12:41:06]+ [debug]  Accessing element at index 65535 past array upper bound 499
[12:41:06]+ [debug] AMX backtrace:
[12:41:06]+ [debug] #0 00033ff4 in public OnPlayerDeath (0x00000002, 0x0000ffff, 0x000000ff) from SPA.amx
Before using killerid inside brackets [], make sure that is a VALID player.

pawn Код:
// OnPlayerDeath:
if (killerid != INVALID_PLAYER)
{
    // code for killerid
}