OnPlayerDisconnect (Crachdetect)
#6

This code

Код:
stock OnPlayerStatsUpdate(playerid) {
	if(gPlayerLogged{playerid}) {
		/*if(!GetPVarType(playerid, "TempName") && !GetPVarInt(playerid, "EventToken") && GetPVarInt(playerid, "IsInArena") == -1) {
			GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
			GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
			PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
			PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
			GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
			GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_r]);
		}*/
		g_mysql_SaveAccount(playerid);
	}
	return 1;
}
Код:
stock g_mysql_SaveAccount(playerid)
{
	new query[4096];

	format(query, sizeof(query), "UPDATE `accounts` SET \
		`IP` = '%s', \
		`ConnectedTime` = %d, \
	    `PayDay` = %d, \
	    `Age` = %d, \
		`Sex` = %d, \
		`Registered` = %d, \
		`Level` = %d, \
		`AdminLevel` = %d, \
		`Money` = %d, \
		`pHealth` = %f, \
		`pArmor` = %f, \
		`Int` = %d, \
		`VirtualWorld` = %d, \
		`TogReports` = %d, \
		`Origin` = %d,",
		PlayerInfo[playerid][pIP],
		PlayerInfo[playerid][pReg],
		PlayerInfo[playerid][pConnectHours],
		PlayerInfo[playerid][pConnectSeconds],
		PlayerInfo[playerid][pAge],
		PlayerInfo[playerid][pSex],
		PlayerInfo[playerid][pReg],
		PlayerInfo[playerid][pLevel],
		PlayerInfo[playerid][pAdmin],
		GetPlayerCash(playerid),
		PlayerInfo[playerid][pHealth],
		PlayerInfo[playerid][pArmor],
		PlayerInfo[playerid][pInt],
		PlayerInfo[playerid][pVW],
		PlayerInfo[playerid][pTogReports],
		PlayerInfo[playerid][pOrigin]
	);
	
	format(query, sizeof(query), "%s \
		`SPos_x` = %f, \
		`SPos_y` = %f, \
		`SPos_z` = %f, \
		`SPos_r` = %f, \
		`Model` = %d, \
		`Tutorial` = %d \
		WHERE `id` = '%d'",
		query,
		PlayerInfo[playerid][pPos_x],
		PlayerInfo[playerid][pPos_y],
		PlayerInfo[playerid][pPos_z],
		PlayerInfo[playerid][pPos_r],
		PlayerInfo[playerid][pModel],
		PlayerInfo[playerid][pTut],
		GetPlayerSQLId(playerid)
	);

	mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
	return 1;
}
Reply


Messages In This Thread
OnPlayerDisconnect (Crachdetect) - by Kenway - 17.12.2013, 12:44
Re: OnPlayerDisconnect (Crachdetect) - by Tayab - 17.12.2013, 12:48
Re: OnPlayerDisconnect (Crachdetect) - by Kenway - 17.12.2013, 13:01
Re: OnPlayerDisconnect (Crachdetect) - by Kenway - 18.12.2013, 04:51
Re: OnPlayerDisconnect (Crachdetect) - by TheOriginal1337 - 18.12.2013, 11:39
Re: OnPlayerDisconnect (Crachdetect) - by Kenway - 19.12.2013, 05:11
Re: OnPlayerDisconnect (Crachdetect) - by Kenway - 19.12.2013, 11:04
Re: OnPlayerDisconnect (Crachdetect) - by TheOriginal1337 - 19.12.2013, 17:58
Re: OnPlayerDisconnect (Crachdetect) - by andreasbleck - 19.12.2013, 19:05

Forum Jump:


Users browsing this thread: 1 Guest(s)