Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ReportLog()
- {
- new File: file = fopen("reports/temp", io_append);
- if (file)
- {
- new string[125];
- format(string, sizeof(string), "%d. round:", CelkScore[0] +CelkScore[1]);
- //SendClientMessageToAll(COLOR_WHITE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- format(string, sizeof(string), " Players %s:", ClanName[0]);
- //SendClientMessageToAll(COLOR_WHITE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- new i, stats_[3][13], ratio_[13];
- for(i = 0; i < MAX_PLAYER_ID; i++)
- {
- if (IsPlayerConnected(i))
- {
- if (GetPVarInt(i, "Team") == 0)
- {
- for(new e = 0; e < 3; e++)
- {
- format(string, 13, "round_stats%d", e);
- if (GetPVarInt(i, string[6]) -GetPVarInt(i, string) < 10)
- {
- format(stats_[e], sizeof(stats_[]), "0%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- }else{
- valstr(stats_[e], GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- //format(stats_[e], sizeof(stats_[]), "%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- }
- }
- if (GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1") > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", (GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0")) /float(GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1")));
- }else{
- ratio_ = "-";
- }
- new name[MAX_PLAYER_NAME];
- GetPlayerName(i, name, sizeof(name));
- format(string, sizeof(string), " %s:\r\n Kills: %s | Deaths: %s | TeamKills: %s | Ratio: %s.", name, stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- new Float: stats3 = GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
- new Float: stats4 = GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
- new Float: stats5 = GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
- if (stats3 < 10.0)
- {
- format(stats_[0], sizeof(stats_[]), "000%.2f", stats3);
- }
- else if (stats3 < 100.0)
- {
- format(stats_[0], sizeof(stats_[]), "00%.2f", stats3);
- }
- else if (stats3 < 1000.0)
- {
- format(stats_[0], sizeof(stats_[]), "0%.2f", stats3);
- }else{
- format(stats_[0], sizeof(stats_[]), "%.2f", stats3);
- }
- if (stats4 < 10.0)
- {
- format(stats_[1], sizeof(stats_[]), "000%.2f", stats4);
- }
- else if (stats4 < 100.0)
- {
- format(stats_[1], sizeof(stats_[]), "00%.2f", stats4);
- }
- else if (stats4 < 1000.0)
- {
- format(stats_[1], sizeof(stats_[]), "0%.2f", stats4);
- }else{
- format(stats_[1], sizeof(stats_[]), "%.2f", stats4);
- }
- if (stats5 < 10.0)
- {
- format(stats_[2], sizeof(stats_[]), "0%.2f", stats5);
- }else{
- format(stats_[2], sizeof(stats_[]), "%.2f", stats5);
- }
- if (stats4 > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", stats3 /stats4);
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Damage: %s | Injuries: %s | Teammate damage: %s | Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- }
- }
- }
- format(string, sizeof(string), " Players %s:", ClanName[1]);
- //SendClientMessageToAll(COLOR_WHITE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- for(i = 0; i < MAX_PLAYER_ID; i++)
- {
- if (IsPlayerConnected(i))
- {
- if (GetPVarInt(i, "Team") == 1)
- {
- for(new e = 0; e < 3; e++)
- {
- format(string, 13, "round_stats%d", e);
- if (GetPVarInt(i, string[6]) -GetPVarInt(i, string) < 10)
- {
- format(stats_[e], sizeof(stats_[]), "0%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- }else{
- valstr(stats_[e], GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- //format(stats_[e], sizeof(stats_[]), "%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
- }
- }
- if (GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1") > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", (GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0")) /float(GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1")));
- }else{
- ratio_ = "-";
- }
- GetPlayerName(i, string, MAX_PLAYER_NAME);
- format(string, sizeof(string), " %s:\r\n Kills: %s | Deaths: %s | TeamKills: %s | Ratio: %s.", string, stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_BLUE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- new Float: stats3 = GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
- new Float: stats4 = GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
- new Float: stats5 = GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
- if (stats3 < 10.0)
- {
- format(stats_[0], sizeof(stats_[]), "000%.2f", stats3);
- }
- else if (stats3 < 100.0)
- {
- format(stats_[0], sizeof(stats_[]), "00%.2f", stats3);
- }
- else if (stats3 < 1000.0)
- {
- format(stats_[0], sizeof(stats_[]), "0%.2f", stats3);
- }else{
- format(stats_[0], sizeof(stats_[]), "%.2f", stats3);
- }
- if (stats4 < 10.0)
- {
- format(stats_[1], sizeof(stats_[]), "000%.2f", stats4);
- }
- else if (stats4 < 100.0)
- {
- format(stats_[1], sizeof(stats_[]), "00%.2f", stats4);
- }
- else if (stats4 < 1000.0)
- {
- format(stats_[1], sizeof(stats_[]), "0%.2f", stats4);
- }else{
- format(stats_[1], sizeof(stats_[]), "%.2f", stats4);
- }
- if (stats5 < 10.0)
- {
- format(stats_[2], sizeof(stats_[]), "0%.2f", stats5);
- }else{
- format(stats_[2], sizeof(stats_[]), "%.2f", stats5);
- }
- if (stats4 > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", stats3 /stats4);
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Damage: %s | Injuries: %s | Teammate damage: %s | Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- }
- }
- }
- for(i = 0; i < 2; i++)
- {
- if (score[i] < 10)
- {
- format(stats_[i], sizeof(stats_[]), "0%d", score[i]);
- }else{
- valstr(stats_[i], score[i]);
- //format(stats_[i], sizeof(stats_[]), "%d", score[i]);
- }
- }
- fwrite(file, " Score:\r\n");
- format(string, sizeof(string), " [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
- fwrite(file, string);
- fwrite(file, "\r\n");
- for(i = 0; i < 2; i++)
- {
- if (soucet[i] < 10)
- {
- format(stats_[i], sizeof(stats_[]), "0%d", soucet[i]);
- }else{
- valstr(stats_[i], soucet[i]);
- //format(stats_[i], sizeof(stats_[]), "%d", soucet[i]);
- }
- }
- fwrite(file, " Total:\r\n");
- format(string, sizeof(string), " [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
- fwrite(file, string);
- fwrite(file, "\r\n");
- for(i = 0; i < 2; i++)
- {
- if (CelkScore[i] < 10)
- {
- format(stats_[i], sizeof(stats_[]), "0%d", CelkScore[i]);
- }else{
- valstr(stats_[i], CelkScore[i]);
- //format(stats_[i], sizeof(stats_[]), "%d", CelkScore[i]);
- }
- }
- fwrite(file, " Round:\r\n");
- format(string, sizeof(string), " [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
- fwrite(file, string);
- fwrite(file, "\r\n");
- format(string, sizeof(string), " %s stats:", ClanName[0]);
- //SendClientMessageToAll(COLOR_WHITE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- new pocet[2][3];
- new Float: pocet2[2][3];
- for(i = 0; i < MAX_PLAYER_ID; i++)
- {
- if (IsPlayerConnected(i))
- {
- if (GetPVarInt(i, "Team") < 2)
- {
- pocet[GetPVarInt(i, "Team")][0] += GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0");
- pocet[GetPVarInt(i, "Team")][1] += GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1");
- pocet[GetPVarInt(i, "Team")][2] += GetPVarInt(i, "stats2") -GetPVarInt(i, "round_stats2");
- pocet2[GetPVarInt(i, "Team")][0] += GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
- pocet2[GetPVarInt(i, "Team")][1] += GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
- pocet2[GetPVarInt(i, "Team")][2] += GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
- }
- }
- }
- for(i = 0; i < sizeof(stats_); i++)
- {
- if (pocet[0][i] < 10)
- {
- format(stats_[i], sizeof(stats_[]), "0%d", pocet[0][i]);
- }else{
- valstr(stats_[i], pocet[0][i]);
- //format(stats_[i], sizeof(stats_[]), "%d", pocet[0][i]);
- }
- }
- if (pocet[0][1] > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", pocet[0][0] /float(pocet[0][1]));
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Total Kills: %s | Total Deahs: %s | Total TeamKills: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- if (pocet2[0][0] < 10.0)
- {
- format(stats_[0], sizeof(stats_[]), "000%.2f", pocet2[0][0]);
- }
- else if (pocet2[0][0] < 100.0)
- {
- format(stats_[0], sizeof(stats_[]), "00%.2f", pocet2[0][0]);
- }
- else if (pocet2[0][0] < 1000.0)
- {
- format(stats_[0], sizeof(stats_[]), "0%.2f", pocet2[0][0]);
- }else{
- format(stats_[0], sizeof(stats_[]), "%.2f", pocet2[0][0]);
- }
- if (pocet2[0][1] < 10.0)
- {
- format(stats_[1], sizeof(stats_[]), "000%.2f", pocet2[0][1]);
- }
- else if (pocet2[0][1] < 100.0)
- {
- format(stats_[1], sizeof(stats_[]), "00%.2f", pocet2[0][1]);
- }
- else if (pocet2[0][1] < 1000.0)
- {
- format(stats_[1], sizeof(stats_[]), "0%.2f", pocet2[0][1]);
- }else{
- format(stats_[1], sizeof(stats_[]), "%.2f", pocet2[0][1]);
- }
- if (pocet2[0][2] < 10.0)
- {
- format(stats_[2], sizeof(stats_[]), "0%.2f", pocet2[0][2]);
- }else{
- format(stats_[2], sizeof(stats_[]), "%.2f", pocet2[0][2]);
- }
- if (pocet2[0][1] > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", pocet2[0][0] /pocet2[0][1]);
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Total Damage: %s | Total Injuries: %s | Total Teammate Damage: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- format(string, sizeof(string), " %s stats:", ClanName[1]);
- //SendClientMessageToAll(COLOR_WHITE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- for(i = 0; i < sizeof(stats_); i++)
- {
- if (pocet[1][i] < 10)
- {
- format(stats_[i], sizeof(stats_[]), "0%d", pocet[1][i]);
- }else{
- valstr(stats_[i], pocet[1][i]);
- //format(stats_[i], sizeof(stats_[]), "%d", pocet[1][i]);
- }
- }
- if (pocet[1][1] > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", pocet[1][0] /float(pocet[1][1]));
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Total Kills: %s | Total Deahs: %s | Total TeamKills: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_BLUE, string);
- fwrite(file, string);
- fwrite(file, "\r\n");
- if (pocet2[1][0] < 10.0)
- {
- format(stats_[0], sizeof(stats_[]), "000%.2f", pocet2[1][0]);
- }
- else if (pocet2[1][0] < 100.0)
- {
- format(stats_[0], sizeof(stats_[]), "00%.2f", pocet2[1][0]);
- }
- else if (pocet2[1][0] < 1000.0)
- {
- format(stats_[0], sizeof(stats_[]), "0%.2f", pocet2[1][0]);
- }else{
- format(stats_[0], sizeof(stats_[]), "%.2f", pocet2[1][0]);
- }
- if (pocet2[1][1] < 10.0)
- {
- format(stats_[1], sizeof(stats_[]), "000%.2f", pocet2[1][1]);
- }
- else if (pocet2[1][1] < 100.0)
- {
- format(stats_[1], sizeof(stats_[]), "00%.2f", pocet2[1][1]);
- }
- else if (pocet2[1][1] < 1000.0)
- {
- format(stats_[1], sizeof(stats_[]), "0%.2f", pocet2[1][1]);
- }else{
- format(stats_[1], sizeof(stats_[]), "%.2f", pocet2[1][1]);
- }
- if (pocet2[1][2] < 10.0)
- {
- format(stats_[2], sizeof(stats_[]), "0%.2f", pocet2[1][2]);
- }else{
- format(stats_[2], sizeof(stats_[]), "%.2f", pocet2[1][2]);
- }
- if (pocet2[1][1] > 0)
- {
- format(ratio_, sizeof(ratio_), "%.2f", pocet2[1][0] /pocet2[1][1]);
- }else{
- ratio_ = "-";
- }
- format(string, sizeof(string), " Total Damage: %s | Total Injuries: %s | Total Teammate Damage: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
- //SendClientMessageToAll(COLOR_GREEN, string);
- fwrite(file, string);
- fwrite(file, "\r\n\r\n");
- fclose(file);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement