Advertisement
Guest User

realNick v1.1.2 beta

a guest
Apr 9th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.55 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <fakemeta>
  6.  
  7. #define PLUGIN "RealNick"
  8. #define VERSION "1.12"
  9. #define AUTHOR "nacknic"
  10.  
  11. new sid[32][32], snick[32][32], j = 0;
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin(PLUGIN, VERSION, AUTHOR);
  16.     rndb();
  17.     register_clcmd("say", "rn_register");
  18. }  
  19.  
  20. public client_infochanged(id) rn(id);
  21.  
  22. public rndb()
  23. {
  24.     new path[] = "addons/new folder/1.txt";
  25.     if(file_exists(path))
  26.     {
  27.         new file = fopen(path, "r"), args[32];
  28.         if(file)
  29.         {
  30.             while(!feof(file))
  31.             {
  32.                 fgets(file, args, 31);
  33.                 split(args, sid[j], 31, snick[j], 31, ",");
  34.                 args[0] = 0;
  35.                 j++;
  36.             }
  37.         }
  38.         fclose(file);
  39.     }
  40. }
  41.  
  42. public rn(id)
  43. {
  44.     if(is_user_alive(id))
  45.     {
  46.         new cid[32], cnick[32];
  47.         get_user_authid(id, cid, charsmax(cid));
  48.         get_user_name(id, cnick, charsmax(cnick));
  49.         for(new i = 0; i < 31; i++)
  50.         {
  51.             if(equal(cid, sid[i]))
  52.             {
  53.                 if(equali(cnick, snick[i])) break;
  54.                 else if(!equali(cnick, snick[i]))
  55.                 {
  56.                     set_user_info(id, "name", snick[i]);
  57.                     client_print(id, print_chat, "fake nick not allowed");
  58.                     break;
  59.                 }
  60.             }
  61.         }
  62.     }
  63.     return PLUGIN_HANDLED;
  64. }
  65.  
  66. public rn_register (id)
  67. {
  68.     new cid[32], cnick[32], id_registered = 1, nick_registered = 1, fsnick[32][32];
  69.     get_user_authid(id, cid, charsmax(cid));
  70.     get_user_name(id, cnick, charsmax(cnick));
  71.     new path[] = "addons/new folder/1.txt";
  72.     new argz[32], command[6], nick[32];
  73.     read_args(argz, charsmax(argz));
  74.     remove_quotes(argz);
  75.     split(argz, command, charsmax(command), nick, charsmax(nick), " ");
  76.     if(!equali(command, "!rg")) return PLUGIN_HANDLED;
  77.     else
  78.     {
  79.         new ilen = strlen(nick);
  80.         if(ilen <= 2)
  81.         {
  82.             client_print(0, print_chat, "nick must have at least three chars #1");
  83.             return PLUGIN_HANDLED;
  84.         }
  85.         else
  86.         {
  87.             new c[11], alpabet = 0;
  88.             for(new i = 0; i < ilen; i++)
  89.             {
  90.                 format(c[i], charsmax(c), "%c", nick[i]);
  91.                 if(isalpha(c[i])) alpabet = 1;
  92.                 else
  93.                 {
  94.                     alpabet = 0;
  95.                     break;
  96.                 }
  97.             }
  98.             if(alpabet == 0)
  99.             {
  100.                 client_print(id, print_chat, "nick must have at least three chars #2");
  101.                 return PLUGIN_HANDLED;
  102.             }
  103.             else
  104.             {
  105.                 for(new i = 0 ; i < 32; i++)
  106.                 {
  107.                     if(equal(cid, sid[i]))
  108.                     {
  109.                         client_print(id, print_chat, "this steamid are registered: %s", sid[i]);
  110.                         break;
  111.                     }
  112.                     else if(i == 31 &&  !equal(cid, sid[i])) id_registered = 0;
  113.                 }
  114.                 for(new i = 0; i < 32; i++)
  115.                 {
  116.                     copy(fsnick[i], charsmax(fsnick), snick[i]);
  117.                     replace(fsnick[i], charsmax(fsnick), "^n", "");
  118.                     if(equali(fsnick[i], nick))
  119.                     {
  120.                         client_print(id, print_chat, "this nick are registered: %s", fsnick[i]);
  121.                         break;
  122.                     }
  123.                     else if(i == 31 &&  !equal(nick, fsnick[i])) nick_registered = 0;
  124.                 }
  125.                 if(id_registered == 1 || nick_registered == 1) return PLUGIN_HANDLED;
  126.                 else
  127.                 {
  128.                         new argw[32];
  129.                         if(file_exists(path))
  130.                         {
  131.                             format(argw,31,"%s,%s%s", cid, nick, "^n");
  132.                             new file1 = fopen(path, "at");
  133.                             if(file1)
  134.                             {
  135.                                 fputs(file1, argw);
  136.                                 split(argw, sid[j], 31, snick[j], 31, ",");
  137.                  set_user_info(id, "name", snick[j]);
  138.                                 client_print(0, print_chat, "welcome %s to our server you are registered", snick[j]);
  139.                             }
  140.                             fclose(file1);
  141.                         }
  142.                 }
  143.                
  144.             }
  145.         }
  146.     }
  147.     return PLUGIN_HANDLED;
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement