10.10.2011, 17:06
Hi. Two hours ago I scripted a SaveAccount for my new GameMode RP. I use SII and my SaveAccount is:
I insert it into callback OnPlayerDisconnect, but when the Server crash Skin, Money and Pos = 0. So in my account's file Skin, Money and Pos are 0. Why?
IMPORTANT: When the Player logout, SaveAccount is good!
pawn Код:
if(INI_Exist(PlayerInfo[playerid][Account]))
{
new Float: Pos[4], Float: Vita, Float: Armatura, soldi = GetPlayerMoney(playerid);
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
GetPlayerHealth(playerid, Vita);
GetPlayerArmour(playerid, Armatura);
INI_Open(PlayerInfo[playerid][Account]);
INI_WriteInt("Soldi", soldi); // Money
INI_WriteInt("Skin", PlayerInfo[playerid][Skin]);
INI_WriteFloat("Vita", Vita); // HP
INI_WriteFloat("Armatura", Armatura); // Armour
if(PlayerInfo[playerid][SpawnCase] == 1)
{
INI_WriteFloat("SpawnX", Pos[0]);
INI_WriteFloat("SpawnY", Pos[1]);
INI_WriteFloat("SpawnZ", Pos[2]);
INI_WriteFloat("SpawnA", Pos[3]);
INI_WriteInt("InteriorSpawn", GetPlayerInterior(playerid));
INI_WriteInt("WorldSpawn", GetPlayerVirtualWorld(playerid));
}
INI_WriteInt("Droga", PlayerInfo[playerid][Droga]); // Other...
INI_WriteInt("Materiali", PlayerInfo[playerid][Materiali]);
INI_WriteInt("Fazione", PlayerInfo[playerid][Fazione]);
INI_WriteInt("Rank", PlayerInfo[playerid][Rank]);
INI_WriteInt("TempoJail", PlayerInfo[playerid][TempoJail]);
INI_WriteInt("BigliettoTreno", PlayerInfo[playerid][BigliettoTreno]);
INI_Save();
INI_Close();
}
return 1;
IMPORTANT: When the Player logout, SaveAccount is good!