new str[512], h, m, s; TotalGameTime(player1, h, m, s); format(str, sizeof(str), "%sTime Login: %d hours %d minutes %d seconds\n", str, h, m, s);
Show us TotalGAmeTime function and function that you use to show player the "str"
|
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]; }
new str[512], h, m, s; TotalGameTime(player1, h, m, s); format(str, sizeof(str), "%sTime Login: %d hours %d minutes %d seconds\n", str, h, m, s);
dcmd_stats(playerid,params[]) { new str[512], h, m, s; if(!strlen(params)) player1 = playerid; else player1 = strval(params); if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, white, "{FF0000}>> Player not Connected"); TotalGameTime(player1, h, m, s); format(str, sizeof(str), "%sTime Login: %d hours %d minutes %d seconds\n", str, h, m, s); ShowPlayerDialog(playerid, 8435, DIALOG_STYLE_MSGBOX, "Player Statistics", str, "Close", ""); return 1; }