Advertisement
ObtiMus

banct

Aug 4th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <ColorChat>
  6. #include <fvault>
  7.  
  8. #define PLUGIN "New Plug-In"
  9. #define VERSION "1.0"
  10. #define AUTHOR "author"
  11.  
  12.  
  13.  
  14. public plugin_init() {
  15. register_plugin(PLUGIN, VERSION, AUTHOR)
  16.  
  17. register_clcmd("say /banct", "banct")
  18. register_clcmd("say !banct", "banct")
  19. }
  20. public getbanct(id) {
  21.  
  22. new ip[56],skill_key[156],skill_value[156];
  23. get_user_ip(id, ip, charsmax(ip))
  24. format(skill_key, charsmax(skill_key), "%s_banct", ip)
  25. fvault_get_data(skill_key, skill_value , charsmax(skill_value))
  26. return str_to_num(skill_value)
  27. }
  28. public setbanct(id, s_s) {
  29.  
  30. new ip[56],skill_key[156],str_t[200];
  31. get_user_ip(id, ip, charsmax(ip))
  32. format(skill_key, charsmax(skill_key), "%s_banct", ip)
  33. format(str_t, charsmax(str_t), "%d", s_s)
  34. fvault_set_data(exp_vault, skill_key, str_t)
  35. }
  36.  
  37. public banct(id) {
  38. if (get_user_flags(id) & ADMIN_KICK ) {
  39. new menu = menu_create("\w[\r CaNoIL \w] BAN CT Menu", "banct_hand");
  40. new players[32], pnum, tempid;
  41. new szName[32], szTempid[10], newSz[32*2];
  42. get_players(players, pnum);
  43. for( new i; i<pnum; i++ ) {
  44. tempid = players[i];
  45. get_user_name(tempid, szName, charsmax(szName));
  46. if(getbanct(tempid) == 0) {format(newSz, 64, "\r%s \w<\yBAN=CT \r: \yNO>", szName);}
  47. else if(getbanct(tempid) == 1) {format(newSz, 64, "\r%s \w<\yBAN=CT \r: \yYES>", szName);}
  48. num_to_str(tempid, szTempid, charsmax(szTempid));
  49. menu_additem(menu, newSz, szTempid, 0);
  50. }
  51. menu_display(id, menu, 0);
  52. }
  53. return PLUGIN_HANDLED;
  54. }
  55.  
  56. public banct_hand(id, menu, item) {
  57. if( item == MENU_EXIT ) {
  58. menu_destroy(menu);
  59. return PLUGIN_HANDLED;
  60. }
  61. new data[6], szName[64],name[15],name2[15];
  62. new access, callback;
  63. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  64. new tempid = str_to_num(data);
  65. get_user_name(id, name , 14)
  66. get_user_name(tempid, name2 , 14)
  67. if (getbanct(tempid) == 0) {
  68. ColorChat(0, RED, "^1[ ^4%s %s ^1] Admin ^3%s ^4gove ^3BAN-CT ^1to Player ^3%s", name , name2)
  69. setbanct(tempid, 1)
  70. }
  71. else if (getbanct(tempid) == 1) {
  72. ColorChat(0, RED, "^1[ ^4%s %s ^1] Admin ^3%s ^4removed ^3BAN-CT ^1to Player ^3%s", name , name2)
  73. setbanct(tempid, 0)
  74. }
  75. banct(id)
  76. return PLUGIN_HANDLED;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement