23.12.2014, 17:21
okay i solve with those eror but probelem still same if i enter in some interior and then quit game onplayerdissconnect save my pos and interior but when reconect start falling from that interior please help
Update on disconnect :
load on connect :
and on player spawn :
Update on disconnect :
Код:
public OnPlayerDisconnect(playerid, reason) { new query[500], Float:pos[4]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]); new Interior = GetPlayerInterior(playerid); new world = GetPlayerVirtualWorld(playerid); mysql_format(sqlconnect, query, sizeof(query), "UPDATE `accounts` SET `Exp`=%d, `Money`=%d, `pHealth`=%d, `WantedLevel`=%d, `InteriorID`=%d, `World`=%d, `posX`=%f, `posY`=%f, `posZ`=%f, `posA`=%f WHERE `ID`=%d",\ PlayerInfo[playerid][Exp], PlayerInfo[playerid][Money], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][WantedLevel], Interior, world, pos[0], pos[1], pos[2], pos[3], PlayerInfo[playerid][ID]); mysql_tquery(sqlconnect, query, "", ""); return 1; }
Код:
public OnAccountLoad(playerid) { PlayerInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin"); PlayerInfo[playerid][Vip] = cache_get_field_content_int(0, "Vip"); PlayerInfo[playerid][Exp] = cache_get_field_content_int(0, "Exp"); PlayerInfo[playerid][Money] = cache_get_field_content_int(0, "Money"); PlayerInfo[playerid][JobLevel] = cache_get_field_content_int(0, "JobLevel"); PlayerInfo[playerid][JobID] = cache_get_field_content_int(0, "JobID,"); PlayerInfo[playerid][Skin] = cache_get_field_content_int(0, "Skin"); PlayerInfo[playerid][JobSkin] = cache_get_field_content_int(0, "JobSkin"); PlayerInfo[playerid][pTut] = cache_get_field_content_int(0, "pTut"); PlayerInfo[playerid][pSex] = cache_get_field_content_int(0, "pSex"); PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "pAge"); PlayerInfo[playerid][pHealth] = cache_get_field_content_int(0, "pHealth"); PlayerInfo[playerid][pArmor] = cache_get_field_content_int(0, "pArmor"); PlayerInfo[playerid][WantedLevel] = cache_get_field_content_int(0, "WantedLevel"); PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX"); PlayerInfo[playerid][posY] = cache_get_field_content_float(0, "posY"); PlayerInfo[playerid][posZ] = cache_get_field_content_float(0, "posZ"); PlayerInfo[playerid][posA] = cache_get_field_content_float(0, "posA"); PlayerInfo[playerid][RobExp] = cache_get_field_content_int(0, "RobExp"); PlayerInfo[playerid][Teorija] = cache_get_field_content_int(0, "Teorija"); PlayerInfo[playerid][InteriorID] = cache_get_field_content_int(0, "InteriorID"); PlayerInfo[playerid][World] = cache_get_field_content_int(0, "World"); GivePlayerMoney(playerid, PlayerInfo[playerid][Money]); SendClientMessage(playerid, -1, "Sekmingai prisijungete"); return 1; }
Код:
public OnPlayerSpawn(playerid) { SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][World]); SetPlayerInterior(playerid, PlayerInfo[playerid][InteriorID]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][posA]); SetPlayerPos(playerid, PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ]); return 1; }