Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN "New Plug-In"
- #define VERSION "1.0"
- #define AUTHOR "arsmi"
- new Array:g_arNames
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- }
- public plugin_precache()
- {
- readIni()
- }
- public client_connectex(id, const name[], const ip[], reason[128])
- {
- for(new i, szName[MAX_PLAYERS];i < ArraySize(g_arNames);i++)
- {
- ArrayGetString(g_arNames, i, szName, charsmax(szName))
- if(containi(name, szName) != -1)
- {
- formatex(reason, charsmax(reason), "Get OUT!")
- return PLUGIN_HANDLED
- }
- }
- return PLUGIN_CONTINUE
- }
- readIni()
- {
- g_arNames = ArrayCreate(32)
- new szConfig[256]
- get_configsdir(szConfig, charsmax(szConfig))
- format(szConfig, charsmax(szConfig), "%s/blocked_names.ini", szConfig)
- new iFile = fopen(szConfig,"r");
- if(iFile)
- {
- new sText[512],szName[32]
- while(!feof(iFile))
- {
- fgets(iFile,sText,charsmax(sText));
- trim(sText);
- switch(sText[0])
- {
- case EOS, '#', ';', '/':
- {
- continue;
- }
- default:
- {
- parse(sText,szName,charsmax(szName))
- {
- ArrayPushString(g_arNames, szName)
- }
- }
- }
- }
- fclose(iFile)
- }
- for(new i, szName[MAX_PLAYERS];i < ArraySize(g_arNames);i++)
- {
- ArrayGetString(g_arNames, i, szName, charsmax(szName))
- log_to_file("log.log", "%s", szName )
- }
- }
- public client_infochanged(id)
- {
- new szNewName[32]
- get_user_info( id, "name", szNewName, charsmax(szNewName) );
- for(new i, szName[MAX_PLAYERS];i < ArraySize(g_arNames);i++)
- {
- ArrayGetString(g_arNames, i, szName, charsmax(szName))
- if(containi(szNewName, szName) != -1)
- client_print(id, print_chat, "proibido")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement