29.11.2013, 17:43
You can't get the total, In another word, You can't save a variable for a player forever, You have to store the connected time by any method ( INI file - Database ) Then load it again when he connect and add to it again and so on
pawn Код:
public OnPlayerConnect(playerid)
{
pInfo[playerid][ConnectedTime] = gettime();
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new seconds = gettime() - pInfo[playerid][ConnectedTime];
new mins, hour, day;
printf("Player's time = %s seconds", ConvertTime(seconds,mins,hour,day));
return 1;
}