Playing hours not working
#6

most simple/efficient/reliable/less memory usage connected time check
NetStats_GetConnectedTime(playerid);

returns the players connected time for the session in milli seconds 1000ms/sec

EX:
(this is just an example and i havent tested it yet but you can use my stock BTW)
pawn Код:
enum PLAYER_ENUM{ // change this to your own enum
pMinutes,
pPlayingHours,
pMilliseconds, // add this one to your player enum
...
}



CMD:mytime(playerid,params[])
{
    new Float:hours,Float:minutes,Float:seconds,msg[128];
    MyTimeInHMS(playerid,hours,minutes,seconds);
    format(msg,sizeof(msg),"Your connected time Hour:%0.f Minutes:%0.f Seconds:%0.f",hours,minutes,seconds);
    return 1;
}

stock MyTimeInHMS(playerid,&Float:hours,&Float:minutes,&Float:seconds)
{
    new Float:milliseconds=NetStats_GetConnectedTime(playerid)+playerVariables[playerid][pMilliseconds];
    hours=milliseconds/3600000;
    milliseconds%=36000000;
    minutes=milliseconds/60000;
    milliseconds%=60000;
    seconds=milliseconds/1000;
}
Reply


Messages In This Thread
Playing hours not working - by GwENiko - 02.11.2014, 15:19
Re: Playing hours not working - by TheSimpleGuy - 02.11.2014, 15:22
Re: Playing hours not working - by GwENiko - 02.11.2014, 15:26
Re: Playing hours not working - by TheSimpleGuy - 02.11.2014, 15:28
Re: Playing hours not working - by GwENiko - 02.11.2014, 15:29
Re: Playing hours not working - by Quickie - 03.11.2014, 00:10

Forum Jump:


Users browsing this thread: 3 Guest(s)