17.06.2011, 20:45
(
Последний раз редактировалось =WoR=Varth; 18.06.2011 в 01:00.
)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new files[48],message[48];
format(files,sizeof(files),"Last log/%s.ini",Name());
new INI:file = INI_Open(files);
format(message,sizeof(message),"%s",TimeDate());
INI_WriteString(file,"Logged off",message);
INI_Close(file);
return 1;
}
pawn Код:
Name()
{
new n[MAX_PLAYER_NAME];
foreach (Player,i) GetPlayerName(i,n,MAX_PLAYER_NAME);
return n;
}
I know some people said "It's not a good idea to save in OnPlayerDisconnect" but as ****** said:
Quote:
I've never heard of any issues using OnPlayerDisconnect either. The only one issue you COULD have is if the server crashes, but that's got nothing to do with OnPlayerDisconnect (and neither does lag so I don't know why it was even mentioned as an argument). |