29.07.2013, 03:58
pawn Код:
public OnPlayerConnect(playerid)
{
// Verificaзгo de conta existente
new
sNome[MAX_PLAYER_NAME],
sStr[30],
sHello[128],
sDate[20]
;
GetPlayerName(playerid, sNome, sizeof(sNome));
format(sStr, 30, "%s.ini", sNome);
if(fexist(sStr))
{
INI_Open(sStr);
INI_ReadString(sDate, "LastEntry");
INI_Close();
}
format(sHello, 128, "Ultimo login: %s", sDate); // adicionar isso ao dialog.
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
//save data
new
sDia,
sMes,
sAno,
sNome[MAX_PLAYER_NAME],
sStr[30],
sDate[20]
;
getdate(ano, mes, dia);
GetPlayerName(playerid, sNome, sizeof(sNome));
format(sStr, 30, "%s.ini", sNome);
format(sDate, 20, "%d/%d/%d", sDia,sMes,sAno);
INI_Open(sStr);
INI_WriteString("LastEntry", sDate);
INI_Save();
INI_Close();
return 1;
}
foi feito com SII.

