10.09.2011, 11:47
How can I save the time of the player on my server?
Please help me!
It's very important!
Thanks!
Please help me!
It's very important!
Thanks!
enum PlayerData
{
hours,
mins,
secs,
TotalTime,
ConnectTime
};
new AccInfo[MAX_PLAYERS][PlayerData];
TotalGameTime(playerid, &h=0, &m=0, &s=0)
{
AccInfo[playerid][TotalTime] = ( (gettime() - AccInfo[playerid][ConnectTime]) + (AccInfo[playerid][hours]*60*60) + (AccInfo[playerid][mins]*60) + (AccInfo[playerid][secs]) );
h = floatround(AccInfo[playerid][TotalTime] / 3600, floatround_floor);
m = floatround(AccInfo[playerid][TotalTime] / 60, floatround_floor) % 60;
s = floatround(AccInfo[playerid][TotalTime] % 60, floatround_floor);
return AccInfo[playerid][TotalTime];
}
public OnPlayerConnect(playerid)
{
AccInfo[playerid][ConnectTime] = gettime();
return 1;
}
public OnPlayerConnect(playerid)
{
gettime();
return 1;
}