04.03.2011, 09:48
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[128], Float:x, Float:y, Float:z;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(file, "WantedLevel",GetPlayerWantedLevel(playerid));
dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
dini_IntSet(file, "Cop", PlayerInfo[playerid][pCop]);
dini_IntSet(file, "Civilian", PlayerInfo[playerid][pCivilian]);
dini_IntSet(file, "FirstTime", PlayerInfo[playerid][pFirstTime] = 1);
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "posX", x);
dini_FloatSet(file, "posY", y);
dini_FloatSet(file, "posZ", z);
}
gPlayerLogged[playerid] = 0;
return 1;
}