Advertisement
Guest User

Untitled

a guest
Nov 25th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.97 KB | None | 0 0
  1. if(hour == 22 && minute == 20)
  2. {
  3. new query[300],var100[300],string[256],qqerry[256];
  4. format(query, sizeof(query), "SELECT * FROM `users` WHERE `Member` > '0' ORDER BY `id`");
  5. new Cache: stringresult9 = mysql_query(SQL, query);
  6. if(cache_get_row_count() > 0)
  7. {
  8. new rank,faction,name[50],sqlid,raport1,raport2,raport3,raport4,complete,raportincomplet,factionjoin,fwarn,removefw,completer5,test4;
  9. cache_get_field_content(0, "name", name, SQL, sizeof(name));
  10. rank = cache_get_field_content_int(0, "Rank");
  11. faction = cache_get_field_content_int(0, "Member");
  12. sqlid = cache_get_field_content_int(0, "id");
  13. raport1 = cache_get_field_content_int(0, "Raport1");
  14. raport2 = cache_get_field_content_int(0, "Raport2");
  15. raport3 = cache_get_field_content_int(0, "Raport3");
  16. raport4 = cache_get_field_content_int(0, "Raport4");
  17. factionjoin = cache_get_field_content_int(0, "FactionJoin");
  18. fwarn = cache_get_field_content_int(0, "FWarn");
  19. test4 = cache_get_field_content_int(0, "FactionJoin");
  20. if(GetDaysFromTimestamp(test4) < 3)
  21. {
  22. foreach(new id : Player)
  23. {
  24. if(PlayerInfo[id][pSQLID] == sqlid)
  25. {
  26. PlayerInfo[id][Raport1] = 0;
  27. PlayerInfo[id][Raport2] = 0;
  28. PlayerInfo[id][Raport3] = 0;
  29. PlayerInfo[id][Raport4] = 0;
  30. }
  31. }
  32. format(string,sizeof(string),"%s was reset raport faction.",name);
  33. Factionlog(faction,sqlid,0,string);
  34. SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
  35. mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'",sqlid);
  36. mysql_tquery(SQL,var100,"","");
  37. mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
  38. mysql_tquery(SQL, qqerry, "", "");
  39. }
  40. else if(faction == 1)
  41. {
  42. if(rank == 1)
  43. {
  44. if(raport2+raport3 < 24 || raport1 < 5)
  45. {
  46. raportincomplet = 1;
  47. }
  48. else if(fwarn == 0 && (raport2+raport3 >= 25 || raport1 >= 6))
  49. {
  50. complete = 1;
  51. }
  52. else if(fwarn >= 1 && (raport2+raport3 >= 25 || raport1 >= 6))
  53. {
  54. removefw = 1;
  55. }
  56. }
  57. if(rank == 2)
  58. {
  59. if(raport2+raport3 < 19 || raport1 < 4 || raport4 < 1 )
  60. {
  61. raportincomplet = 1;
  62. }
  63. else if(fwarn == 0 && (raport2+raport3 >= 20 || raport1 >= 5 || raport4 >= 2))
  64. {
  65. complete = 1;
  66. }
  67. else if(fwarn >= 1 && (raport2+raport3 >= 20 || raport1 >= 5 || raport4 >= 2))
  68. {
  69. removefw = 1;
  70. }
  71. }
  72. if(rank == 3)
  73. {
  74. if(raport2+raport3 < 14 || raport1 < 3 || raport4 < 1 )
  75. {
  76. raportincomplet = 1;
  77. }
  78. else if(fwarn == 0 && (raport2+raport3 >= 15 || raport1 >= 4 || raport4 >= 2))
  79. {
  80. complete = 1;
  81. }
  82. else if(fwarn >= 1 && (raport2+raport3 >= 15 || raport1 >= 4 || raport4 >= 2))
  83. {
  84. removefw = 1;
  85. }
  86. }
  87. if(rank == 4)
  88. {
  89. if(raport2+raport3 < 9 || raport1 < 2 || raport4 < 1 )
  90. {
  91. raportincomplet = 1;
  92. }
  93. else if(fwarn == 0 && (raport2+raport3 >= 10 || raport1 >= 3 || raport4 >= 2))
  94. {
  95. complete = 1;
  96. }
  97. else if(fwarn >= 1 && (raport2+raport3 >= 10 || raport1 >= 3 || raport4 >= 2))
  98. {
  99. removefw = 1;
  100. }
  101. }
  102. if(rank == 5)
  103. {
  104. if(raport2+raport3 < 4 || raport1 < 1 || raport4 < 1 )
  105. {
  106. raportincomplet = 1;
  107. }
  108. else if(fwarn == 0 && (raport2+raport3 >= 5 || raport1 >= 2 || raport4 >= 2))
  109. {
  110. completer5 = 1;
  111. }
  112. else if(fwarn >= 1 && (raport2+raport3 >= 5 || raport1 >= 2 || raport4 >= 2))
  113. {
  114. removefw = 1;
  115. }
  116. }
  117. }
  118. else if(faction == 2 || faction == 3)
  119. {
  120. if(rank == 1)
  121. {
  122. if(raport2+raport3 < 29)
  123. {
  124. raportincomplet = 1;
  125. }
  126. else if(fwarn == 0 && (raport2+raport3 >= 30))
  127. {
  128. complete = 1;
  129. }
  130. else if(fwarn >= 1 && (raport2+raport3 >= 30))
  131. {
  132. removefw = 1;
  133. }
  134. }
  135. if(rank == 2)
  136. {
  137. if(raport2+raport3 < 24)
  138. {
  139. raportincomplet = 1;
  140. }
  141. else if(fwarn == 0 && (raport2+raport3 >= 25))
  142. {
  143. complete = 1;
  144. }
  145. else if(fwarn >= 1 && (raport2+raport3 >= 25))
  146. {
  147. removefw = 1;
  148. }
  149. }
  150. if(rank == 3)
  151. {
  152. if(raport2+raport3 < 19)
  153. {
  154. raportincomplet = 1;
  155. }
  156. else if(fwarn == 0 && (raport2+raport3 >= 20))
  157. {
  158. complete = 1;
  159. }
  160. else if(fwarn >= 1 && (raport2+raport3 >= 20))
  161. {
  162. removefw = 1;
  163. }
  164. }
  165. if(rank == 4)
  166. {
  167. if(raport2+raport3 < 14)
  168. {
  169. raportincomplet = 1;
  170. }
  171. else if(fwarn == 0 && (raport2+raport3 >= 15))
  172. {
  173. complete = 1;
  174. }
  175. else if(fwarn >= 1 && (raport2+raport3 >= 15))
  176. {
  177. removefw = 1;
  178. }
  179. }
  180. if(rank == 5)
  181. {
  182. if(raport2+raport3 < 9)
  183. {
  184. raportincomplet = 1;
  185. }
  186. else if(fwarn == 0 && (raport2+raport3 >= 10))
  187. {
  188. completer5 = 1;
  189. }
  190. else if(fwarn >= 1 && (raport2+raport3 >= 10))
  191. {
  192. removefw = 1;
  193. }
  194. }
  195. }
  196. else if(faction == 4 || faction == 5 || faction == 6 || faction == 10)
  197. {
  198. if(rank == 1)
  199. {
  200. if(raport2+raport1 < 19)
  201. {
  202. raportincomplet = 1;
  203. }
  204. else if(fwarn == 0 && (raport2+raport1 >= 20))
  205. {
  206. complete = 1;
  207. }
  208. else if(fwarn >= 1 && (raport2+raport1 >= 20))
  209. {
  210. removefw = 1;
  211. }
  212. }
  213. if(rank == 2)
  214. {
  215. if(raport2+raport1 < 19)
  216. {
  217. raportincomplet = 1;
  218. }
  219. else if(fwarn == 0 && (raport2+raport1 >= 20))
  220. {
  221. complete = 1;
  222. }
  223. else if(fwarn >= 1 && (raport2+raport1 >= 20))
  224. {
  225. removefw = 1;
  226. }
  227. }
  228. if(rank == 3)
  229. {
  230. if(raport2+raport3 < 19)
  231. {
  232. raportincomplet = 1;
  233. }
  234. else if(fwarn == 0 && (raport2+raport1 >= 20))
  235. {
  236. complete = 1;
  237. }
  238. else if(fwarn >= 1 && (raport2+raport1 >= 20))
  239. {
  240. removefw = 1;
  241. }
  242. }
  243. if(rank == 4)
  244. {
  245. if(raport2+raport3 < 14)
  246. {
  247. raportincomplet = 1;
  248. }
  249. else if(fwarn == 0 && (raport2+raport1 >= 15))
  250. {
  251. complete = 1;
  252. }
  253. else if(fwarn >= 1 && (raport2+raport1 >= 15))
  254. {
  255. removefw = 1;
  256. }
  257. }
  258. if(rank == 5)
  259. {
  260. if(raport2+raport1 < 9)
  261. {
  262. raportincomplet = 1;
  263. }
  264. else if(fwarn == 0 && (raport2+raport1 >= 10))
  265. {
  266. completer5 = 1;
  267. }
  268. else if(fwarn >= 1 && (raport2+raport1 >= 10))
  269. {
  270. removefw = 1;
  271. }
  272. }
  273. }
  274. else if(faction == 9)
  275. {
  276. if(rank == 1)
  277. {
  278. if(raport1 < 24)
  279. {
  280. raportincomplet = 1;
  281. }
  282. else if(fwarn == 0 && (raport1 >= 25))
  283. {
  284. complete = 1;
  285. }
  286. else if(fwarn >= 1 && (raport1 >= 25))
  287. {
  288. removefw = 1;
  289. }
  290. }
  291. if(rank == 2)
  292. {
  293. if(raport1 < 24)
  294. {
  295. raportincomplet = 1;
  296. }
  297. else if(fwarn == 0 && (raport1 >= 25))
  298. {
  299. complete = 1;
  300. }
  301. else if(fwarn >= 1 && (raport1 >= 25))
  302. {
  303. removefw = 1;
  304. }
  305. }
  306. if(rank == 3)
  307. {
  308. if(raport1 < 19 || raport4 < 2)
  309. {
  310. raportincomplet = 1;
  311. }
  312. else if(fwarn == 0 && (raport1 >= 20 || raport4 >= 3))
  313. {
  314. complete = 1;
  315. }
  316. else if(fwarn >= 1 && (raport1 >= 20 || raport4 >= 3))
  317. {
  318. removefw = 1;
  319. }
  320. }
  321. if(rank == 4)
  322. {
  323. if(raport1 < 14 || raport4 < 2)
  324. {
  325. raportincomplet = 1;
  326. }
  327. else if(fwarn == 0 && (raport1 >= 15 || raport4 >= 3))
  328. {
  329. complete = 1;
  330. }
  331. else if(fwarn >= 1 && (raport1 >= 15 || raport4 >= 3))
  332. {
  333. removefw = 1;
  334. }
  335. }
  336. if(rank == 5)
  337. {
  338. if(raport1 < 9 || raport4 < 2)
  339. {
  340. raportincomplet = 1;
  341. }
  342. else if(fwarn == 0 && (raport1 >= 10 || raport4 >= 3))
  343. {
  344. complete = 1;
  345. }
  346. else if(fwarn >= 1 && (raport1 >= 10 || raport4 >= 3))
  347. {
  348. removefw = 1;
  349. }
  350. }
  351. }
  352. else if(faction == 11 || faction == 13 || faction == 14)
  353. {
  354. if(rank == 1)
  355. {
  356. if(raport1 < 24)
  357. {
  358. raportincomplet = 1;
  359. }
  360. else if(fwarn == 0 && (raport1 >= 25))
  361. {
  362. complete = 1;
  363. }
  364. else if(fwarn >= 1 && (raport1 >= 25))
  365. {
  366. removefw = 1;
  367. }
  368. }
  369. if(rank == 2)
  370. {
  371. if(raport1 < 19)
  372. {
  373. raportincomplet = 1;
  374. }
  375. else if(fwarn == 0 && (raport1 >= 20))
  376. {
  377. complete = 1;
  378. }
  379. else if(fwarn >= 1 && (raport1 >= 20))
  380. {
  381. removefw = 1;
  382. }
  383. }
  384. if(rank == 3)
  385. {
  386. if(raport1 < 14)
  387. {
  388. raportincomplet = 1;
  389. }
  390. else if(fwarn == 0 && (raport1 >= 15))
  391. {
  392. complete = 1;
  393. }
  394. else if(fwarn >= 1 && (raport1 >= 15))
  395. {
  396. removefw = 1;
  397. }
  398. }
  399. if(rank == 4)
  400. {
  401. if(raport1 < 9)
  402. {
  403. raportincomplet = 1;
  404. }
  405. else if(fwarn == 0 && (raport1 >= 10))
  406. {
  407. complete = 1;
  408. }
  409. else if(fwarn >= 1 && (raport1 >= 10))
  410. {
  411. removefw = 1;
  412. }
  413. }
  414. if(rank == 5)
  415. {
  416. if(raport1 < 4)
  417. {
  418. raportincomplet = 1;
  419. }
  420. else if(fwarn == 0 && (raport1 >= 5))
  421. {
  422. completer5 = 1;
  423. }
  424. else if(fwarn >= 1 && (raport1 >= 5))
  425. {
  426. removefw = 1;
  427. }
  428. }
  429. }
  430. if(completer5 == 1)
  431. {
  432. foreach(new id : Player)
  433. {
  434. if(PlayerInfo[id][pSQLID] == sqlid)
  435. {
  436. PlayerInfo[id][Raport1] = 0;
  437. PlayerInfo[id][Raport2] = 0;
  438. PlayerInfo[id][Raport3] = 0;
  439. PlayerInfo[id][Raport4] = 0;
  440. }
  441. }
  442. format(string,sizeof(string),"%s was complete raport faction rank %d.",name,rank);
  443. Factionlog(faction,sqlid,0,string);
  444. SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
  445. mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'",sqlid);
  446. mysql_tquery(SQL,var100,"","");
  447. mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
  448. mysql_tquery(SQL, qqerry, "", "");
  449. }
  450. if(complete == 1)
  451. {
  452. foreach(new id : Player)
  453. {
  454. if(PlayerInfo[id][pSQLID] == sqlid)
  455. {
  456. PlayerInfo[id][pRank] = rank+1;
  457. PlayerInfo[id][Raport1] = 0;
  458. PlayerInfo[id][Raport2] = 0;
  459. PlayerInfo[id][Raport3] = 0;
  460. PlayerInfo[id][Raport4] = 0;
  461. format(string, sizeof(string), "Your rank was changed from %d to %d.",rank,rank+1);
  462. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  463. }
  464. }
  465. format(string,sizeof(string),"%s faction rank was changed from %d to %d.",name,rank,rank+1);
  466. Factionlog(faction,sqlid,0,string);
  467. SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
  468. mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Rank`='%d',`Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'", rank+1,sqlid);
  469. mysql_tquery(SQL,var100,"","");
  470. mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
  471. mysql_tquery(SQL, qqerry, "", "");
  472. }
  473. if(removefw == 1)
  474. {
  475. foreach(new id : Player)
  476. {
  477. if(PlayerInfo[id][pSQLID] == sqlid)
  478. {
  479. PlayerInfo[id][pFACWarns] = fwarn-1;
  480. PlayerInfo[id][Raport1] = 0;
  481. PlayerInfo[id][Raport2] = 0;
  482. PlayerInfo[id][Raport3] = 0;
  483. PlayerInfo[id][Raport4] = 0;
  484. format(string, sizeof(string), "Your faction warn was changed from %d to %d.",fwarn,fwarn-1);
  485. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  486. }
  487. }
  488. format(string,sizeof(string),"%s faction warn was changed from %d to %d.",name,fwarn,fwarn-1);
  489. Factionlog(faction,sqlid,0,string);
  490. SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
  491. mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `FWarn`='%d',`Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'", fwarn-1,sqlid);
  492. mysql_tquery(SQL,var100,"","");
  493. mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
  494. mysql_tquery(SQL, qqerry, "", "");
  495. }
  496. if(raportincomplet == 1)
  497. {
  498. format(string, sizeof(string), "You was uninvited from faction %s (rank %d) after %d days. Reason: Raport incomplet.",NumeFactiune(faction),rank,GetDaysFromTimestamp(factionjoin));
  499. mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
  500. mysql_tquery(SQL, qqerry, "", "");
  501. foreach(new id : Player)
  502. {
  503. if(PlayerInfo[id][pSQLID] == sqlid)
  504. {
  505. PlayerInfo[id][pMember] = 0;
  506. PlayerInfo[id][pLeader] = 0;
  507. PlayerInfo[id][pRank] = 0;
  508. PlayerInfo[id][pFACWarns] = 0;
  509. PlayerInfo[id][pFactionJoin] = 0;
  510. PlayerInfo[id][pModel] = 250;
  511. gTeam[id] = 3;
  512. PlayerInfo[id][pTeam] = 3;
  513. OnDuty[id] = 0;
  514. tazer[id] = 0;
  515. SetPlayerArmourEx(id, 0);
  516. SetPlayerSkin(id,PlayerInfo[id][pModel]);
  517. SetPlayerToTeamColor(id);
  518. SendClientMessage(id, COLOR_LIGHTRED, string);
  519. }
  520. }
  521. new str[256];
  522. mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FWarn`='0',`FPunish`='0',`Team`='3', `FactionJoin`='0' WHERE `name`='%s'",name);
  523. mysql_tquery(SQL,str,"","");
  524. format(string, sizeof(string), "%s was uninvited from faction %s (rank %d) after %d days. Reason: Raport incomplet.",name,NumeFactiune(faction),rank,GetDaysFromTimestamp(factionjoin));
  525. Factionlog(faction,sqlid,0,string);
  526. mysql_format(SQL, query, sizeof(query), "INSERT INTO `faction_logs` (`text`,`player`,`leader`) VALUES ('%s','%d','%d')", string, sqlid, 0);
  527. mysql_tquery(SQL,query,"","");
  528. }
  529. }
  530. cache_delete(stringresult9);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement