Server Crash ..idk why (new evidences)
#5

Check out OnPlayerDisconnect
Код:
public OnPlayerDisconnect(playerid, reason)
{
	forceFinishRace(playerid);

	if ( Admin[playerid] )
		OnlineAdmins--;

	if (LoggedIn[playerid] == 1)
	{
		new year,month,day; getdate(year, month, day);
		new hour,minute,second; gettime(hour, minute, second);
		new strdate[30];
		format(strdate, sizeof(strdate),"%d/%d/%d %02d:%02d",day,month,year,hour,minute);

		new name[256],Ip[24];GetPlayerIp(playerid,Ip,24);
		GetPlayerName(playerid, name, sizeof(name));
		strins(name,"users/",0);
		new cash = GetPlayerMoney(playerid);
		new score = GetPlayerScore(playerid);
		//new query[256];
		//format(query, sizeof(query), "UPDATE players SET money='%d', score='%d', is_online=0, last_activity='%s' WHERE LOWER(name)=LOWER('%s')", cash, score, strdate, name);
        //score, money, admin_level, togteles, togdms, godmode, jails, kicks, bans
		dini_Set(name,"IP",Ip);
		dini_Set(name,"LastOn",strdate);
		dini_IntSet(name,"score",score);
		dini_IntSet(name,"money",cash);
		dini_IntSet(name,"admin_level",Admin[playerid]);
		dini_IntSet(name,"Skin",PlayerSkin[playerid]);
		dini_IntSet(name,"togteles",Telemsg[playerid]);
		dini_IntSet(name,"togdms",Togdms[playerid]);
		dini_IntSet(name,"godmode",Godmode[playerid]);
	}
	PlayerRaceOR[playerid] = 0;
	PlayerJoinedOR[playerid] = 0;
	PlayerRaceDrift[playerid] = 0;
	PlayerJoinedDrift[playerid] = 0;
	PlayerRaceMon[playerid] = 0;
	PlayerJoinedMon[playerid] = 0;
	PlayerRaceDrag[playerid] = 0;
	PlayerJoinedDrag[playerid] = 0;
	PlayerRaceLV[playerid] = 0;
	PlayerJoinedLV[playerid] = 0;
	PlayerJoinedRace[playerid] = 0;
	PlayerRaceCount[playerid] = 0;
	raceJoined[playerid] = 0;
	Jails[playerid] = 0;
	Kicks[playerid] = 0;
	Bans[playerid] = 0;
	MarkX[playerid] = 0;
	MarkY[playerid] = 0;
	MarkZ[playerid] = 0;
	MarkA[playerid] = 0;
	DMMini[playerid] = 0;
	MarkI[playerid] = 0;
	SpecBy[playerid] = 0;
	Cashpickup[playerid] = 0;
	PlayerBeingSpeced[playerid] = 0;
	Lastmsg1[playerid] = 0;
	Lastmsg2[playerid] = 0;
	Lastmsg3[playerid] = 0;
	DMArena[playerid] = 0;
	Ramp[playerid] = 0;
	Drift1Race[playerid] = 0;
	Drift2Race[playerid] = 0;
	Drift3Race[playerid] = 0;
	Race1Arena[playerid] = 0;
	Race2Arena[playerid] = 0;
	togpms[playerid] = 0;
	Mute[playerid] = 0;
	Jail[playerid] = 0;
	LoggedIn[playerid] = 0;
	Admin[playerid] = 0;
	God[playerid] = 0;
	doAnimation[playerid] = 0;
	Godmode[playerid] = 0;
	Telemsg[playerid] = 0;
	Togdms[playerid] = 0;
	Freeze[playerid] = 0;
	PlayerSkin[playerid]=(-1);
    SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000); // Bounderies Off
    
	new string[128];
	switch(reason)
	{
		case 0: format(string, 128, "%s(%d) {94F28F}has left the server [ REASON: {FFFFFF}Crash {94F28F}]", GetPlayerNameEx(playerid), playerid);
		case 1: format(string, 128, "%s(%d) {94F28F}has left the server [ REASON: {FFFFFF}Leaving {94F28F}]", GetPlayerNameEx(playerid), playerid);
		case 2: format(string, 128, "%s(%d) {94F28F}has left the server [ REASON: {FFFFFF}Kick/Ban {94F28F}]", GetPlayerNameEx(playerid), playerid);
	}
	SendClientMessageToAll(white, string);
	return 1;
}
May this be the problem?!
Reply


Messages In This Thread
Server Crash ..idk why (new evidences) - by Paul.eboy - 12.04.2011, 16:09
Re: Server Crash ..idk why (new evidences) - by Ash. - 12.04.2011, 16:12
Re: Server Crash ..idk why (new evidences) - by Mauzen - 12.04.2011, 17:16
Re: Server Crash ..idk why (new evidences) - by Vince - 12.04.2011, 20:23
Re: Server Crash ..idk why (new evidences) - by Paul.eboy - 13.04.2011, 17:17
Re: Server Crash ..idk why (new evidences) - by [M.A]Angel[M.A] - 13.04.2011, 19:33
Re: Server Crash ..idk why (new evidences) - by Paul.eboy - 14.04.2011, 04:03
Re: Server Crash ..idk why (new evidences) - by Tenshi - 14.04.2011, 05:02

Forum Jump:


Users browsing this thread: 2 Guest(s)