PlayTime
#6

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;
}
Reply


Messages In This Thread
PlayTime - by kalanerik99 - 29.11.2013, 17:07
Re: PlayTime - by xVIP3Rx - 29.11.2013, 17:11
Re: PlayTime - by Konstantinos - 29.11.2013, 17:12
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:25
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:33
Re: PlayTime - by xVIP3Rx - 29.11.2013, 17:43
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:47
Re: PlayTime - by Konstantinos - 29.11.2013, 17:48
Re: PlayTime - by kalanerik99 - 29.11.2013, 18:05
Re: PlayTime - by Konstantinos - 29.11.2013, 18:11

Forum Jump:


Users browsing this thread: 2 Guest(s)