SA-MP Forums Archive
Restart crash - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Restart crash (/showthread.php?tid=125884)



Restart crash - RenisiL - 06.02.2010

Hello me problem as the server restart the people to join the restart they receive a crash

OnGameModeExit call'back
Код:
public OnGameModeExit()
{
	KillTimer(AFKLaikmatis);
	TextDrawHideForAll(Uknowcmd);
	TextDrawDestroy(Uknowcmd);
	TextDrawHideForAll(Teleportas);
	TextDrawDestroy(Teleportas);
	TextDrawHideForAll(Textdrawas0);
	TextDrawDestroy(Textdrawas0);
	TextDrawHideForAll(Textdrawas1);
	TextDrawDestroy(Textdrawas1);
	TextDrawHideForAll(Textdrawas2);
	TextDrawDestroy(Textdrawas2);
	TextDrawHideForAll(Textdrawas3);
	TextDrawDestroy(Textdrawas3);
	TextDrawHideForAll(Textdrawas4);
	TextDrawDestroy(Textdrawas4);
	TextDrawHideForAll(Textdrawas5);
	TextDrawDestroy(Textdrawas5);
	TextDrawHideForAll(DmPalikti);
	TextDrawDestroy(DmPalikti);
	TextDrawHideForAll(ParkourText);
	TextDrawDestroy(ParkourText);
	TextDrawHideForAll(Textdraw0);
	TextDrawDestroy(Textdraw0);
  for(new i = 0;i < MAX_PLAYERS; i++)
  {
  		TextDrawHideForPlayer(i,LVL[i]);
  		TextDrawHideForPlayer(i,Textdraw1[i]);
  		
    new file[256];
		format(file,sizeof(file),"/Vartotojai/%s.ini", PlayerName(i));
	  PlayerData[i][Lygis] = dini_Int(file, "Lygis");
 	  PlayerData[i][exp] = dini_Int(file, "exp");
    PlayerData[i][VIP] = dini_Int(file, "VIP");
	  PlayerData[i][AdminLevel] = dini_Int(file, "AdminLevel");
	  PlayerData[i][Nuzudymai] = dini_Int(file, "Nuzudymai");
	  PlayerData[i][Mirtys] = dini_Int(file, "Mirtys");
  }
  for(new i = 0; i < sizeof(ParkourCheckpoints); i++)
	{
	  DestroyPickup(ParkourPickups[i]);
	}
	for(new i = 0; i < 30; i++)
	{
	  DestroyObject(ParkourObjects[i]);
	}
	DestroyVehicle(bmx1);
	DestroyVehicle(bmx2);
	DestroyVehicle(bmx3);
	DestroyVehicle(bmx4);
	return 1;
}
What here wrong?


Re: Restart crash - nastoe - 06.02.2010

What you have on OnPlayerConnect and what is say in server_log


Re: Restart crash - Rac3r - 06.02.2010

We use a lot of Textdraws at AdrenalineX, timeouts on GMX have improved by limiting functions when the server starts.

Possible problems with your script:
Destroying vehicles on gamemode exit is pointless (I think), because they will be destroyed anyway.
Destroying pickups on gamemode exit is pointless (I think), because they will be destroyed anyway.
Destroying objects on gamemode exit is pointless (I think), because they will be destroyed anyway.
You don't check if player is logged in before saving accounts.
When you GMX, players disconnect (so saving is used twice [once on gmx, once on disconnect])