30.11.2011, 18:21
Well , I Wanted that when the Player logoff his Location Saves - And i am using Y_ini - So i did the Following :
Under OnPlayerDisconnect
And under LoadUser_data :
And..
But it don't save - Any Solutions ?
Under OnPlayerDisconnect
PHP код:
INI_WriteInt(File,"Health",PlayerInfo[playerid][pHealth]);
INI_WriteInt(File,"Armor",PlayerInfo[playerid][pArmor]);
INI_WriteInt(File,"SPos_x",PlayerInfo[playerid][pSPos_x]);
INI_WriteInt(File,"SPos_y",PlayerInfo[playerid][pSPos_y]);
INI_WriteInt(File,"SPos_z",PlayerInfo[playerid][pSPos_z]);
INI_WriteInt(File,"SPos_r",PlayerInfo[playerid][pSPos_r]);
INI_WriteInt(File,"Int",PlayerInfo[playerid][pInt]);
PHP код:
INI_Int("Health",PlayerInfo[playerid][pHealth]);
INI_Int("Armor",PlayerInfo[playerid][pArmor]);
INI_Int("Int",PlayerInfo[playerid][pInt]);
INI_Int("SPos_x",PlayerInfo[playerid][pSPos_x]);
INI_Int("SPos_y",PlayerInfo[playerid][pSPos_y]);
INI_Int("SPos_z",PlayerInfo[playerid][pSPos_z]);
INI_Int("SPos_r",PlayerInfo[playerid][pSPos_r]);
PHP код:
public SetPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
SetCameraBehindPlayer(playerid);
return 1;
}