28.03.2011, 22:11
Even better.
When the player logins in
Here is the 1st 14 lines of mine
pawn Код:
new FileSave[20]
pawn Код:
FileSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid)
pawn Код:
forward Save(playerid)
public Save(playerid)
{
//Then put the dini stuff in here
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(FileSave[playerid);
return 1;
}
pawn Код:
public Save(playerid)
{
if(Logged[playerid] == 1 && Spawned[playerid] == 1 && IsSpecing[playerid] == 0 && !IsPlayerNPC(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file, sizeof(file), USER_FILES, Name);
if(dini_Exists(file))
{
dini_IntSet(file, "Cash", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
}
}
return 1;
}