Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.60 KB | None | 0 0
  1. case DIALOG_PANEL_ACTIONS:
  2. {
  3. new szQuery[1024],giverid,actionid,actiontime,complaint,reason[64],stringg[256],playername[30],givername[30],var100[300],dm,reason2[64];
  4. format(szQuery, sizeof(szQuery), "SELECT * FROM `panelactions`");
  5. new Cache: stringresult = mysql_query(SQL, szQuery);
  6. if(cache_get_row_count() > 0)
  7. {
  8. for(new i, j = cache_get_row_count (); i != j; ++i)
  9. {
  10. playerid = cache_get_field_content_int(i, "playerid");
  11. giverid = cache_get_field_content_int(i, "giverid");
  12. actionid = cache_get_field_content_int(i, "actionid");
  13. actiontime = cache_get_field_content_int(i, "actiontime");
  14. complaint = cache_get_field_content_int(i, "complaintid");
  15. dm = cache_get_field_content_int(i, "dm");
  16. cache_get_field_content(i, "playername", playername, SQL, sizeof(playername));
  17. cache_get_field_content(i, "givername", givername, SQL, sizeof(givername));
  18. cache_get_field_content(i, "reason", reason, SQL, sizeof(reason));
  19.  
  20. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO panelactions2 (`playerid`,`giverid`,`actionid`,`actiontime`,`complaintid`,`dm`,`playername`,`givername`,`reason`) VALUES ('%d','%d','%d','%d','%d','%d','%s','%s','%s')",playerid,giverid,actionid,actiontime,complaint,dm,playername,givername,reason);
  21. mysql_tquery(SQL,var100,"","");
  22.  
  23. switch(actionid)
  24. {
  25. case 1: {
  26. if(complaint > 0)
  27. {
  28. format(stringg,sizeof(stringg),"AdmPanel: %s has been banned by %s for %d days, reason: %s [complaint:%d].",playername,givername,actiontime,reason,complaint);
  29. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  30. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  31. }
  32. else
  33. {
  34. format(stringg,sizeof(stringg),"AdmPanel: %s has been banned by %s for %d days, reason: %s.",playername,givername,actiontime,reason);
  35. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  36. format(reason2,sizeof(reason2),"%s",reason);
  37. }
  38. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','1','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
  39. mysql_tquery(SQL,var100,"","");
  40. foreach(new idd : Player)
  41. {
  42. if(PlayerInfo[idd][pSQLID] == playerid)
  43. {
  44. KickEx(idd);
  45. }
  46. }
  47. }
  48. case 2: {
  49. if(complaint > 0)
  50. {
  51. format(stringg,sizeof(stringg),"AdmPanel: %s has been permanent banned by %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
  52. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  53. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  54. }
  55. else
  56. {
  57. format(stringg,sizeof(stringg),"AdmPanel: %s has been permanent banned by %s, reason: %s.",playername,givername,reason);
  58. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  59. format(reason2,sizeof(reason2),"%s",reason);
  60. }
  61. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','2','0','%s','%s','%s','%d')",playerid,giverid,reason2,playername,givername,gettime());
  62. mysql_tquery(SQL,var100,"","");
  63. foreach(new idd : Player)
  64. {
  65. if(PlayerInfo[idd][pSQLID] == playerid)
  66. {
  67. KickEx(idd);
  68. }
  69. }
  70. }
  71. case 3: {
  72. if(complaint > 0)
  73. {
  74. format(stringg, sizeof(stringg), "AdmPanel: %s was jailed by %s for %d minutes, reason: %s [complaint:%d]",playername,givername,actiontime,reason,complaint);
  75. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  76. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  77. }
  78. else
  79. {
  80. format(stringg, sizeof(stringg), "AdmPanel: %s was jailed by %s for %d minutes, reason: %s",playername,givername,actiontime,reason);
  81. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  82. format(reason2,sizeof(reason2),"%s",reason);
  83. }
  84. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','6','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
  85. mysql_tquery(SQL,var100,"","");
  86. foreach(new idd : Player)
  87. {
  88. if(PlayerInfo[idd][pSQLID] == playerid)
  89. {
  90. ResetPlayerWeapons(idd);
  91. WantedTime[idd] = 0;
  92. PlayerInfo[idd][pJailed] = 2;
  93. PlayerInfo[idd][pJailTime] = actiontime*60;
  94. SetPlayerInterior(idd, 10);
  95. if(dm > 0)
  96. {
  97. PlayerInfo[idd][pGunLic] = 0;
  98. PlayerInfo[idd][pGunLicT] = 0;
  99. }
  100. }
  101. }
  102. }
  103. case 4: {
  104. if(complaint > 0)
  105. {
  106. format(stringg, sizeof(stringg), "AdmPanel: %s received a warn from admin %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
  107. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  108. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  109. }
  110. else
  111. {
  112. format(stringg, sizeof(stringg), "AdmPanel: %s received a warn from admin %s, reason: %s.",playername,givername,reason);
  113. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  114. format(reason2,sizeof(reason2),"%s",reason);
  115. }
  116. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','5','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
  117. mysql_tquery(SQL,var100,"","");
  118. foreach(new idd : Player)
  119. {
  120. if(PlayerInfo[idd][pSQLID] == playerid)
  121. {
  122. PlayerInfo[idd][pWarns] += 1;
  123. }
  124. }
  125. format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `id`='%d' ORDER BY `id`",playerid);
  126. new Cache: stringresultt = mysql_query(SQL, szQuery);
  127. if(cache_get_row_count() > 0)
  128. {
  129. new warns,str[256],time;
  130. for(new is, js = cache_get_row_count (); is != js; ++is)
  131. {
  132. warns = cache_get_field_content_int(is, "Warnings");
  133. }
  134. if(warns == 1)
  135. {
  136. mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `WarnReason1` = '%s' WHERE `name`='%s'",reason,playername);
  137. mysql_tquery(SQL,str,"","");
  138. }
  139. else if(warns == 2)
  140. {
  141. mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `WarnReason2` = '%s' WHERE `name`='%s'",reason,playername);
  142. mysql_tquery(SQL,str,"","");
  143. }
  144. else if(warns > 2)
  145. {
  146. format(stringg, sizeof(stringg), "AdmPanel: %s has been banned by AdmBot for 3 days, reason: 3/3 warns.",playername);
  147. time = gettime() + (3*86400);
  148. mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', 'AdmBot', '3/3 warns', '0', 3, 0, 0, 1, %d)",
  149. playername,time);
  150. mysql_tquery(SQL,str,"","");
  151. mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `Warnings`='0', `WarnReason1` = '(null)', `WarnReason2` = '(null)' WHERE `name`='%s'",playername);
  152. mysql_tquery(SQL,str,"","");
  153. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','0','1','3','3/3 warns','%s','AdmBot','%d')",playerid,playername, gettime());
  154. mysql_tquery(SQL,var100,"","");
  155. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  156. foreach(new idd : Player)
  157. {
  158. if(PlayerInfo[idd][pSQLID] == playerid)
  159. {
  160. format(stringg, sizeof(stringg), "You have received an warn from admin %s, reason: %s", givername, reason);
  161. SendClientMessage(idd, COLOR_RED, stringg);
  162. KickEx(idd);
  163. }
  164. }
  165. }
  166. }
  167. cache_delete(stringresultt);
  168. }
  169. case 5: {
  170. if(complaint > 0)
  171. {
  172. format(stringg, sizeof(stringg), "AdmPanel: %s has been muted by %s for %d minutes, reason: %s [complaint:%d].",playername,givername,actiontime,reason,complaint);
  173. SendAdminMessage(COLOR_LIGHTRED, stringg, 1);
  174. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  175. }
  176. else
  177. {
  178. format(stringg, sizeof(stringg), "AdmPanel: %s has been muted by %s for %d minutes, reason: %s.",playername,givername,actiontime,reason);
  179. SendAdminMessage(COLOR_LIGHTRED, stringg, 1);
  180. format(reason2,sizeof(reason2),"%s",reason);
  181. }
  182. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','7','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
  183. mysql_tquery(SQL,var100,"","");
  184. foreach(new idd : Player)
  185. {
  186. if(PlayerInfo[idd][pSQLID] == playerid)
  187. {
  188. PlayerInfo[idd][pMuted] = 1;
  189. PlayerInfo[idd][pMuteTime] = actiontime*60;
  190. format(stringg, sizeof(stringg), "* You were muted by Admin %s for %d minutes, reason: %s.", givername, actiontime, reason);
  191. SendClientMessage(idd, COLOR_RED, stringg);
  192. }
  193. }
  194. }
  195. case 6: {
  196. if(complaint > 0)
  197. {
  198. format(stringg, sizeof(stringg), "AdmPanel: %s has been kicked by %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
  199. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  200. format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
  201. }
  202. else
  203. {
  204. format(stringg, sizeof(stringg), "AdmPanel: %s has been kicked by %s, reason: %s.",playername,givername,reason);
  205. SendClientMessageToAll(COLOR_LIGHTRED, stringg);
  206. format(reason2,sizeof(reason2),"%s",reason);
  207. }
  208. mysql_format(SQL, var100, sizeof(var100), "INSERT INTO kicklogs (`playerid`,`giverid`,`playername`,`givername`,`reason`) VALUES ('%d','%d','%s','%s','%s')", playerid,giverid,playername,givername,reason2);
  209. mysql_tquery(SQL,var100,"","");
  210. foreach(new idd : Player)
  211. {
  212. if(PlayerInfo[idd][pSQLID] == playerid)
  213. {
  214. KickEx(idd);
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. mysql_query(SQL,"DELETE FROM `panelactions`");
  222.  
  223. cache_delete(stringresult);
  224. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement