SA-MP Forums Archive
Why is my server closing when a player disconnects? - 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: Why is my server closing when a player disconnects? (/showthread.php?tid=598932)



Why is my server closing when a player disconnects? - AndreiWow - 18.01.2016

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:file = INI_Open(Path(playerid));
    INI_SetTag(file,"Player's Data");
	INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
	INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
	INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
	INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
	INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
	INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
	INI_Close(file);
	if (GetPVarInt(playerid, "Renting") == 1)
		IsRented[GetPVarInt(playerid, "CarRentID")] = 0,
		SetVehicleToRespawn(GetPVarInt(playerid, "CarRentID"));
	DeletePVar(playerid, "Renting");
	DeletePVar(playerid, "CarRentID");
	TextDrawHideForPlayer(playerid, money[0]);
	TextDrawHideForPlayer(playerid, money[1]);
	TextDrawHideForPlayer(playerid, money[2]);
	TextDrawHideForPlayer(playerid, money[3]);
	
	SaveInventory(playerid);
	for(new i =0;i<MAX_INVENTOY_SLOTS;i++) PlayerTextDrawDestroy(playerid,InvItem[i]);
	for(new i=0;i<14;i++) PlayerTextDrawDestroy(playerid,Inventory[i]);
	
	PlayerTextDrawDestroy(playerid,TabletWin8UserLog2);
	PlayerTextDrawDestroy(playerid,TabletWin8Pag2);
	for(new i = 0; i < 4; i++) PlayerTextDrawDestroy(playerid,Escritorio[i]);
	for(new i = 0; i < 2; i++) PlayerTextDrawDestroy(playerid,TabletTime[i]);
	for(new i = 0; i < 3; i++) PlayerTextDrawDestroy(playerid,TabletWeather[i]);
	for(new i = 0; i < 5; i++) PlayerTextDrawDestroy(playerid,Tragaperras[i]);
	return 1;
}



Re: Why is my server closing when a player disconnects? - AndreiWow - 18.01.2016

Ah, fixed, I had to add a folder to save...