Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #define PLUGIN "RealNick"
- #define VERSION "1.12"
- #define AUTHOR "nacknic"
- new sid[32][32], snick[32][32], j = 0;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- rndb();
- register_clcmd("say", "rn_register");
- }
- public client_infochanged(id) rn(id);
- public rndb()
- {
- new path[] = "addons/new folder/1.txt";
- if(file_exists(path))
- {
- new file = fopen(path, "r"), args[32];
- if(file)
- {
- while(!feof(file))
- {
- fgets(file, args, 31);
- split(args, sid[j], 31, snick[j], 31, ",");
- args[0] = 0;
- j++;
- }
- }
- fclose(file);
- }
- }
- public rn(id)
- {
- if(is_user_alive(id))
- {
- new cid[32], cnick[32];
- get_user_authid(id, cid, charsmax(cid));
- get_user_name(id, cnick, charsmax(cnick));
- for(new i = 0; i < 31; i++)
- {
- if(equal(cid, sid[i]))
- {
- if(equali(cnick, snick[i])) break;
- else if(!equali(cnick, snick[i]))
- {
- set_user_info(id, "name", snick[i]);
- client_print(id, print_chat, "fake nick not allowed");
- break;
- }
- }
- }
- }
- return PLUGIN_HANDLED;
- }
- public rn_register (id)
- {
- new cid[32], cnick[32], id_registered = 1, nick_registered = 1, fsnick[32][32];
- get_user_authid(id, cid, charsmax(cid));
- get_user_name(id, cnick, charsmax(cnick));
- new path[] = "addons/new folder/1.txt";
- new argz[32], command[6], nick[32];
- read_args(argz, charsmax(argz));
- remove_quotes(argz);
- split(argz, command, charsmax(command), nick, charsmax(nick), " ");
- if(!equali(command, "!rg")) return PLUGIN_HANDLED;
- else
- {
- new ilen = strlen(nick);
- if(ilen <= 2)
- {
- client_print(0, print_chat, "nick must have at least three chars #1");
- return PLUGIN_HANDLED;
- }
- else
- {
- new c[11], alpabet = 0;
- for(new i = 0; i < ilen; i++)
- {
- format(c[i], charsmax(c), "%c", nick[i]);
- if(isalpha(c[i])) alpabet = 1;
- else
- {
- alpabet = 0;
- break;
- }
- }
- if(alpabet == 0)
- {
- client_print(id, print_chat, "nick must have at least three chars #2");
- return PLUGIN_HANDLED;
- }
- else
- {
- for(new i = 0 ; i < 32; i++)
- {
- if(equal(cid, sid[i]))
- {
- client_print(id, print_chat, "this steamid are registered: %s", sid[i]);
- break;
- }
- else if(i == 31 && !equal(cid, sid[i])) id_registered = 0;
- }
- for(new i = 0; i < 32; i++)
- {
- copy(fsnick[i], charsmax(fsnick), snick[i]);
- replace(fsnick[i], charsmax(fsnick), "^n", "");
- if(equali(fsnick[i], nick))
- {
- client_print(id, print_chat, "this nick are registered: %s", fsnick[i]);
- break;
- }
- else if(i == 31 && !equal(nick, fsnick[i])) nick_registered = 0;
- }
- if(id_registered == 1 || nick_registered == 1) return PLUGIN_HANDLED;
- else
- {
- new argw[32];
- if(file_exists(path))
- {
- format(argw,31,"%s,%s%s", cid, nick, "^n");
- new file1 = fopen(path, "at");
- if(file1)
- {
- fputs(file1, argw);
- split(argw, sid[j], 31, snick[j], 31, ",");
- set_user_info(id, "name", snick[j]);
- client_print(0, print_chat, "welcome %s to our server you are registered", snick[j]);
- }
- fclose(file1);
- }
- }
- }
- }
- }
- return PLUGIN_HANDLED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement