22.03.2014, 12:26
pawn Код:
enum pInfo
{
TotalTime,
hours,
mins,
secs,
ConnectTime
};
new PlayerInfo[MAX_PLAYERS][pInfo];
// now this
TotalGameTime(playerid, &h=0, &m=0, &s=0)
{
PlayerInfo[playerid][TotalTime] = ( (gettime() - PlayerInfo[playerid][ConnectTime]) + (PlayerInfo[playerid][hours]*60*60) + (PlayerInfo[playerid][mins]*60) + (PlayerInfo[playerid][secs]) );
h = floatround(PlayerInfo[playerid][TotalTime] / 3600, floatround_floor);
m = floatround(PlayerInfo[playerid][TotalTime] / 60, floatround_floor) % 60;
s = floatround(PlayerInfo[playerid][TotalTime] % 60, floatround_floor);
return PlayerInfo[playerid][TotalTime];
}
pawn Код:
TotalGameTime(playerid, h, m, s);
//now to preview it:
format(string, sizeof(string), "Total Time: %d hours %d minutes %d seconds", h, m, s);
SendClientMessage(playerid, -1, string);
pawn Код:
PlayerInfo[playerid][ConnectTime] = gettime();
pawn Код:
INI_WriteInt(File,"Hours",PlayerInfo[playerid][hours]);
INI_WriteInt(File,"Minutes",PlayerInfo[playerid][mins]);
INI_WriteInt(File,"Seconds",PlayerInfo[playerid][secs]);
pawn Код:
INI_Int("Hours",PlayerInfo[playerid][hours]);
INI_Int("Minutes",PlayerInfo[playerid][mins]);
INI_Int("Seconds",PlayerInfo[playerid][secs]);
I tryed adding it manually and the loader is working ...
PLS HELP