19.12.2013, 05:11
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; }