Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.13 KB | None | 0 0
  1. stock ReportLog()
  2. {
  3. new File: file = fopen("reports/temp", io_append);
  4. if (file)
  5. {
  6. new string[125];
  7. format(string, sizeof(string), "%d. round:", CelkScore[0] +CelkScore[1]);
  8. //SendClientMessageToAll(COLOR_WHITE, string);
  9. fwrite(file, string);
  10. fwrite(file, "\r\n");
  11. format(string, sizeof(string), "  Players %s:", ClanName[0]);
  12. //SendClientMessageToAll(COLOR_WHITE, string);
  13. fwrite(file, string);
  14. fwrite(file, "\r\n");
  15. new i, stats_[3][13], ratio_[13];
  16. for(i = 0; i < MAX_PLAYER_ID; i++)
  17. {
  18. if (IsPlayerConnected(i))
  19. {
  20. if (GetPVarInt(i, "Team") == 0)
  21. {
  22. for(new e = 0; e < 3; e++)
  23. {
  24. format(string, 13, "round_stats%d", e);
  25. if (GetPVarInt(i, string[6]) -GetPVarInt(i, string) < 10)
  26. {
  27. format(stats_[e], sizeof(stats_[]), "0%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  28. }else{
  29. valstr(stats_[e], GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  30. //format(stats_[e], sizeof(stats_[]), "%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  31. }
  32. }
  33. if (GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1") > 0)
  34. {
  35. format(ratio_, sizeof(ratio_), "%.2f", (GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0")) /float(GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1")));
  36. }else{
  37. ratio_ = "-";
  38. }
  39. new name[MAX_PLAYER_NAME];
  40. GetPlayerName(i, name, sizeof(name));
  41. format(string, sizeof(string), "    %s:\r\n      Kills: %s | Deaths: %s | TeamKills: %s | Ratio: %s.", name, stats_[0], stats_[1], stats_[2], ratio_);
  42. //SendClientMessageToAll(COLOR_GREEN, string);
  43. fwrite(file, string);
  44. fwrite(file, "\r\n");
  45.  
  46. new Float: stats3 = GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
  47. new Float: stats4 = GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
  48. new Float: stats5 = GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
  49.  
  50. if (stats3 < 10.0)
  51. {
  52. format(stats_[0], sizeof(stats_[]), "000%.2f", stats3);
  53. }
  54. else if (stats3 < 100.0)
  55. {
  56. format(stats_[0], sizeof(stats_[]), "00%.2f", stats3);
  57. }
  58. else if (stats3 < 1000.0)
  59. {
  60. format(stats_[0], sizeof(stats_[]), "0%.2f", stats3);
  61. }else{
  62. format(stats_[0], sizeof(stats_[]), "%.2f", stats3);
  63. }
  64.  
  65. if (stats4 < 10.0)
  66. {
  67. format(stats_[1], sizeof(stats_[]), "000%.2f", stats4);
  68. }
  69. else if (stats4 < 100.0)
  70. {
  71. format(stats_[1], sizeof(stats_[]), "00%.2f", stats4);
  72. }
  73. else if (stats4 < 1000.0)
  74. {
  75. format(stats_[1], sizeof(stats_[]), "0%.2f", stats4);
  76. }else{
  77. format(stats_[1], sizeof(stats_[]), "%.2f", stats4);
  78. }
  79.  
  80. if (stats5 < 10.0)
  81. {
  82. format(stats_[2], sizeof(stats_[]), "0%.2f", stats5);
  83. }else{
  84. format(stats_[2], sizeof(stats_[]), "%.2f", stats5);
  85. }
  86.  
  87. if (stats4 > 0)
  88. {
  89. format(ratio_, sizeof(ratio_), "%.2f", stats3 /stats4);
  90. }else{
  91. ratio_ = "-";
  92. }
  93. format(string, sizeof(string), "      Damage: %s | Injuries: %s | Teammate damage: %s | Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  94. //SendClientMessageToAll(COLOR_GREEN, string);
  95. fwrite(file, string);
  96. fwrite(file, "\r\n");
  97. }
  98. }
  99. }
  100. format(string, sizeof(string), "  Players %s:", ClanName[1]);
  101. //SendClientMessageToAll(COLOR_WHITE, string);
  102. fwrite(file, string);
  103. fwrite(file, "\r\n");
  104. for(i = 0; i < MAX_PLAYER_ID; i++)
  105. {
  106. if (IsPlayerConnected(i))
  107. {
  108. if (GetPVarInt(i, "Team") == 1)
  109. {
  110. for(new e = 0; e < 3; e++)
  111. {
  112. format(string, 13, "round_stats%d", e);
  113. if (GetPVarInt(i, string[6]) -GetPVarInt(i, string) < 10)
  114. {
  115. format(stats_[e], sizeof(stats_[]), "0%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  116. }else{
  117. valstr(stats_[e], GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  118. //format(stats_[e], sizeof(stats_[]), "%d", GetPVarInt(i, string[6]) -GetPVarInt(i, string));
  119. }
  120. }
  121. if (GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1") > 0)
  122. {
  123. format(ratio_, sizeof(ratio_), "%.2f", (GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0")) /float(GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1")));
  124. }else{
  125. ratio_ = "-";
  126. }
  127. GetPlayerName(i, string, MAX_PLAYER_NAME);
  128. format(string, sizeof(string), "    %s:\r\n      Kills: %s | Deaths: %s | TeamKills: %s | Ratio: %s.", string, stats_[0], stats_[1], stats_[2], ratio_);
  129. //SendClientMessageToAll(COLOR_BLUE, string);
  130. fwrite(file, string);
  131. fwrite(file, "\r\n");
  132.  
  133. new Float: stats3 = GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
  134. new Float: stats4 = GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
  135. new Float: stats5 = GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
  136.  
  137. if (stats3 < 10.0)
  138. {
  139. format(stats_[0], sizeof(stats_[]), "000%.2f", stats3);
  140. }
  141. else if (stats3 < 100.0)
  142. {
  143. format(stats_[0], sizeof(stats_[]), "00%.2f", stats3);
  144. }
  145. else if (stats3 < 1000.0)
  146. {
  147. format(stats_[0], sizeof(stats_[]), "0%.2f", stats3);
  148. }else{
  149. format(stats_[0], sizeof(stats_[]), "%.2f", stats3);
  150. }
  151.  
  152. if (stats4 < 10.0)
  153. {
  154. format(stats_[1], sizeof(stats_[]), "000%.2f", stats4);
  155. }
  156. else if (stats4 < 100.0)
  157. {
  158. format(stats_[1], sizeof(stats_[]), "00%.2f", stats4);
  159. }
  160. else if (stats4 < 1000.0)
  161. {
  162. format(stats_[1], sizeof(stats_[]), "0%.2f", stats4);
  163. }else{
  164. format(stats_[1], sizeof(stats_[]), "%.2f", stats4);
  165. }
  166.  
  167. if (stats5 < 10.0)
  168. {
  169. format(stats_[2], sizeof(stats_[]), "0%.2f", stats5);
  170. }else{
  171. format(stats_[2], sizeof(stats_[]), "%.2f", stats5);
  172. }
  173.  
  174. if (stats4 > 0)
  175. {
  176. format(ratio_, sizeof(ratio_), "%.2f", stats3 /stats4);
  177. }else{
  178. ratio_ = "-";
  179. }
  180. format(string, sizeof(string), "      Damage: %s | Injuries: %s | Teammate damage: %s | Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  181. //SendClientMessageToAll(COLOR_GREEN, string);
  182. fwrite(file, string);
  183. fwrite(file, "\r\n");
  184. }
  185. }
  186. }
  187. for(i = 0; i < 2; i++)
  188. {
  189. if (score[i] < 10)
  190. {
  191. format(stats_[i], sizeof(stats_[]), "0%d", score[i]);
  192. }else{
  193. valstr(stats_[i], score[i]);
  194. //format(stats_[i], sizeof(stats_[]), "%d", score[i]);
  195. }
  196. }
  197. fwrite(file, "  Score:\r\n");
  198. format(string, sizeof(string), "    [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
  199. fwrite(file, string);
  200. fwrite(file, "\r\n");
  201.  
  202. for(i = 0; i < 2; i++)
  203. {
  204. if (soucet[i] < 10)
  205. {
  206. format(stats_[i], sizeof(stats_[]), "0%d", soucet[i]);
  207. }else{
  208. valstr(stats_[i], soucet[i]);
  209. //format(stats_[i], sizeof(stats_[]), "%d", soucet[i]);
  210. }
  211. }
  212. fwrite(file, "  Total:\r\n");
  213. format(string, sizeof(string), "    [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
  214. fwrite(file, string);
  215. fwrite(file, "\r\n");
  216.  
  217. for(i = 0; i < 2; i++)
  218. {
  219. if (CelkScore[i] < 10)
  220. {
  221. format(stats_[i], sizeof(stats_[]), "0%d", CelkScore[i]);
  222. }else{
  223. valstr(stats_[i], CelkScore[i]);
  224. //format(stats_[i], sizeof(stats_[]), "%d", CelkScore[i]);
  225. }
  226. }
  227. fwrite(file, "  Round:\r\n");
  228. format(string, sizeof(string), "    [%s] %s:%s [%s]", ClanName[0], stats_[0], stats_[1], ClanName[1]);
  229. fwrite(file, string);
  230. fwrite(file, "\r\n");
  231.  
  232. format(string, sizeof(string), "  %s stats:", ClanName[0]);
  233. //SendClientMessageToAll(COLOR_WHITE, string);
  234. fwrite(file, string);
  235. fwrite(file, "\r\n");
  236. new pocet[2][3];
  237. new Float: pocet2[2][3];
  238. for(i = 0; i < MAX_PLAYER_ID; i++)
  239. {
  240. if (IsPlayerConnected(i))
  241. {
  242. if (GetPVarInt(i, "Team") < 2)
  243. {
  244. pocet[GetPVarInt(i, "Team")][0] += GetPVarInt(i, "stats0") -GetPVarInt(i, "round_stats0");
  245. pocet[GetPVarInt(i, "Team")][1] += GetPVarInt(i, "stats1") -GetPVarInt(i, "round_stats1");
  246. pocet[GetPVarInt(i, "Team")][2] += GetPVarInt(i, "stats2") -GetPVarInt(i, "round_stats2");
  247. pocet2[GetPVarInt(i, "Team")][0] += GetPVarFloat(i, "stats3") -GetPVarFloat(i, "round_stats3");
  248. pocet2[GetPVarInt(i, "Team")][1] += GetPVarFloat(i, "stats4") -GetPVarFloat(i, "round_stats4");
  249. pocet2[GetPVarInt(i, "Team")][2] += GetPVarFloat(i, "stats5") -GetPVarFloat(i, "round_stats5");
  250. }
  251. }
  252. }
  253. for(i = 0; i < sizeof(stats_); i++)
  254. {
  255. if (pocet[0][i] < 10)
  256. {
  257. format(stats_[i], sizeof(stats_[]), "0%d", pocet[0][i]);
  258. }else{
  259. valstr(stats_[i], pocet[0][i]);
  260. //format(stats_[i], sizeof(stats_[]), "%d", pocet[0][i]);
  261. }
  262. }
  263. if (pocet[0][1] > 0)
  264. {
  265. format(ratio_, sizeof(ratio_), "%.2f", pocet[0][0] /float(pocet[0][1]));
  266. }else{
  267. ratio_ = "-";
  268. }
  269. format(string, sizeof(string), "    Total Kills: %s | Total Deahs: %s | Total TeamKills: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  270. //SendClientMessageToAll(COLOR_GREEN, string);
  271. fwrite(file, string);
  272. fwrite(file, "\r\n");
  273.  
  274. if (pocet2[0][0] < 10.0)
  275. {
  276. format(stats_[0], sizeof(stats_[]), "000%.2f", pocet2[0][0]);
  277. }
  278. else if (pocet2[0][0] < 100.0)
  279. {
  280. format(stats_[0], sizeof(stats_[]), "00%.2f", pocet2[0][0]);
  281. }
  282. else if (pocet2[0][0] < 1000.0)
  283. {
  284. format(stats_[0], sizeof(stats_[]), "0%.2f", pocet2[0][0]);
  285. }else{
  286. format(stats_[0], sizeof(stats_[]), "%.2f", pocet2[0][0]);
  287. }
  288.  
  289. if (pocet2[0][1] < 10.0)
  290. {
  291. format(stats_[1], sizeof(stats_[]), "000%.2f", pocet2[0][1]);
  292. }
  293. else if (pocet2[0][1] < 100.0)
  294. {
  295. format(stats_[1], sizeof(stats_[]), "00%.2f", pocet2[0][1]);
  296. }
  297. else if (pocet2[0][1] < 1000.0)
  298. {
  299. format(stats_[1], sizeof(stats_[]), "0%.2f", pocet2[0][1]);
  300. }else{
  301. format(stats_[1], sizeof(stats_[]), "%.2f", pocet2[0][1]);
  302. }
  303.  
  304. if (pocet2[0][2] < 10.0)
  305. {
  306. format(stats_[2], sizeof(stats_[]), "0%.2f", pocet2[0][2]);
  307. }else{
  308. format(stats_[2], sizeof(stats_[]), "%.2f", pocet2[0][2]);
  309. }
  310.  
  311. if (pocet2[0][1] > 0)
  312. {
  313. format(ratio_, sizeof(ratio_), "%.2f", pocet2[0][0] /pocet2[0][1]);
  314. }else{
  315. ratio_ = "-";
  316. }
  317. format(string, sizeof(string), "    Total Damage: %s | Total Injuries: %s | Total Teammate Damage: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  318. //SendClientMessageToAll(COLOR_GREEN, string);
  319. fwrite(file, string);
  320. fwrite(file, "\r\n");
  321.  
  322. format(string, sizeof(string), "  %s stats:", ClanName[1]);
  323. //SendClientMessageToAll(COLOR_WHITE, string);
  324. fwrite(file, string);
  325. fwrite(file, "\r\n");
  326. for(i = 0; i < sizeof(stats_); i++)
  327. {
  328. if (pocet[1][i] < 10)
  329. {
  330. format(stats_[i], sizeof(stats_[]), "0%d", pocet[1][i]);
  331. }else{
  332. valstr(stats_[i], pocet[1][i]);
  333. //format(stats_[i], sizeof(stats_[]), "%d", pocet[1][i]);
  334. }
  335. }
  336. if (pocet[1][1] > 0)
  337. {
  338. format(ratio_, sizeof(ratio_), "%.2f", pocet[1][0] /float(pocet[1][1]));
  339. }else{
  340. ratio_ = "-";
  341. }
  342. format(string, sizeof(string), "    Total Kills: %s | Total Deahs: %s | Total TeamKills: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  343. //SendClientMessageToAll(COLOR_BLUE, string);
  344. fwrite(file, string);
  345. fwrite(file, "\r\n");
  346.  
  347. if (pocet2[1][0] < 10.0)
  348. {
  349. format(stats_[0], sizeof(stats_[]), "000%.2f", pocet2[1][0]);
  350. }
  351. else if (pocet2[1][0] < 100.0)
  352. {
  353. format(stats_[0], sizeof(stats_[]), "00%.2f", pocet2[1][0]);
  354. }
  355. else if (pocet2[1][0] < 1000.0)
  356. {
  357. format(stats_[0], sizeof(stats_[]), "0%.2f", pocet2[1][0]);
  358. }else{
  359. format(stats_[0], sizeof(stats_[]), "%.2f", pocet2[1][0]);
  360. }
  361.  
  362. if (pocet2[1][1] < 10.0)
  363. {
  364. format(stats_[1], sizeof(stats_[]), "000%.2f", pocet2[1][1]);
  365. }
  366. else if (pocet2[1][1] < 100.0)
  367. {
  368. format(stats_[1], sizeof(stats_[]), "00%.2f", pocet2[1][1]);
  369. }
  370. else if (pocet2[1][1] < 1000.0)
  371. {
  372. format(stats_[1], sizeof(stats_[]), "0%.2f", pocet2[1][1]);
  373. }else{
  374. format(stats_[1], sizeof(stats_[]), "%.2f", pocet2[1][1]);
  375. }
  376.  
  377. if (pocet2[1][2] < 10.0)
  378. {
  379. format(stats_[2], sizeof(stats_[]), "0%.2f", pocet2[1][2]);
  380. }else{
  381. format(stats_[2], sizeof(stats_[]), "%.2f", pocet2[1][2]);
  382. }
  383.  
  384. if (pocet2[1][1] > 0)
  385. {
  386. format(ratio_, sizeof(ratio_), "%.2f", pocet2[1][0] /pocet2[1][1]);
  387. }else{
  388. ratio_ = "-";
  389. }
  390. format(string, sizeof(string), "    Total Damage: %s | Total Injuries: %s | Total Teammate Damage: %s | Team Ratio: %s.", stats_[0], stats_[1], stats_[2], ratio_);
  391. //SendClientMessageToAll(COLOR_GREEN, string);
  392. fwrite(file, string);
  393. fwrite(file, "\r\n\r\n");
  394. fclose(file);
  395. }
  396. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement