Krond Functions 1.6.3-stable (SMA)

Aici ve-ti gasi sau puteti posta pluginuri AMX Mod X Aprobate.
Post Reply
User avatar
CryWolf
Root Admin
Root Admin
Posts: 391
Joined: Tue Dec 15, 2009 11:32 am
Detinator Steam: Da
Cunostinte CS: Excelente
Reputatie: Detinator
Webmaster
Scripter
Trance Fan
Location: Botosani

Krond Functions 1.6.3-stable (SMA)

Post by CryWolf »

Salut, va ofer versiunea 1.6.3 a pluginului de protejare Krond, pentru a sti despre ce va protejeaza cititi mai jos

Code: Select all

                "// ==================================================", -1);
                "// ============= Krond Solutions @ 2014 =============", -1);
                "// ==================================================", -1);
                285768, -1);
                "// ====== Krond Functions 1.6.3-stable (03.Septembrie.2014) ======", -1);
                "// URL: http://forum.krond.org/index.php?/files/file/1-krond-functions", -1);
                286328, -1);
                "//  -> amx_krondfunctions_cfgflood", -1);
                "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa floodeze serverul prin traditionalele config-uri executate in consola", -1);
                "// Impact: Serverul experimenteaza lag peste 200+ la orice jucator prezent pe server, fiind floodat prin 'fullupdate'", -1);
                "// Update: Incepand de la versiunea 1.5.2, filtrarea floodului prin config nu mai este insotita de alarme false, in speta cvar-ul pentru imunitate admini este scos.", -1);
                "// Valoarea 0: functia este dezactivata complet, se va incerca doar stoparea efectului", -1);
                "// Valoarea 1: setat in mod implicit (default), kick la atacator.", -1);
                "// Valoarea 2: setat in mod agresiv, kick si ban la atacator", -1);
                "amx_krondfunctions_cfgflood 1", -1);
                289176, -1);
                289184, -1);
                "//  -> amx_krondfunctions_specbug", -1);
                "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa afecteze buna functionare a serverului prin specbug ", -1);
                "// Impact: Serverul primeste crash in momentul in care se apeleaza la acest bug ", -1);
                "// Valoarea 0: se va bloca efectul, jucatorul ce incearca sa faca asta nu va fi pedepsit ", -1);
                "// Valoarea 1: setat in mod preventiv, va urmari activitatea si va executa kick la individul ce incearca sa ne faca probleme. ", -1);
                "// Valoarea 2: setat in mod agresiv, va urmari activitatea si va executa kick+ban 15 minute la individul ce incearca sa ne faca probleme. ", -1);
                "amx_krondfunctions_specbug 1 ", -1);
                291720, -1);
                291728, -1);
                "// -> amx_krondfunctions_autobuy", -1);
                "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa afecteze buna functionare a serverului prin autobuy ", -1);
                "// Impact: Serverul primeste crash in momentul in care se apeleaza la acest bug", -1);
                "// Valoarea 0: se va bloca efectul (crash-ul in sine), jucatorul ce incearca sa faca asta nu va fi pedepsit (valoare implicita)", -1);
                "// Valoarea 1: Va urmari activitatea si va executa kick respectivului.", -1);
                "// Valoarea 2: setat in mod agresiv, va urmari activitatea si va executa kick+ban 15 minute la individul ce incearca sa ne faca probleme.", -1);
                "amx_krondfunctions_autobuy 0", -1);
                294176, -1);
                294184, -1);
                "// -> amx_krondfunctions_blockcmd", -1);
                "// Scop: Urmareste tabela de chat in scopul unor activitati suspecte ce pot declansa un comportament nedorit serverului din pricina bug-urilor existente in plugin-urile instalate ori spam-uri de chat ", -1);
                "// Impact: In functie de bug, se poate ajunge la blocarea serverului, crash ori chiar freeze care nu se poate repara decat cu hard-restart", -1);
                "// Valoarea 0: functia este dezactivata complet, NU se va incerca stoparea efectului", -1);
                "// Valoarea 1: setat in mod implicit (default), va urmari comportamentul jucatorului si va bloca eventuala activitate suspecta.", -1);
                "// Valoarea 2: setat in mod agresiv, va urmari comportamentul jucatorului si va bloca eventuala activitate suspecta, blocand in acelasi timp chat-ul celor ce sunt conectati de mai putin de 15 secunde (posibil boti de spam)", -1);
                "amx_krondfunctions_blockcmd 1", -1);
                297552, -1);
                297560, -1);
                "// -> amx_krondfunctions_vaultclean", -1);
                "// Scop: Inainte de schimbarea hartii, in plugin_end - se va sterge vault.ini ", -1);
                "// Impact: Serverul incarca foarte greu noua harta, in cazul in care vault.ini are o dimensiune chiar si de cativa KB", -1);
                "// Valoarea 0: functia este dezactivata complet, plugin-ul nu va actiona", -1);
                "// Valoarea 1: setat in mod implicit (default), va sterge fisierul addons/amxmodx/data/vault.ini inainte de schimbarea hartii", -1);
                "amx_krondfunctions_vaultclean 1", -1);
                299424, -1);
                299432, -1);
                "// -> amx_krondfunctions_banclean", -1);
                "// Scop: Curata banurile de pe server date pe IP-ul serverului, clasa serverului sau 0.0.0.0 ", -1);
                "// Impact: In cazul in care un admin pune ban pe clasele serverului - plugin-ul va scoate acest ban.", -1);
                "// Valoarea 0: functia este dezactivata complet, nu se vor scoate banurile.", -1);
                "// Valoarea 1: setat in mod implicit (default), se vor scoate banurile pe clasa serverului sau pe 0.0.0.0", -1);
                "amx_krondfunctions_banclean 1", -1);
                301204, -1);
                301212, -1);
                "// -> amx_krondfunctions_customhpk", -1);
                "// Scop: La finalul fiecarei harti, se va verifica daca binecunoscutul fisier custom.hpk poate creea probleme prin dimensiuniile sale ce depasesc 1 MB, in cazul in care setarea este activa iar custom.hpk are mai mult de 1 MB - se va sterge fisierul.", -1);
                "// Valoarea 0: Inactiv ", -1);
                "// Valoarea 1: Activ (valoare implicita)", -1);
                "amx_krondfunctions_customhpk 1", -1);
                302744, -1);
                302752, -1);
                "// -> amx_krondfunctions_hlxfix", -1);
                "// Scop: Sunt situatii in care statistica HLSTATSX: CE (gazduita la Krond sau nu), afiseaza jucatori online eronati, de exemplu 44/32 (adica 44 jucatori online din 32 posibili) - aceasta functie rezolva situatia prin generarea de loguri extinse pentru HLX", -1);
                "// Valoarea 0: Inactiv (valoare implicita)", -1);
                "// Valoarea 1: Activ", -1);
                "amx_krondfunctions_hlxfix 0", -1);
                304280, -1);
                304288, -1);
                "// -> amx_krondfunctions_log", -1);
                "// Scop: permitem sau nu plugin-ului sa ne creeze krond-functions.log in directorul /logs/ - mesajele critice vor fi scrise indiferent de valoarea setata", -1);
                "// Valoarea 0: Inactiv", -1);
                "// Valoarea 1: Activ (valoare implicita)", -1);
                "amx_krondfunctions_log 1", -1);
                305384, -1);
                305392, -1);
                "// -> amx_krondfunctions_log_admin", -1);
                "// Scop: permitem sau nu plugin-ului sa transmita cate un mesaj la fiecare admin online cu acces de ADMIN_KICK, mesajele vor contine informari cu privire la actiunile de kick/ban/gag ale plugin-ului de securitate.", -1);
                "// Valoarea 0: Inactiv", -1);
                "// Valoarea 1: Activ (valoare implicita)", -1);
                "amx_krondfunctions_log_admin 1", -1);
                306776, -1);
                306784, -1);
                "// -> amx_krondfunctions_log_client", -1);
                "// Scop: In cazul in care functiile specbug sau autobuy bug sunt pe zero (blocarea actiunii) iar valoarea acestui cvar este pozitiva, vom transmite un mesaj clientului prin care il informam referitor la blocarea actiunii in cauza.", -1);
                "// Valoarea 0: Inactiv", -1);
                "// Valoarea 1: Activ (valoare implicita)", -1);
                "amx_krondfunctions_log_client 1", -1);
                308244, -1);
                308252, -1);
                "// -> amx_krondfunctions_advertise", -1);
                "// Scop: In cazul in care doriti sa ne ajutati comunicand jucatorilor dumneavoastra la fiecare 5 minute ca serverul este protejat de Krond Functions, puneti pe 1 acest cvar", -1);
                "// Valoarea 0: Inactiv", -1);
                "// Valoarea 1: Activ (valoare implicita)", -1);
                "amx_krondfunctions_advertise 1", -1);
                "// ==================================================", -1);
                "// ==================================================", -1);
Descarcare:
Sursa:

Code: Select all



new _HTTP2_RequestTypes[3][0] =
{
        {
                71, ...
        },
        {
                80, ...
        },
        {
                72, ...
        }
};
new _HTTP2_Base64Table[65] =
{
        65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, 0
};
new _gHTTP2_Information[4][1194];
new _gHTTP2_URLParsed[4][907];
new _gHTTP2_QueData[1988];
new _gHTTP2_DataBuffer[32768];
new _gHTTP2_BufferLen;
new _gHTTP2_ReturnDummy;
new _gHTTP2_DownloadEntity;
new _gHTTP2_BufferSizeLarge[16];
new _gHTTP2_OneLarge[1];
new bool:_gHTTP2_Initialized;
new _gHTTP2_PostVars[1024];
new Array:_gHTTP2_Que_hArray;
new _gHTTP2_QueEntity;
new bool:_gHTTP2_QueInitialized = 91;
new KRFUNC_GENUINE[3];
new KRFUNC_GENUINE_NET;
new KRFUNC_GENUINE_TASK;
new KFFUNC_GENUINE_NET_TASK;
new KRFUNC_CONFFILE[20] =
{
        107, 114, 111, 110, 100, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 46, 99, 102, 103, 0
};
new KRFUNC_CONFDIR[64];
new KRFUNC_CONFFULL[128];
new KRFUNC_EXTERNALIP[16];
new KRFUNC_EXTERNALIP_UNAUTHORISED[16];
new KRFUNC_WEB_PLUGINURL[101];
new KRFUNC_WEB_PLUGINVER[11];
new KRFUNC_WEB_PLUGINUPD;
new bool:KRFUNC_CFGFLOOD[33];
new bool:KRFUNC_CFGFLOOD_WORK[33];
new bool:KRFUNC_SPAMFLOOD[33];
new bool:KRFUNC_SPAMFLOOD_WORK[33];
new Float:KRFUNC_CHATFLOODING[33];
new KRFUNC_CHATFLOOD[33];
new bool:KRFUNC_MULTILANG;
new K_socket;
new szRadioCommands[24][0] =
{
        {
                114, ...
        },
        {
                99, ...
        },
        {
                116, ...
        },
        {
                104, ...
        },
        {
                114, ...
        },
        {
                102, ...
        },
        {
                116, ...
        },
        {
                114, ...
        },
        {
                103, ...
        },
        {
                102, ...
        },
        {
                115, ...
        },
        {
                103, ...
        },
        {
                115, ...
        },
        {
                114, ...
        },
        {
                114, ...
        },
        {
                114, ...
        },
        {
                101, ...
        },
        {
                110, ...
        },
        {
                115, ...
        },
        {
                105, ...
        },
        {
                114, ...
        },
        {
                103, ...
        },
        {
                110, ...
        },
        {
                101, ...
        }
};
new tmpdate[12];
new tmplogfile[32];
new KRFUNC_LOGFILE[32];
bool:operator!=(Float:,_:)(Float:oper1, oper2)
{
        return floatcmp(oper1, float(oper2)) != 0;
}

bool:operator>(Float:,Float:)(Float:oper1, Float:oper2)
{
        return 0 < floatcmp(oper1, oper2);
}

bool:operator>=(Float:,_:)(Float:oper1, oper2)
{
        return 0 <= floatcmp(oper1, float(oper2));
}

is_user_admin(id)
{
        new __flags = get_user_flags(id, "amxx_configsdir");
        new var1;
        return __flags > 0 && !__flags & 33554432;
}

access(id, level)
{
        if (level == 16777216)
        {
                return is_user_admin(id);
        }
        if (level)
        {
                return level & get_user_flags(id, "amxx_configsdir");
        }
        return 1;
}

get_configsdir(name[], len)
{
        return get_localinfo("amxx_configsdir", name, len);
}

ColorChat(id, ColorChat_type:type, msg[])
{
        new var1;
        if (id && !is_user_connected(id))
        {
                return 0;
        }
        new message[193];
        new TeamName[4][] = {
                {
                        0, ...
                },
                {
                        84, ...
                },
                {
                        67, ...
                },
                {
                        83, ...
                }
        };
        vformat(message[1], 191, msg, 4);
        new var2;
        if (message[1] == 1 || message[1] == 3 || message[1] == 4)
        {
                vformat(message, 192, msg, 4);
        }
        else
        {
                switch (type)
                {
                        case 1:
                        {
                                message[0] = 1;
                        }
                        case 2:
                        {
                                message[0] = 4;
                        }
                        default:
                        {
                                message[0] = 3;
                        }
                }
        }
        message[192] = 0;
        new index;
        new MSG_Type;
        static get_user_msgid_saytext;
        if (!get_user_msgid_saytext)
        {
                get_user_msgid_saytext = get_user_msgid("SayText");
        }
        if (id)
        {
                MSG_Type = 8;
                index = id;
        }
        else
        {
                static maxplayers;
                if (!maxplayers)
                {
                        maxplayers = get_maxplayers();
                }
                if (type == ColorChat_type:3)
                {
                        new i = 1;
                        while (i <= maxplayers)
                        {
                                if (is_user_connected(i))
                                {
                                        message_begin(8, get_user_msgid_saytext, 216, i);
                                        write_byte(i);
                                        write_string(message);
                                        message_end();
                                }
                                i++;
                        }
                        return 1;
                }
                new i = 1;
                while (i <= maxplayers)
                {
                        if (is_user_connected(i))
                        {
                                index = i;
                                if (i > maxplayers)
                                {
                                        return 0;
                                }
                                MSG_Type = 2;
                        }
                        i++;
                }
                if (i > maxplayers)
                {
                        return 0;
                }
                MSG_Type = 2;
        }
        new ColorChange;
        new team = get_user_team(index, {0}, "amxx_configsdir");
        switch (type)
        {
                case 4:
                {
                        ColorChange = Team_Info(index, MSG_Type, TeamName[0][TeamName]);
                }
                case 5:
                {
                        ColorChange = Team_Info(index, MSG_Type, TeamName[1]);
                }
                case 6:
                {
                        ColorChange = Team_Info(index, MSG_Type, TeamName[2]);
                }
                default:
                {
                        ColorChange = 0;
                }
        }
        message_begin(MSG_Type, get_user_msgid_saytext, 216, index);
        write_byte(index);
        write_string(message);
        message_end();
        if (ColorChange)
        {
                Team_Info(index, MSG_Type, TeamName[team]);
        }
        return 1;
}

Team_Info(id, type, team[])
{
        static get_user_msgid_teaminfo;
        if (!get_user_msgid_teaminfo)
        {
                get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
        }
        message_begin(type, get_user_msgid_teaminfo, 216, id);
        write_byte(id);
        write_string(team);
        message_end();
        return 1;
}

HTTP2_getFilename(Index, name[], len)
{
        copy(name, len, _gHTTP2_Information[Index]);
        return 0;
}

HTTP2_Download(URL[], Filename[], CompleteHandler[], ProgressHandler[], Port, RequestType, Username[], Password[])
{
        new var1;
        if (!Filename[0] && !ProgressHandler[0])
        {
                log_amx(_gHTTP2_QueInitialized);
                return -1;
        }
        new i;
        while (i < 4 && _gHTTP2_Information[i][167] & 1)
        {
                i++;
        }
        if (i == 4)
        {
                log_amx("[HTTP2] Out of free download slots.");
                _gHTTP2_PostVars[0] = 0;
                return -1;
        }
        _HTTP2_ParseURL(URL, _gHTTP2_URLParsed[i], 9, _gHTTP2_URLParsed[i][139], 127, _gHTTP2_URLParsed[i][267], 127, _gHTTP2_URLParsed[i][10], 127, _gHTTP2_URLParsed[i][138], _gHTTP2_URLParsed[i][395], 127, _gHTTP2_URLParsed[i][523], 255, _gHTTP2_URLParsed[i][779], 127);
        new var4;
        if (_gHTTP2_URLParsed[i][138])
        {
                var4 = _gHTTP2_URLParsed[i][138];
        }
        else
        {
                if (Port == -2147483648)
                {
                        new var3;
                        if (equali(_gHTTP2_URLParsed[i], "https", "amxx_configsdir"))
                        {
                                var3 = 443;
                        }
                        else
                        {
                                var3 = 80;
                        }
                        var4 = var3;
                }
                var4 = Port;
        }
        _gHTTP2_Information[i][166] = var4;
        if (!_gHTTP2_URLParsed[i][139])
        {
                copy(_gHTTP2_URLParsed[i][139], 127, Username);
        }
        if (!_gHTTP2_URLParsed[i][267])
        {
                copy(_gHTTP2_URLParsed[i][267], 127, Password);
        }
        if (!Filename[0])
        {
                _gHTTP2_Information[i][162] = 0;
        }
        else
        {
                new var9 = fopen(Filename, "wb");
                _gHTTP2_Information[i][162] = var9;
                if (!var9)
                {
                        log_amx("[HTTP2] Error creating local file.");
                        _gHTTP2_PostVars[0] = 0;
                        return -1;
                }
        }
        static _HTTP2_Plugin[64];
        get_plugin(-1, _HTTP2_Plugin, "", 178232, "amxx_configsdir", 178236, "amxx_configsdir", 178240, "amxx_configsdir", 178244, "amxx_configsdir");
        new ResultNum = find_plugin_byfile(_HTTP2_Plugin, "amxx_configsdir");
        if (ProgressHandler[0])
        {
                _gHTTP2_Information[i][164] = CreateOneForward(ResultNum, ProgressHandler, 0);
        }
        if (CompleteHandler[0])
        {
                _gHTTP2_Information[i][165] = CreateOneForward(ResultNum, CompleteHandler, 0, 0);
        }
        _gHTTP2_Information[i][163] = socket_open(_gHTTP2_URLParsed[i][10], _gHTTP2_Information[i][166], 1, ResultNum);
        if (ResultNum)
        {
                switch (ResultNum)
                {
                        case 1:
                        {
                                log_amx("[HTTP2] Socket error: Error while creating socket.");
                        }
                        case 2:
                        {
                                log_amx("[HTTP2] Socket error: Couldn't resolve hostname. (%s)", _gHTTP2_URLParsed[i][10]);
                        }
                        case 3:
                        {
                                log_amx("[HTTP2] Socket error: Couldn't connect to host. (%s:%d)", _gHTTP2_URLParsed[i][10], _gHTTP2_Information[i][166]);
                        }
                        default:
                        {
                        }
                }
                _gHTTP2_PostVars[0] = 0;
                return -1;
        }
        static _HTTP2_TempScheme[10];
        static _HTTP2_TempStr[256];
        static _HTTP2_Auth[256];
        static _HTTP2_Request[2048];
        copy(_HTTP2_TempScheme, 9, _gHTTP2_URLParsed[i]);
        strtoupper(_HTTP2_TempScheme);
        decl RequestLen;
        new var5;
        if (_gHTTP2_URLParsed[i][779])
        {
                var5 = 189312;
        }
        else
        {
                var5 = 189320;
        }
        new var6;
        if (_gHTTP2_URLParsed[i][523])
        {
                var6 = 189300;
        }
        else
        {
                var6 = 189308;
        }
        RequestLen = formatex(_HTTP2_Request, 2047, "%s /%s%s%s%s%s %s/1.1\r\nHost: %s", _HTTP2_RequestTypes[RequestType], _gHTTP2_URLParsed[i][395], var6, _gHTTP2_URLParsed[i][523], var5, _gHTTP2_URLParsed[i][779], _HTTP2_TempScheme, _gHTTP2_URLParsed[i][10]);
        new var7;
        if (_gHTTP2_URLParsed[i][139] || _gHTTP2_URLParsed[i][267])
        {
                formatex(_HTTP2_TempStr, 255, "%s:%s", _gHTTP2_URLParsed[i][139], _gHTTP2_URLParsed[i][267]);
                _HTTP2_Encode64(_HTTP2_TempStr, _HTTP2_Auth, 255);
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nAuthorization: Basic %s", _HTTP2_Auth) + RequestLen;
        }
        new var8;
        if (RequestType == 1 && _gHTTP2_PostVars[0])
        {
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nContent-Length: %d", strlen(_gHTTP2_PostVars)) + RequestLen;
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nContent-Type: application/x-www-form-urlencoded") + RequestLen;
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\n\r\n%s", _gHTTP2_PostVars) + RequestLen;
                copy(_gHTTP2_Information[i][170], 1023, _gHTTP2_PostVars);
                _gHTTP2_PostVars[0] = 0;
        }
        formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\n\r\n");
        socket_send(_gHTTP2_Information[i][163], _HTTP2_Request, strlen(_HTTP2_Request));
        if (!_gHTTP2_DownloadEntity)
        {
                _gHTTP2_DownloadEntity = create_entity("info_target");
                if (!_gHTTP2_DownloadEntity)
                {
                        log_amx("[HTTP2] Failed to create entity.");
                        _gHTTP2_PostVars[0] = 0;
                        return -1;
                }
                entity_set_string(_gHTTP2_DownloadEntity, "amxx_configsdir", "http2_downloadentity");
                entity_set_float(_gHTTP2_DownloadEntity, 7, floatadd(1008981770, get_gametime()));
        }
        if (!_gHTTP2_Initialized)
        {
                register_think("http2_downloadentity", "_HTTP2_DownloadThread");
                _HTTP2_large_fromint(_gHTTP2_BufferSizeLarge, 16, 32768);
                _gHTTP2_Initialized = true;
        }
        copy(_gHTTP2_Information[i], 127, Filename);
        _gHTTP2_Information[i][167] = 1;
        _gHTTP2_Information[i][167] |= 2;
        _gHTTP2_Information[i][168] = RequestType;
        return i;
}

public _HTTP2_DownloadThread(ent)
{
        static _HTTP2_Index;
        _HTTP2_Index = 0;
        while (_HTTP2_Index < 4)
        {
                if (_gHTTP2_Information[_HTTP2_Index][167] & 1)
                {
                        if (socket_change(_gHTTP2_Information[_HTTP2_Index][163], 1000))
                        {
                                new var1;
                                if (_gHTTP2_Information[_HTTP2_Index][167] & 4 && _gHTTP2_Information[_HTTP2_Index][169] == _gHTTP2_Information[_HTTP2_Index][128])
                                {
                                        new tempdata[1];
                                        new strHex[6];
                                        new i;
                                        new bool:error;
                                        while (!error)
                                        {
                                                socket_recv(_gHTTP2_Information[_HTTP2_Index][163], tempdata, 2);
                                                switch (tempdata[0])
                                                {
                                                        case 10:
                                                        {
                                                                if (i)
                                                                {
                                                                        if (error)
                                                                        {
                                                                                _HTTP2_TransferDone(_HTTP2_Index, -2, true);
                                                                        }
                                                                        _HTTP2_GetChunkSize(strHex, _gHTTP2_Information[_HTTP2_Index][169]);
                                                                        if (!_gHTTP2_Information[_HTTP2_Index][169])
                                                                        {
                                                                                _gHTTP2_Information[_HTTP2_Index][145] = _gHTTP2_Information[_HTTP2_Index][128];
                                                                                _HTTP2_TransferDone(_HTTP2_Index, 0, true);
                                                                        }
                                                                        new var7 = _gHTTP2_Information[_HTTP2_Index][169];
                                                                        var7 = _gHTTP2_Information[_HTTP2_Index][128][var7];
                                                                }
                                                        }
                                                        case 13:
                                                        {
                                                        }
                                                        default:
                                                        {
                                                                new var2;
                                                                if (48 <= tempdata[0] <= 57 || 97 <= tempdata[0] <= 102 || 65 <= tempdata[0] <= 70)
                                                                {
                                                                        var3 = 1;
                                                                }
                                                                else
                                                                {
                                                                        var3 = 0;
                                                                }
                                                                if (var3)
                                                                {
                                                                        i++;
                                                                        strHex[i] = tempdata[0];
                                                                }
                                                                else
                                                                {
                                                                        error = true;
                                                                }
                                                        }
                                                }
                                        }
                                        if (error)
                                        {
                                                _HTTP2_TransferDone(_HTTP2_Index, -2, true);
                                        }
                                        _HTTP2_GetChunkSize(strHex, _gHTTP2_Information[_HTTP2_Index][169]);
                                        if (!_gHTTP2_Information[_HTTP2_Index][169])
                                        {
                                                _gHTTP2_Information[_HTTP2_Index][145] = _gHTTP2_Information[_HTTP2_Index][128];
                                                _HTTP2_TransferDone(_HTTP2_Index, 0, true);
                                        }
                                        new var7 = _gHTTP2_Information[_HTTP2_Index][169];
                                        var7 = _gHTTP2_Information[_HTTP2_Index][128][var7];
                                }
                                static HTTP2_tempLarge[16];
                                new tempsize;
                                if (_gHTTP2_Information[_HTTP2_Index][167] & 2)
                                {
                                        tempsize = 2048;
                                }
                                else
                                {
                                        if (_gHTTP2_Information[_HTTP2_Index][167] & 4)
                                        {
                                                tempsize = min(_gHTTP2_Information[_HTTP2_Index][169] - _gHTTP2_Information[_HTTP2_Index][128] + 1, 32768);
                                        }
                                        if (_gHTTP2_Information[_HTTP2_Index][167] & 8)
                                        {
                                                _HTTP2_large_add(HTTP2_tempLarge, 16, _gHTTP2_Information[_HTTP2_Index][146], 16);
                                                _HTTP2_large_sub(HTTP2_tempLarge, 16, _gHTTP2_Information[_HTTP2_Index][129], 16);
                                                _HTTP2_large_add(HTTP2_tempLarge, 16, _gHTTP2_OneLarge, 1);
                                                if (_HTTP2_large_comp(HTTP2_tempLarge, 16, _gHTTP2_BufferSizeLarge, 16) == 1)
                                                {
                                                        tempsize = 32768;
                                                }
                                                else
                                                {
                                                        tempsize = _HTTP2_large_toint(HTTP2_tempLarge, 16);
                                                }
                                        }
                                        tempsize = min(_gHTTP2_Information[_HTTP2_Index][145] - _gHTTP2_Information[_HTTP2_Index][128] + 1, 32768);
                                }
                                new var8 = socket_recv(_gHTTP2_Information[_HTTP2_Index][163], _gHTTP2_DataBuffer, tempsize);
                                _gHTTP2_BufferLen = var8;
                                if (!var8)
                                {
                                        _HTTP2_TransferDone(_HTTP2_Index, -3, true);
                                }
                                if (_gHTTP2_Information[_HTTP2_Index][167] & 2)
                                {
                                        _gHTTP2_Information[_HTTP2_Index][167] &= -3;
                                        static _HTTP2_Location[512];
                                        static _HTTP2_ReturnCodeExtended[32];
                                        new ReturnCode;
                                        _gHTTP2_BufferLen = _gHTTP2_BufferLen - _HTTP2_ParseHeader(_HTTP2_Index, ReturnCode, _HTTP2_ReturnCodeExtended, 31, _HTTP2_Location, 511);
                                        if (300 <= ReturnCode <= 307)
                                        {
                                                if (!(_HTTP2_FollowLocation(_HTTP2_Index, _HTTP2_Location)))
                                                {
                                                        _HTTP2_TransferDone(_HTTP2_Index, -4, true);
                                                }
                                        }
                                        if (!200 <= ReturnCode <= 299)
                                        {
                                                if (!ReturnCode)
                                                {
                                                        ReturnCode = -1;
                                                }
                                                _HTTP2_TransferDone(_HTTP2_Index, ReturnCode, true);
                                        }
                                        if (_gHTTP2_Information[_HTTP2_Index][167] & 4)
                                        {
                                                new Shift = _HTTP2_GetChunkSize(_gHTTP2_DataBuffer, _gHTTP2_Information[_HTTP2_Index][169]);
                                                _gHTTP2_BufferLen = _HTTP2_ShiftData(_gHTTP2_DataBuffer, Shift, _gHTTP2_BufferLen);
                                        }
                                }
                                if (_gHTTP2_Information[_HTTP2_Index][162])
                                {
                                        fwrite_blocks(_gHTTP2_Information[_HTTP2_Index][162], _gHTTP2_DataBuffer, _gHTTP2_BufferLen, 1);
                                }
                                new var9 = _gHTTP2_Information[_HTTP2_Index][128];
                                var9 = var9[_gHTTP2_BufferLen];
                                if (_gHTTP2_Information[_HTTP2_Index][167] & 8)
                                {
                                        _HTTP2_large_fromint(HTTP2_tempLarge, 16, _gHTTP2_BufferLen);
                                        _HTTP2_large_add(_gHTTP2_Information[_HTTP2_Index][129], 16, HTTP2_tempLarge, 16);
                                }
                                if (_gHTTP2_Information[_HTTP2_Index][164])
                                {
                                        ExecuteForward(_gHTTP2_Information[_HTTP2_Index][164], _gHTTP2_ReturnDummy, _HTTP2_Index);
                                        if (_gHTTP2_ReturnDummy == 1)
                                        {
                                                _HTTP2_TransferDone(_HTTP2_Index, 0, false);
                                        }
                                }
                                new var4;
                                if ((_gHTTP2_Information[_HTTP2_Index][167] & 8 && !_HTTP2_large_comp(_gHTTP2_Information[_HTTP2_Index][129], 16, _gHTTP2_Information[_HTTP2_Index][146], 16)) || (!_gHTTP2_Information[_HTTP2_Index][167] & 8 && _gHTTP2_Information[_HTTP2_Index][145] == _gHTTP2_Information[_HTTP2_Index][128]))
                                {
                                        _HTTP2_TransferDone(_HTTP2_Index, 0, true);
                                }
                        }
                }
                _HTTP2_Index += 1;
        }
        entity_set_float(_gHTTP2_DownloadEntity, 7, floatadd(1008981770, get_gametime()));
        return 0;
}

public _HTTP2_QueThread()
{
        new count;
        new i;
        while (i < 4)
        {
                if (!_gHTTP2_Information[i][167] & 1)
                {
                        count++;
                }
                i++;
        }
        new Arraysize = ArraySize(_gHTTP2_Que_hArray);
        if (count > Arraysize)
        {
                count = Arraysize;
        }
        count--;
        while (count)
        {
                ArrayGetArray(_gHTTP2_Que_hArray, "amxx_configsdir", _gHTTP2_QueData);
                ArrayDeleteItem(_gHTTP2_Que_hArray, "amxx_configsdir");
                if (_gHTTP2_QueData[707] == 1)
                {
                        copy(_gHTTP2_PostVars, 1023, 34248 + 3856);
                }
                HTTP2_Download(_gHTTP2_QueData, 34248 + 2048, 34248 + 2560, 34248 + 2692, _gHTTP2_QueData[706], _gHTTP2_QueData[707], 34248 + 2832, 34248 + 3344);
        }
        if (!ArraySize(_gHTTP2_Que_hArray))
        {
                entity_set_int(_gHTTP2_QueEntity, 27, 1073741824);
                call_think(_gHTTP2_QueEntity);
                _gHTTP2_QueEntity = 0;
                return 0;
        }
        entity_set_float(_gHTTP2_QueEntity, 7, floatadd(1065353216, get_gametime()));
        return 0;
}

_HTTP2_TransferDone(Index, Error, bool:CallHandler)
{
        if (_gHTTP2_Information[Index][162])
        {
                fclose(_gHTTP2_Information[Index][162]);
        }
        socket_close(_gHTTP2_Information[Index][163]);
        new var1;
        if (CallHandler && _gHTTP2_Information[Index][165])
        {
                ExecuteForward(_gHTTP2_Information[Index][165], _gHTTP2_ReturnDummy, Index, Error);
        }
        DestroyForward(_gHTTP2_Information[Index][164]);
        DestroyForward(_gHTTP2_Information[Index][165]);
        _gHTTP2_Information[Index][128] = 0;
        _gHTTP2_Information[Index][145] = 0;
        _gHTTP2_Information[Index][169] = 0;
        _gHTTP2_Information[Index][164] = 0;
        _gHTTP2_Information[Index][165] = 0;
        _gHTTP2_Information[Index][162] = 0;
        _gHTTP2_Information[Index][167] = 0;
        _gHTTP2_Information[Index][170] = 0;
        new i;
        while (i < 4)
        {
                if (_gHTTP2_Information[i][167] & 1)
                {
                        return 0;
                }
                i++;
        }
        entity_set_int(_gHTTP2_DownloadEntity, 27, 1073741824);
        call_think(_gHTTP2_DownloadEntity);
        _gHTTP2_DownloadEntity = 0;
        return 0;
}

_HTTP2_FollowLocation(Index, Location[])
{
        socket_close(_gHTTP2_Information[Index][163]);
        new bool:Relative = 1;
        static _HTTP2_Follow_TempURLParsed[907];
        arrayset(_HTTP2_Follow_TempURLParsed, "amxx_configsdir", 907);
        _HTTP2_ParseURL(Location, _HTTP2_Follow_TempURLParsed, 9, 192464 + 556, 127, 192464 + 1068, 127, 192464 + 40, 127, 192464 + 552, 192464 + 1580, 127, 192464 + 2092, 255, 192464 + 3116, 127);
        if (_HTTP2_Follow_TempURLParsed[0])
        {
                copy(_gHTTP2_URLParsed[Index], 9, _HTTP2_Follow_TempURLParsed);
        }
        if (_HTTP2_Follow_TempURLParsed[10])
        {
                copy(_gHTTP2_URLParsed[Index][10], 127, 192464 + 40);
                Relative = false;
        }
        if (_HTTP2_Follow_TempURLParsed[138])
        {
                _gHTTP2_Information[Index][166] = _HTTP2_Follow_TempURLParsed[138];
        }
        if (_HTTP2_Follow_TempURLParsed[139])
        {
                copy(_gHTTP2_URLParsed[Index][139], 127, 192464 + 556);
        }
        if (_HTTP2_Follow_TempURLParsed[267])
        {
                copy(_gHTTP2_URLParsed[Index][267], 127, 192464 + 1068);
        }
        if (_HTTP2_Follow_TempURLParsed[395])
        {
                if (Relative)
                {
                        add(_gHTTP2_URLParsed[Index][395], 127, 192464 + 1580, "amxx_configsdir");
                }
                copy(_gHTTP2_URLParsed[Index][395], 127, 192464 + 1580);
        }
        if (_HTTP2_Follow_TempURLParsed[523])
        {
                copy(_gHTTP2_URLParsed[Index][523], 255, 192464 + 2092);
        }
        if (_HTTP2_Follow_TempURLParsed[779])
        {
                copy(_gHTTP2_URLParsed[Index][779], 127, 192464 + 3116);
        }
        new ResultNum;
        _gHTTP2_Information[Index][163] = socket_open(_gHTTP2_URLParsed[Index][10], _gHTTP2_Information[Index][166], 1, ResultNum);
        if (ResultNum)
        {
                switch (ResultNum)
                {
                        case 1:
                        {
                                log_amx("[HTTP2] Socket error: Error while creating socket.");
                        }
                        case 2:
                        {
                                log_amx("[HTTP2] Socket error: Couldn't resolve hostname.");
                        }
                        case 3:
                        {
                                log_amx("[HTTP2] Socket error: Couldn't connect to given hostname:port.");
                        }
                        default:
                        {
                        }
                }
                return 0;
        }
        static _HTTP2_TempScheme[10];
        static _HTTP2_TempStr[256];
        static _HTTP2_Auth[256];
        static _HTTP2_Request[2048];
        copy(_HTTP2_TempScheme, 9, _gHTTP2_URLParsed[Index]);
        strtoupper(_HTTP2_TempScheme);
        decl RequestLen;
        new var1;
        if (_gHTTP2_URLParsed[Index][779])
        {
                var1 = 207164;
        }
        else
        {
                var1 = 207172;
        }
        new var2;
        if (_gHTTP2_URLParsed[Index][523])
        {
                var2 = 207152;
        }
        else
        {
                var2 = 207160;
        }
        RequestLen = formatex(_HTTP2_Request, 2047, "%s /%s%s%s%s%s %s/1.1\r\nHost: %s", _HTTP2_RequestTypes[_gHTTP2_Information[Index][168]], _gHTTP2_URLParsed[Index][395], var2, _gHTTP2_URLParsed[Index][523], var1, _gHTTP2_URLParsed[Index][779], _HTTP2_TempScheme, _gHTTP2_URLParsed[Index][10]);
        new var3;
        if (_gHTTP2_URLParsed[Index][139] || _gHTTP2_URLParsed[Index][267])
        {
                formatex(_HTTP2_TempStr, 255, "%s:%s", _gHTTP2_URLParsed[Index][139], _gHTTP2_URLParsed[Index][267]);
                _HTTP2_Encode64(_HTTP2_TempStr, _HTTP2_Auth, 255);
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nAuthorization: Basic %s", _HTTP2_Auth) + RequestLen;
        }
        new var4;
        if (_gHTTP2_Information[Index][168] == 1 && _gHTTP2_Information[Index][170])
        {
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nContent-Length: %d", strlen(_gHTTP2_Information[Index][170])) + RequestLen;
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\nContent-Type: application/x-www-form-urlencoded") + RequestLen;
                RequestLen = formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\n\r\n%s", _gHTTP2_Information[Index][170]) + RequestLen;
        }
        formatex(_HTTP2_Request[RequestLen], 2047 - RequestLen, "\r\n\r\n");
        socket_send(_gHTTP2_Information[Index][163], _HTTP2_Request, strlen(_HTTP2_Request));
        _gHTTP2_Information[Index][167] = 1;
        _gHTTP2_Information[Index][167] |= 2;
        return 1;
}

_HTTP2_ParseHeader(Index, &ReturnCode, ReturnCodeExtended[], ReturnCodeExtendedLen, Location[], LocationLen)
{
        static _HTTP2_TempStr[256];
        new HeaderLen;
        new iPos;
        new c;
        HeaderLen = containi(_gHTTP2_DataBuffer, "\r\n\r\n") + 1;
        if (HeaderLen)
        {
                HeaderLen += 3;
                iPos = containi(_gHTTP2_DataBuffer, "HTTP/1.1 ") + 9;
                new var1;
                if (iPos != 8 && iPos < HeaderLen)
                {
                        while (_gHTTP2_DataBuffer[c + iPos] != 13 && c < 255)
                        {
                                c++;
                                _HTTP2_TempStr[c] = _gHTTP2_DataBuffer[c + iPos];
                        }
                        _HTTP2_TempStr[c] = 0;
                        ReturnCode = str_to_num(_HTTP2_TempStr);
                        iPos = c + 1 + iPos;
                        c = 0;
                        while (_gHTTP2_DataBuffer[c + iPos] != 13 && _gHTTP2_DataBuffer[c + iPos] != 10 && c < ReturnCodeExtendedLen)
                        {
                                c++;
                                ReturnCodeExtended[c] = _gHTTP2_DataBuffer[c + iPos];
                        }
                        ReturnCodeExtended[c] = 0;
                }
                iPos = containi(_gHTTP2_DataBuffer, "Transfer-Encoding: ") + 19;
                c = 0;
                new var4;
                if (iPos != 18 && iPos < HeaderLen)
                {
                        while (_gHTTP2_DataBuffer[c + iPos] != 13 && c < 255)
                        {
                                c++;
                                _HTTP2_TempStr[c] = _gHTTP2_DataBuffer[c + iPos];
                        }
                        _HTTP2_TempStr[c] = 0;
                        if (equali(_HTTP2_TempStr, "chunked", "amxx_configsdir"))
                        {
                                _gHTTP2_Information[Index][167] |= 4;
                        }
                }
                if (300 <= ReturnCode <= 399)
                {
                        iPos = containi(_gHTTP2_DataBuffer, "Location: ") + 10;
                        c = 0;
                        new var6;
                        if (iPos != 9 && iPos < HeaderLen)
                        {
                                while (_gHTTP2_DataBuffer[c + iPos] != 13 && c < LocationLen)
                                {
                                        c++;
                                        Location[c] = _gHTTP2_DataBuffer[c + iPos];
                                }
                                Location[c] = 0;
                        }
                }
                iPos = containi(_gHTTP2_DataBuffer, "Content-Length: ") + 16;
                c = 0;
                new var8;
                if (iPos != 15 && iPos < HeaderLen)
                {
                        while (_gHTTP2_DataBuffer[c + iPos] != 13 && c < 255)
                        {
                                c++;
                                _HTTP2_TempStr[c] = _gHTTP2_DataBuffer[c + iPos];
                        }
                        _HTTP2_TempStr[c] = 0;
                        _gHTTP2_Information[Index][145] = str_to_num(_HTTP2_TempStr);
                        _HTTP2_large_fromstring(_gHTTP2_Information[Index][146], 16, _HTTP2_TempStr);
                        static HTTP2_tempLarge[16];
                        _HTTP2_large_fromint(HTTP2_tempLarge, 16, _gHTTP2_Information[Index][145]);
                        if (_HTTP2_large_comp(_gHTTP2_Information[Index][146], 16, HTTP2_tempLarge, 16))
                        {
                                _gHTTP2_Information[Index][167] |= 8;
                        }
                }
                else
                {
                        _gHTTP2_Information[Index][145] = -1;
                }
                _HTTP2_ShiftData(_gHTTP2_DataBuffer, HeaderLen, _gHTTP2_BufferLen);
        }
        return HeaderLen;
}

_HTTP2_ParseURL(URL[], Scheme[], Schemelen, User[], Userlen, Pass[], Passlen, Host[], Hostlen, &Port, Path[], Pathlen, Query[], Querylen, Fragment[], Fragmentlen)
{
        new temp;
        static Regex:_HTTP2_ParseURL_hRegex;
        if (!_HTTP2_ParseURL_hRegex)
        {
                _HTTP2_ParseURL_hRegex = regex_compile("(?:(\w+):///?)?(?:([\w&\$\+\,/\.;=\[\]\{\}\|\\\^\~%?#\-]+):([\w&\$\+\,/\.;=\[\]\{\}\|\\\^\~%?#\-]+)@)?((?:[\w-]+\.)*[\w-]+\.[\w-]+)?(?::(\d+))?(?:/?([\w&\$\+\,/\.;=@\[\]\{\}\|\\\^\~%\-]*))?(?:\?([\w&\$\+\,/\.;=@\[\]\{\}\|\\\^\~%:\-]*))?(?:#([\w&\$\+\,/\.;=@\[\]\{\}\|\\\^\~%:\-]*))?", temp, 210144, "amxx_configsdir", 210148);
        }
        new TempPort[8];
        regex_match_c(URL, _HTTP2_ParseURL_hRegex, temp);
        regex_substr(_HTTP2_ParseURL_hRegex, 1, Scheme, Schemelen);
        new var1;
        if (!Scheme[0] || equali(Scheme, "https", "amxx_configsdir"))
        {
                copy(Scheme, Schemelen, "http");
        }
        regex_substr(_HTTP2_ParseURL_hRegex, 2, User, Userlen);
        regex_substr(_HTTP2_ParseURL_hRegex, "", Pass, Passlen);
        regex_substr(_HTTP2_ParseURL_hRegex, 4, Host, Hostlen);
        regex_substr(_HTTP2_ParseURL_hRegex, 5, TempPort, 7);
        Port = str_to_num(TempPort);
        regex_substr(_HTTP2_ParseURL_hRegex, 6, Path, Pathlen);
        regex_substr(_HTTP2_ParseURL_hRegex, 7, Query, Querylen);
        regex_substr(_HTTP2_ParseURL_hRegex, 8, Fragment, Fragmentlen);
        return 0;
}

_HTTP2_GetChunkSize(Data[], &ChunkSize)
{
        new i;
        new c;
        new Hex[6];
        while (Data[i] == 13 || Data[i] == 10)
        {
                i++;
        }
        do {
                new var2;
                if (48 <= Data[i] <= 57 || 97 <= Data[i] <= 102 || 65 <= Data[i] <= 70)
                {
                        var3 = 1;
                }
                else
                {
                        var3 = 0;
                }
                if (var3)
                {
                        c++;
                        i++;
                        Hex[c] = Data[i];
                }
                while (Data[i] == 13 || Data[i] == 10)
                {
                        i++;
                }
                ChunkSize = _HTTP2_HexToDec(Hex);
                return i;
                c++;
                i++;
                Hex[c] = Data[i];
        new var2;
        } while (true);
}

_HTTP2_ShiftData(Data[], Amt, Len)
{
        static _HTTP2_ShiftData_i;
        _HTTP2_ShiftData_i = Amt;
        while (_HTTP2_ShiftData_i < Len)
        {
                Data[_HTTP2_ShiftData_i - Amt] = Data[_HTTP2_ShiftData_i];
                _HTTP2_ShiftData_i += 1;
        }
        _HTTP2_ShiftData_i = Len - Amt;
        while (_HTTP2_ShiftData_i < Len)
        {
                Data[_HTTP2_ShiftData_i] = 0;
                _HTTP2_ShiftData_i += 1;
        }
        return Len - Amt;
}

public _HTTP2_PluginUpdater_Complete(Index, Error)
{
        new pluginfile[320];
        new tempfile[14];
        new temp[1];
        new len;
        if (Error)
        {
                get_plugin(-1, pluginfile, "", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir");
                log_amx("Error(%d) while autoupdating plugin: %s", pluginfile);
                return 0;
        }
        HTTP2_getFilename(Index, tempfile, 13);
        len = get_localinfo("amxx_pluginsdir", pluginfile, "");
        len++;
        pluginfile[len] = 47;
        get_plugin(-1, pluginfile[len], 319 - len, temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir");
        delete_file(pluginfile);
        rename_file(tempfile, pluginfile, 1);
        return 0;
}

_HTTP2_HexToDec(string[])
{
        new result;
        new mult = 1;
        new i = strlen(string) - 1;
        while (0 <= i)
        {
                new var1;
                if (48 <= string[i] <= 57)
                {
                        var1 = string[i] - 48;
                }
                else
                {
                        if (65 <= string[i] <= 90)
                        {
                                var1 = string[i] - 65 + 10;
                        }
                        if (97 <= string[i] <= 122)
                        {
                                var1 = string[i] - 97 + 10;
                        }
                        var1 = 0;
                }
                result = mult * var1 + result;
                mult *= 16;
                i--;
        }
        return result;
}

_HTTP2_Encode64(InputString[], OutputString[], len)
{
        new nLength;
        new resPos;
        new nPos;
        new cCode;
        new cFillChar = 61;
        setc(OutputString, len, "amxx_configsdir");
        nPos = 0;
        resPos = 0;
        nLength = strlen(InputString);
        while (nPos < nLength)
        {
                cCode = InputString[nPos] >>> 2 & 63;
                resPos = formatex(OutputString[resPos], len, "%c", _HTTP2_Base64Table[cCode]) + resPos;
                cCode = InputString[nPos] << 4 & 63;
                nPos++;
                if (nPos < nLength)
                {
                        cCode = InputString[nPos] >>> 4 & 15 | cCode;
                }
                resPos = formatex(OutputString[resPos], len, "%c", _HTTP2_Base64Table[cCode]) + resPos;
                if (nPos < nLength)
                {
                        cCode = InputString[nPos] << 2 & 63;
                        nPos++;
                        if (nPos < nLength)
                        {
                                cCode = InputString[nPos] >>> 6 & 3 | cCode;
                        }
                        resPos = formatex(OutputString[resPos], len, "%c", _HTTP2_Base64Table[cCode]) + resPos;
                }
                else
                {
                        nPos++;
                        resPos = formatex(OutputString[resPos], len, "%c", cFillChar) + resPos;
                }
                if (nPos < nLength)
                {
                        cCode = InputString[nPos] & 63;
                        resPos = formatex(OutputString[resPos], len, "%c", _HTTP2_Base64Table[cCode]) + resPos;
                }
                else
                {
                        resPos = formatex(OutputString[resPos], len, "%c", cFillChar) + resPos;
                }
                nPos++;
        }
        return 0;
}

_HTTP2_reverse_string(string[])
{
        new temp;
        new len = strlen(string);
        new i;
        while (len / 2 > i)
        {
                temp = string[i];
                string[i] = string[len - i - 1];
                string[len - i - 1] = temp;
                i++;
        }
        return 0;
}

_HTTP2_large_add(large[], large_size, add_what[], add_size)
{
        new carry;
        new i;
        while (i < large_size)
        {
                if (carry)
                {
                        new var1 = large[i];
                        var1 = var1[carry];
                        carry = large[i] / 10;
                        large[i] %= 10;
                }
                if (i < add_size)
                {
                        new var2 = large[i];
                        var2 = add_what[i][var2];
                        carry = large[i] / 10 + carry;
                        large[i] %= 10;
                }
                i++;
        }
        return 0;
}

_HTTP2_large_sub(large[], large_size, sub_what[], sub_size)
{
        new carry;
        new i;
        while (i < large_size)
        {
                if (large_size < i + 1)
                {
                        large[i + 1]--;
                        large[i] += 10;
                }
                if (carry)
                {
                        new var1 = large[i];
                        var1 = var1[carry];
                        carry = large[i] / 10;
                        large[i] %= 10;
                }
                if (i < sub_size)
                {
                        large[i] -= sub_what[i];
                        carry = large[i] / 10 + carry;
                        large[i] %= 10;
                }
                i++;
        }
        return 0;
}

_HTTP2_large_fromstring(large[], large_size, string[])
{
        arrayset(large, "amxx_configsdir", large_size);
        new len = strlen(string);
        _HTTP2_reverse_string(string);
        new i;
        while (i < large_size && string[i] && i < len)
        {
                new var2;
                if (48 <= string[i] <= 57)
                {
                        var2 = string[i] - 48;
                }
                else
                {
                        if (65 <= string[i] <= 90)
                        {
                                var2 = string[i] - 65 + 10;
                        }
                        if (97 <= string[i] <= 122)
                        {
                                var2 = string[i] - 97 + 10;
                        }
                        var2 = 0;
                }
                large[i] = var2;
                i++;
        }
        _HTTP2_reverse_string(string);
        return 0;
}

_HTTP2_large_fromint(large[], large_size, int)
{
        arrayset(large, "amxx_configsdir", large_size);
        new int2 = int;
        new i;
        while (i < large_size && int2)
        {
                large[i] = int2 % 10;
                int2 /= 10;
                i++;
        }
        return 0;
}

_HTTP2_large_toint(large[], large_size)
{
        new retval;
        new mult = 1;
        new i;
        while (i < large_size)
        {
                retval = mult * large[i] + retval;
                mult *= 10;
                i++;
        }
        return retval;
}

_HTTP2_large_comp(large1[], large1_size, large2[], large2_size)
{
        new len1 = large1_size;
        new len2 = large2_size;
        while (len1 > 0 && large1[len1])
        {
        }
        while (len2 > 0 && large2[len2])
        {
        }
        if (len1 > len2)
        {
                return 1;
        }
        if (len2 > len1)
        {
                return -1;
        }
        new i = len1;
        while (0 <= i)
        {
                if (large2[i] < large1[i])
                {
                        return 1;
                }
                if (large1[i] < large2[i])
                {
                        return -1;
                }
                i--;
        }
        return 0;
}

public plugin_init()
{
        register_plugin("Krond Functions", "1.6.3-rev5", "Krond Solutions SRL @ 2014");
        get_time("%d-%b-%Y", tmpdate, 11);
        format(tmplogfile, 31, "krond-functions_%s.log", tmpdate);
        copy(KRFUNC_LOGFILE, 31, tmplogfile);
        if (file_exists("addons/amxmodx/data/lang/Krond-Functions.txt"))
        {
                register_dictionary("Krond-Functions.txt");
                KRFUNC_MULTILANG = true;
        }
        else
        {
                KRFUNC_MULTILANG = false;
        }
        KRFUNC_GENUINE_NET = 0;
        register_cvar("amx_krondfunctions_cfgflood", 214708, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_specbug", 214824, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_autobuy", 214940, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_vaultclean", 215068, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_banclean", 215188, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_customhpk", 215312, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_rewriteconf", 215444, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_log", 215544, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_log_admin", 215668, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_log_client", 215796, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_advertise", 215920, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_hlxfix", 216032, "amxx_configsdir", "amxx_configsdir");
        register_cvar("amx_krondfunctions_blockcmd", 216152, "amxx_configsdir", "amxx_configsdir");
        register_concmd("amx_krondfunctions_version", "KRFUNC_PUBLIC_VERSION", -1, 216356, -1);
        register_clcmd("fullupdate", "KRFUNC_PUBLIC_CFGFLOOD", -1, 216496, -1);
        register_clcmd("joinclass", "KRFUNC_PUBLIC_SPECBUG", -1, 216496, -1);
        register_clcmd("menuselect", "KRFUNC_PUBLIC_SPECBUG_BLOCKVGUI", -1, 216496, -1);
        register_clcmd("cl_setautobuy", "KRFUNC_PUBLIC_AUTOBUY", -1, 216496, -1);
        register_clcmd("cl_setrebuy", "KRFUNC_PUBLIC_AUTOBUY", -1, 216496, -1);
        register_clcmd("say", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        register_clcmd("say_team", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        register_clcmd("amx_chat", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        register_clcmd("admin_chat", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        register_clcmd("amx_say", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        register_clcmd("admin_say", "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
        new i;
        while (i < 24)
        {
                register_clcmd(szRadioCommands[i], "KRFUNC_PUBLIC_BLOCKCMD", -1, 216496, -1);
                i++;
        }
        KRFUNC_GENUINE_TASK = random_num(1000, 9999);
        KFFUNC_GENUINE_NET_TASK = random_num(10000, 99999);
        set_task(1106247680, 217928, KFFUNC_GENUINE_NET_TASK, 218060, "amxx_configsdir", 218052, "amxx_configsdir");
        set_task(1133903872, "KRFUNC_PUBLIC_GENUINEKROND", KRFUNC_GENUINE_TASK, 218060, "amxx_configsdir", 218172, "amxx_configsdir");
        set_task(1092616192, "KRFUNC_PUBLIC_AUTOCONFCLASS", "amxx_configsdir", 218060, "amxx_configsdir", 218292, "amxx_configsdir");
        KRFUNC_PUBLIC_GENUINEKROND_NET();
        return 0;
}

public KRFUNC_PUBLIC_GENUINEKROND_NET()
{
        KRFUNC_GENUINE_NET += 1;
        if (KRFUNC_GENUINE_NET >= 6)
        {
                KRFUNC_PUBLIC_GENUINEKROND();
                return 0;
        }
        new LOCAL_KRFUNC_GENUINE[3];
        get_localinfo("KRFUNC_GENUINE", LOCAL_KRFUNC_GENUINE, 2);
        if (!equal(LOCAL_KRFUNC_GENUINE, "OK", "amxx_configsdir"))
        {
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: Rulez functia de verificare a licentei, [%d / 5]", "1.6.3-rev5", KRFUNC_GENUINE_NET);
        }
        new error_p;
        K_socket = socket_open("93.119.31.13", 80, 1, error_p);
        if (!error_p)
        {
                new sock_data[512];
                new sock_hostip[13];
                copy(sock_hostip, 12, "93.119.31.13");
                format(sock_data, 511, "GET /ip.php HTTP/1.1\nHost: %s\nConnection: Close\n\n", sock_hostip);
                socket_send(K_socket, sock_data, 512);
                set_task(1084227584, "KRFUNC_PUBLIC_GENUINEKROND_NETW", "amxx_configsdir", 218060, "amxx_configsdir", 218292, "amxx_configsdir");
        }
        else
        {
                socket_close(K_socket);
                copy(KRFUNC_EXTERNALIP, 15, "0.0.0.0");
                copy(KRFUNC_EXTERNALIP_UNAUTHORISED, 15, "0.0.0.0");
                if (!task_exists(KFFUNC_GENUINE_NET_TASK, "amxx_configsdir"))
                {
                        set_task(1106247680, "KRFUNC_PUBLIC_GENUINEKROND_NET", KFFUNC_GENUINE_NET_TASK, 218060, "amxx_configsdir", 219348, "amxx_configsdir");
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_GENUINEKROND_NETW()
{
        if (socket_change(K_socket, 100000))
        {
                new sock_data_recv[2048];
                socket_recv(K_socket, sock_data_recv, 2047);
                socket_close(K_socket);
                new pattern[13] = {65,73,80,73,88,58,40,46,42,63,41,33,0};
                new pattern2[19] = {83,82,86,77,65,83,84,69,82,73,80,58,40,46,42,63,41,59,0};
                new patternURL[13] = {80,76,85,71,87,58,40,46,42,63,41,33,0};
                new patternVER[13] = {80,76,85,71,77,58,40,46,42,63,41,33,0};
                new num;
                new error[128];
                new Regex:re = regex_match(sock_data_recv, pattern, num, error, 127, 219588);
                new num2;
                new error2[128];
                new Regex:re2 = regex_match(sock_data_recv, pattern2, num2, error2, 127, 219588);
                new num3;
                new error3[128];
                new Regex:re3 = regex_match(sock_data_recv, patternURL, num3, error3, 127, 219588);
                new num4;
                new error4[128];
                new Regex:re4 = regex_match(sock_data_recv, patternVER, num4, error4, 127, 219588);
                if (re >= Regex:1)
                {
                        regex_substr(re, 1, KRFUNC_EXTERNALIP, 15);
                        regex_free(re);
                }
                else
                {
                        copy(KRFUNC_EXTERNALIP, 15, "0.0.0.0");
                }
                if (re2 >= Regex:1)
                {
                        regex_substr(re2, 1, KRFUNC_EXTERNALIP_UNAUTHORISED, 15);
                        regex_free(re2);
                }
                else
                {
                        copy(KRFUNC_EXTERNALIP_UNAUTHORISED, 15, "0.0.0.0");
                }
                if (re3 >= Regex:1)
                {
                        regex_substr(re3, 1, KRFUNC_WEB_PLUGINURL, 100);
                        regex_free(re3);
                }
                if (re4 >= Regex:1)
                {
                        regex_substr(re4, 1, KRFUNC_WEB_PLUGINVER, 10);
                        regex_free(re4);
                }
        }
        else
        {
                socket_close(K_socket);
                copy(KRFUNC_EXTERNALIP, 15, "0.0.0.0");
                copy(KRFUNC_EXTERNALIP_UNAUTHORISED, 15, "0.0.0.0");
        }
        new var1;
        if (equal(KRFUNC_EXTERNALIP_UNAUTHORISED, "0.0.0.0", "amxx_configsdir") && equal(KRFUNC_EXTERNALIP, "0.0.0.0", "amxx_configsdir"))
        {
                if (!task_exists(KFFUNC_GENUINE_NET_TASK, "amxx_configsdir"))
                {
                        set_task(1106247680, "KRFUNC_PUBLIC_GENUINEKROND_NET", KFFUNC_GENUINE_NET_TASK, 218060, "amxx_configsdir", 219924, "amxx_configsdir");
                }
        }
        else
        {
                KRFUNC_PUBLIC_GENUINEKROND();
        }
        return 0;
}

public KRFUNC_PUBLIC_GENUINEKROND()
{
        new serverip[10];
        new serverip_full[16];
        new serverip_dedi[11];
        new serverip_echo[16];
        get_user_ip("amxx_configsdir", serverip_echo, 15, 1);
        new serverip_un[16];
        copy(serverip_un, 15, KRFUNC_EXTERNALIP_UNAUTHORISED);
        copy(serverip, 9, KRFUNC_EXTERNALIP);
        copy(serverip_dedi, 10, KRFUNC_EXTERNALIP);
        copy(serverip_full, 15, KRFUNC_EXTERNALIP);
        new var1;
        if (equal(serverip, "93.119.24", "amxx_configsdir") || equal(serverip, "93.119.25", "amxx_configsdir") || equal(serverip, "93.119.26", "amxx_configsdir") || equal(serverip, "93.119.27", "amxx_configsdir") || equal(serverip, "93.119.28", "amxx_configsdir") || equal(serverip, "93.119.29", "amxx_configsdir") || equal(serverip, "93.119.30", "amxx_configsdir") || equal(serverip, "93.119.31", "amxx_configsdir") || equal(serverip, "89.44.246", "amxx_configsdir") || equal(serverip_dedi, "94.177.106", "amxx_configsdir"))
        {
                if (task_exists(KFFUNC_GENUINE_NET_TASK, "amxx_configsdir"))
                {
                        remove_task(KFFUNC_GENUINE_NET_TASK, "amxx_configsdir");
                }
                if (!equal(KRFUNC_GENUINE, "OK", "amxx_configsdir"))
                {
                        new LOCAL_KRFUNC_GENUINE[3];
                        get_localinfo("KRFUNC_GENUINE", LOCAL_KRFUNC_GENUINE, 2);
                        if (!equal(LOCAL_KRFUNC_GENUINE, "OK", "amxx_configsdir"))
                        {
                                copy(KRFUNC_GENUINE, 2, "OK");
                                set_localinfo("KRFUNC_GENUINE", "OK");
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: IP-ul %s este autorizat, va multumim !", "1.6.3-rev5", serverip_echo);
                                }
                                if (equal(KRFUNC_WEB_PLUGINVER, "1.6.3-rev5", "amxx_configsdir"))
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Utilizezi ultima versiune a plugin-ului, nu sunt actualizari disponibile.", "1.6.3-rev5");
                                }
                                if (get_cvar_num("amx_krondfunctions_banclean") == 1)
                                {
                                        server_cmd("removeip %s", serverip_full);
                                        server_cmd("removeip %s.0", serverip);
                                        server_cmd("removeip %s.0", serverip_dedi);
                                        server_cmd("removeip 0.0.0.0");
                                        server_cmd("writeip");
                                }
                        }
                        else
                        {
                                copy(KRFUNC_GENUINE, 2, "OK");
                        }
                }
                new var2;
                if (!equal(KRFUNC_WEB_PLUGINVER, 221816, "amxx_configsdir") && !equal(KRFUNC_WEB_PLUGINVER, "1.6.3-rev5", "amxx_configsdir") && !equal(KRFUNC_WEB_PLUGINURL, 221868, "amxx_configsdir"))
                {
                        if (KRFUNC_WEB_PLUGINUPD)
                        {
                                new players[32];
                                new playersnum;
                                new curmap[33];
                                get_players(players, playersnum, "ch", 221888);
                                get_mapname(curmap, 32);
                                if (playersnum < 2)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: ## Nu sunt jucatori online, reincarcam harta dupa update-ul plugin-ului", "1.6.3-rev5", playersnum);
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: ## -> changelevel %s", "1.6.3-rev5", curmap);
                                        set_localinfo("KRFUNC_GENUINE", 222652);
                                        server_cmd("changelevel %s", curmap);
                                }
                                else
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Plugin-ul a fost actualizat intr-un proces anterior, schimba harta ori restart pentru aplicare.", "1.6.3-rev5");
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "GENUINE: Plugin-ul a fost actualizat (%s -> %s), te rog schimba harta pentru aplicarea noii versiuni", "1.6.3-rev5", KRFUNC_WEB_PLUGINVER);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                        }
                        else
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Se executa functia de actualizare automata a plugin-ului", "1.6.3-rev5");
                                KRFUNC_PUBLIC_UPDATEPLUGIN();
                        }
                }
                else
                {
                        new var3;
                        if (equal(KRFUNC_WEB_PLUGINVER, 224244, "amxx_configsdir") || equal(KRFUNC_WEB_PLUGINURL, 224252, "amxx_configsdir"))
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Nu pot verifica daca exista un nou update al plugin-ului, contacteaza support!", "1.6.3-rev5");
                        }
                }
                if (get_cvar_num("amx_krondfunctions_advertise") == 1)
                {
                        ColorChat(0, ColorChat_type:2, "Acest server este protejat de Krond Functions 1.6.3 (\x03www.krond.org\x04)");
                }
                if (delete_file("language.cfg") == 1)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: Am descoperit fisierul language.cfg in cstrike, prezenta lui afecteaza buna functionare a serverului sau chiar pornirea acestuia ! L-am sters si dau restart la server ...", "1.6.3-rev5");
                        server_cmd("quit");
                        server_cmd("shutdown");
                        server_cmd("exit");
                }
                new var4;
                if (get_cvar_num("amx_krondfunctions_cfgflood") > 2 || get_cvar_num("amx_krondfunctions_cfgflood") < 0)
                {
                        set_cvar_num("amx_krondfunctions_cfgflood", 1);
                }
                new var5;
                if (get_cvar_num("amx_krondfunctions_specbug") > 2 || get_cvar_num("amx_krondfunctions_specbug") < 0)
                {
                        set_cvar_num("amx_krondfunctions_specbug", "amxx_configsdir");
                }
                new var6;
                if (get_cvar_num("amx_krondfunctions_autobuy") > 2 || get_cvar_num("amx_krondfunctions_autobuy") < 0)
                {
                        set_cvar_num("amx_krondfunctions_autobuy", "amxx_configsdir");
                }
                new var7;
                if (get_cvar_num("amx_krondfunctions_vaultclean") > 1 || get_cvar_num("amx_krondfunctions_vaultclean") < 0)
                {
                        set_cvar_num("amx_krondfunctions_vaultclean", 1);
                }
                new var8;
                if (get_cvar_num("amx_krondfunctions_banclean") > 1 || get_cvar_num("amx_krondfunctions_banclean") < 0)
                {
                        set_cvar_num("amx_krondfunctions_banclean", 1);
                }
                new var9;
                if (get_cvar_num("amx_krondfunctions_customhpk") > 1 || get_cvar_num("amx_krondfunctions_customhpk") < 0)
                {
                        set_cvar_num("amx_krondfunctions_customhpk", 1);
                }
                new var10;
                if (get_cvar_num("amx_krondfunctions_rewriteconf") > 1 || get_cvar_num("amx_krondfunctions_rewriteconf") < 0)
                {
                        set_cvar_num("amx_krondfunctions_rewriteconf", "amxx_configsdir");
                }
                new var11;
                if (get_cvar_num("amx_krondfunctions_log") > 1 || get_cvar_num("amx_krondfunctions_log") < 0)
                {
                        set_cvar_num("amx_krondfunctions_log", 1);
                }
                new var12;
                if (get_cvar_num("amx_krondfunctions_log_admin") > 1 || get_cvar_num("amx_krondfunctions_log_admin") < 0)
                {
                        set_cvar_num("amx_krondfunctions_log_admin", 1);
                }
                new var13;
                if (get_cvar_num("amx_krondfunctions_log_client") > 1 || get_cvar_num("amx_krondfunctions_log_client") < 0)
                {
                        set_cvar_num("amx_krondfunctions_log_client", 1);
                }
                new var14;
                if (get_cvar_num("amx_krondfunctions_advertise") > 1 || get_cvar_num("amx_krondfunctions_advertise") < 0)
                {
                        set_cvar_num("amx_krondfunctions_advertise", 1);
                }
                new var15;
                if (get_cvar_num("amx_krondfunctions_hlxfix") > 1 || get_cvar_num("amx_krondfunctions_hlxfix") < 0)
                {
                        set_cvar_num("amx_krondfunctions_hlxfix", "amxx_configsdir");
                }
                new var16;
                if (get_cvar_num("amx_krondfunctions_blockcmd") > 2 || get_cvar_num("amx_krondfunctions_blockcmd") < 0)
                {
                        set_cvar_num("amx_krondfunctions_blockcmd", 1);
                }
                if (get_cvar_num("amx_debug"))
                {
                        set_cvar_num("amx_debug", "amxx_configsdir");
                }
        }
        else
        {
                if (!equal(KRFUNC_EXTERNALIP_UNAUTHORISED, "0.0.0.0", "amxx_configsdir"))
                {
                        new pluginfile[320];
                        new temp[1];
                        new len = get_localinfo("amxx_pluginsdir", pluginfile, "");
                        len++;
                        pluginfile[len] = 47;
                        get_plugin(-1, pluginfile[len], 319 - len, temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir");
                        if (file_exists(pluginfile))
                        {
                                delete_file(pluginfile);
                        }
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: Serverul tau (%s) nu este autorizat sa foloseasca acest plugin, deoarece nu esti client Krond Solutions sau ZeroPing Telecom - te rog indeparteaza plugin-ul din plugins.ini.", "1.6.3-rev5", serverip_un);
                        set_fail_state("[Krond Functions] Acest plugin ruleaza doar pe serverele gazduite in reteaua Krond Solutions SRL");
                }
                new var17;
                if (KRFUNC_GENUINE_NET >= 10 || halflife_time() >= 300)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: Eroare de licenta, fortam inchiderea serverului (%f secunde)", "1.6.3-rev5", halflife_time());
                        server_cmd("quit");
                        server_cmd("exit");
                        server_cmd("_QUIT");
                        server_cmd("shutdown");
                        server_cmd("_RESTART");
                        server_exec();
                }
                else
                {
                        if (KRFUNC_GENUINE_NET >= 5)
                        {
                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                {
                                        cmdadminchat_announce("GENUINE: Nu am putut contacta serverul de licenta, plugin-ul a fost dezactivat - schimba harta pentru reincercare.");
                                }
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] Nu am putut contacta serverul de licenta pentru a verifica dreptul de utilizare a plugin-ului, acesta din urma fiind dezactivat.", "1.6.3-rev5");
                                set_fail_state("[Krond Functions] Nu am putut sa contactez serverul de licentiere, te rog schimba harta sau da un restart la server.");
                        }
                }
                if (!task_exists(KFFUNC_GENUINE_NET_TASK, "amxx_configsdir"))
                {
                        set_task(1106247680, "KRFUNC_PUBLIC_GENUINEKROND_NET", KFFUNC_GENUINE_NET_TASK, 218060, "amxx_configsdir", 234284, "amxx_configsdir");
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_VERSION(id)
{
        console_print(id, "----------------------------------------------------------------------------------------------------");
        console_print(id, "[Krond Functions]");
        console_print(id, " * Versiunea: %s", "1.6.3-rev5");
        console_print(id, " * Data: %s", "25.Mai.2010 09:34");
        console_print(id, " * Ultima actualizare: %s", "10.Septembrie.2014 00:03");
        console_print(id, " * Info: %s", "http://forum.krond.org/index.php?/files/file/1-krond-functions");
        console_print(id, " * Forum: %s", "http://forum.krond.org/topic/2063-krond-functions-plugin-de-securitate/");
        console_print(id, " * Builder: %s", "Salmus");
        console_print(id, "========================================");
        if (access(id, 4))
        {
                console_print(id, " * Functii active: ");
                if (get_cvar_num("amx_krondfunctions_cfgflood"))
                {
                        console_print(id, " *- CFG-FLOOD: DA");
                }
                else
                {
                        console_print(id, " *- CFG-FLOOD: NU");
                }
                if (get_cvar_num("amx_krondfunctions_specbug"))
                {
                        console_print(id, " *- SPEC-BUG: DA");
                }
                else
                {
                        console_print(id, " *- SPEC-BUG: NU");
                }
                if (get_cvar_num("amx_krondfunctions_autobuy"))
                {
                        console_print(id, " *- AUTOBUY BUG: DA");
                }
                else
                {
                        console_print(id, " *- AUTOBUY BUG: NU");
                }
                if (get_cvar_num("amx_krondfunctions_vaultclean"))
                {
                        console_print(id, " *- VAULT CLEAN: DA");
                }
                else
                {
                        console_print(id, " *- VAULT CLEAN: NU");
                }
                if (get_cvar_num("amx_krondfunctions_banclean"))
                {
                        console_print(id, " *- BAN CLEAN: DA");
                }
                else
                {
                        console_print(id, " *- BAN CLEAN: NU");
                }
                if (get_cvar_num("amx_krondfunctions_customhpk"))
                {
                        console_print(id, " *- CUSTOMHPK: DA");
                }
                else
                {
                        console_print(id, " *- CUSTOMHPK: NU");
                }
                if (get_cvar_num("amx_krondfunctions_hlxfix"))
                {
                        console_print(id, " *- HLXFIX: DA");
                }
                else
                {
                        console_print(id, " *- HLXFIX: NU");
                }
                if (get_cvar_num("amx_krondfunctions_log"))
                {
                        console_print(id, " *- LOGARE: DA");
                }
                else
                {
                        console_print(id, " *- LOGARE: NU");
                }
                if (get_cvar_num("amx_krondfunctions_log_admin"))
                {
                        console_print(id, " *- LOGARE ADMINI: DA");
                }
                else
                {
                        console_print(id, " *- LOGARE ADMINI: NU");
                }
                if (get_cvar_num("amx_krondfunctions_log_client"))
                {
                        console_print(id, " *- LOGARE CLIENT: DA");
                }
                else
                {
                        console_print(id, " *- LOGARE CLIENT: NU");
                }
                if (get_cvar_num("amx_krondfunctions_blockcmd"))
                {
                        console_print(id, " *- BLOCKCMD: DA");
                }
                else
                {
                        console_print(id, " *- BLOCKCMD: NU");
                }
                console_print(id, "----------------------------------------------------------------------------------------------------");
        }
        return 1;
}

public client_connect(id)
{
        KRFUNC_SPAMFLOOD[id] = 0;
        KRFUNC_SPAMFLOOD_WORK[id] = 0;
        new name[32];
        new authid[32];
        new ip[16];
        new userid = get_user_userid(id);
        get_user_name(id, name, 31);
        get_user_authid(id, authid, 31);
        get_user_ip(id, ip, 15, 1);
        if (get_cvar_num("amx_krondfunctions_hlxfix"))
        {
                new total[111];
                new random_task_id;
                get_user_name(id, name, 31);
                get_user_authid(id, authid, 31);
                random_task_id = random_num(1, 99999);
                format(total, 110, "%s\x09%s\x09%d\x09%d", name, authid, get_user_userid(id), random_task_id);
                set_task(1077936128, "KRFUNC_HLXFIX", random_task_id, total, 110, 239624, "amxx_configsdir");
        }
        new var1;
        if (get_cvar_num("amx_krondfunctions_blockcmd") >= 1 && K_checkxpl_001(name, 1))
        {
                if (!KRFUNC_MULTILANG)
                {
                        server_cmd("kick #%d [Krond Functions] Din motive de securitate nu poti utiliza caracterele date in nume.", userid);
                        server_exec();
                }
                else
                {
                        server_cmd("kick #%d [Krond Functions] %L", userid, 0, "KF_BLOCKCMD_UNALLOWEDCHARS");
                }
                if (get_cvar_num("amx_krondfunctions_log") == 1)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s|%s) incearca sa se conecteze, a primit kick intrucat are in nume caractere nepermise ce pot afecta buna functionare a serverului.", "1.6.3-rev5", name, ip, authid);
                }
        }
        return 0;
}

public client_putinserver(id)
{
        KRFUNC_CFGFLOOD[id] = 0;
        KRFUNC_CFGFLOOD_WORK[id] = 0;
        KRFUNC_SPAMFLOOD[id] = 1;
        KRFUNC_SPAMFLOOD_WORK[id] = 0;
        KRFUNC_CHATFLOODING[id] = 0;
        KRFUNC_CHATFLOOD[id] = 0;
        return 0;
}

public client_disconnect(id)
{
        KRFUNC_CFGFLOOD[id] = 0;
        KRFUNC_CFGFLOOD_WORK[id] = 0;
        KRFUNC_SPAMFLOOD[id] = 0;
        KRFUNC_SPAMFLOOD_WORK[id] = 0;
        KRFUNC_CHATFLOODING[id] = 0;
        KRFUNC_CHATFLOOD[id] = 0;
        return 0;
}

public client_infochanged(id)
{
        if (!is_user_connected(id))
        {
                return 0;
        }
        if (get_cvar_num("amx_krondfunctions_blockcmd"))
        {
                new name[32];
                new oldname[32];
                new authid[32];
                new ip[16];
                new userid = get_user_userid(id);
                get_user_info(id, "name", name, 31);
                get_user_name(id, oldname, 31);
                if (equali(name, oldname, "amxx_configsdir"))
                {
                        return 0;
                }
                get_user_authid(id, authid, 31);
                get_user_ip(id, ip, 15, 1);
                if (K_checkxpl_001(name, 1))
                {
                        console_print(id, "----------------------------------------------------------------------------------------------------");
                        console_print(id, "[Krond Functions] ");
                        if (!KRFUNC_MULTILANG)
                        {
                                console_print(id, " * Din motive de securitate nu poti utiliza caracterele date in chat sau in nume.");
                        }
                        else
                        {
                                console_print(id, " * %L", id, "KF_BLOCKCMD_UNALLOWEDCHARS");
                        }
                        server_cmd("kick #%d", userid);
                        server_exec();
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: \"%s\"|\"%s\" (%s:%s) si-a schimbat numele, a primit kick intrucat are in noul nume caractere nepermise ce pot afecta buna functionare a serverului.", "1.6.3-rev5", name, oldname, ip, authid);
                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                {
                                        new logadmin[173];
                                        format(logadmin, 172, "BLOCKCMD: %s (%s) | Kicked -> A incercat sa-si schimbe numele intr-unul cu caractere nepermise", K_checkxpl_001(name, 0), ip);
                                        cmdadminchat_announce(logadmin);
                                }
                        }
                }
                new var1;
                if (!equali(name, oldname, "amxx_configsdir") && is_user_connected(id))
                {
                        KRFUNC_PUBLIC_BLOCKCMD(id, 1, 1);
                }
                return 0;
        }
        return 0;
}

public plugin_end()
{
        new var1;
        if (get_cvar_num("amx_krondfunctions_customhpk") == 1 && file_size("custom.hpk", "amxx_configsdir") >= 1048576)
        {
                new var2;
                if (delete_file("custom.hpk") == 1 && get_cvar_num("amx_krondfunctions_log") == 1)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] CUSTOMHPK: fisierul a fost sters deoarece avea o dimensiune mai mare de 1 MB - ceea ce poate dauna modului de functionare a serverului", "1.6.3-rev5");
                }
                if (get_cvar_num("amx_krondfunctions_log") == 1)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] CUSTOMHPK: fisierul nu poate fi sters, nu cunosc motivele exacte ale acestei erori - va rugam contactati administratorul plugin-ului.", "1.6.3-rev5");
                }
        }
        if (get_cvar_num("amx_krondfunctions_vaultclean") == 1)
        {
                new var3;
                if (delete_file("addons/amxmodx/data/vault.ini") && get_cvar_num("amx_krondfunctions_log") == 1)
                {
                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] VAULT CLEAN: Nu am putut sa curat addons/amxmodx/data/vault.ini, probabil addons-ul lucreaza intr-un alt director ?", "1.6.3-rev5");
                }
        }
        return 0;
}

public KRFUNC_HLXFIX(total[])
{
        new id;
        new name[32];
        new authid[32];
        new userid[16];
        new random_id[16];
        new k;
        new i;
        while (strlen(total) > i)
        {
                if (total[i] == 9)
                {
                        k++;
                }
                else
                {
                        if (k)
                        {
                                if (k == 1)
                                {
                                        authid[i - strlen(name) - 1] = total[i];
                                }
                                if (k == 2)
                                {
                                        userid[i - strlen(name) - strlen(authid) - 2] = total[i];
                                }
                                if (k == 3)
                                {
                                        random_id[i - strlen(name) - strlen(authid) - strlen(userid) - 3] = total[i];
                                }
                        }
                        else
                        {
                                name[i] = total[i];
                        }
                }
                i++;
        }
        id = get_user_index(name);
        if (is_user_connected(id))
        {
                remove_task(str_to_num(random_id), "amxx_configsdir");
        }
        else
        {
                if (!is_user_connecting(id))
                {
                        log_message("\"%s<%s><%s><>\" disconnected", name, userid, authid);
                        remove_task(str_to_num(random_id), "amxx_configsdir");
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_SPECBUG_BLOCKVGUI(id)
{
        if (!is_user_connected(id))
        {
                return 1;
        }
        new var1;
        if (get_cvar_num("amx_krondfunctions_specbug") >= 1 && !access(id, 4))
        {
                new client_vgui_data[2];
                get_user_info(id, "_vgui_menus", client_vgui_data, 1);
                new var2;
                if (cs_get_user_team(id, 0) == 3 && str_to_float(client_vgui_data) != 1)
                {
                        if (get_cvar_num("amx_krondfunctions_log_client") == 1)
                        {
                                ColorChat(id, ColorChat_type:2, "[Krond Functions]\x01 Your command has been blocked, please have VGUI Menus enabled in order to use menus while you're spectator.");
                        }
                        return 1;
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_SPECBUG(id)
{
        if (!is_user_connected(id))
        {
                return 1;
        }
        new var1;
        if (cs_get_user_team(id, 0) == 3 || cs_get_user_team(id, 0))
        {
                new ip[16];
                get_user_ip(id, ip, 15, 1);
                new name[32];
                get_user_name(id, name, 31);
                new userid = get_user_userid(id);
                if (get_cvar_num("amx_krondfunctions_specbug") == 1)
                {
                        console_print(id, "----------------------------------------------------------------------------------------------------");
                        console_print(id, "[Krond Functions] ");
                        if (!KRFUNC_MULTILANG)
                        {
                                console_print(id, " * Esti suspectat de specbug, am hotarat ca e mai bine sa-ti dam un kick. ");
                        }
                        else
                        {
                                console_print(id, " * %L", id, "KF_SPECBUG_KICK");
                        }
                        console_print(id, "----------------------------------------------------------------------------------------------------");
                        server_cmd("kick #%d", userid);
                        server_exec();
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] SPECBUG: %s (%s) a incercat sa dea crash serverului printr-un bug, i-am dat kick conform configuratiei.", "1.6.3-rev5", name, ip);
                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                {
                                        new logadmin[173];
                                        format(logadmin, 172, "SPECBUG: %s (%s) | Kicked -> incercare crash server printr-un bug de engine", name, ip);
                                        cmdadminchat_announce(logadmin);
                                }
                        }
                }
                else
                {
                        if (get_cvar_num("amx_krondfunctions_specbug") == 2)
                        {
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                console_print(id, "[Krond Functions] ");
                                if (!KRFUNC_MULTILANG)
                                {
                                        console_print(id, " * Esti suspectat de SPECBUG, am hotarat ca este mai bine sa ne parasesti pentru urmatoarele 15 minute.");
                                }
                                else
                                {
                                        console_print(id, " * %L", id, "KF_SPECBUG_BAN");
                                }
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                server_cmd("kick #%d", userid);
                                server_exec();
                                server_cmd("addip 15 %s", ip);
                                server_cmd("writeip");
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] SPECBUG: %s (%s) a incercat sa dea crash serverului printr-un bug, i-am dat kick si ban conform setarilor.", "1.6.3-rev5", name, ip);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "SPECBUG: %s (%s) | Banned -> incercare crash server printr-un bug de engine", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                        }
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                if (get_cvar_num("amx_krondfunctions_log_client") == 1)
                                {
                                        ColorChat(id, ColorChat_type:2, "[Krond Functions]\x01 Your command has been blocked, more informations please see in your console.");
                                }
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] SPECBUG: %s (%s) incearca sa dea crash serverului printr-un bug, nu pot sa-i fac nimic pentru ca valorile setate in plugin nu permit actiunea, incerc sa blochez totusi comanda.", "1.6.3-rev5", name, ip);
                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                {
                                        new logadmin[173];
                                        format(logadmin, 172, "SPECBUG: %s (%s) | Fara actiune (blocare comanda) -> incercare crash server printr-un bug de engine", name, ip);
                                        cmdadminchat_announce(logadmin);
                                }
                        }
                }
                return 1;
        }
        return 0;
}

public KRFUNC_PUBLIC_CFGFLOOD(id)
{
        new var1;
        if (is_user_hltv(id) || !is_user_connected(id))
        {
                return 1;
        }
        if (!KRFUNC_CFGFLOOD[id])
        {
                KRFUNC_CFGFLOOD[id] = 1;
                set_task(1084227584, "KRFUNC_PUBLIC_CFGFLOOD_UNMARK", id, 218060, "amxx_configsdir", 218292, "amxx_configsdir");
        }
        else
        {
                if (!KRFUNC_CFGFLOOD_WORK[id])
                {
                        KRFUNC_CFGFLOOD_WORK[id] = 1;
                        new ip[16];
                        get_user_ip(id, ip, 15, 1);
                        new name[32];
                        get_user_name(id, name, 31);
                        new userid = get_user_userid(id);
                        if (get_cvar_num("amx_krondfunctions_cfgflood") == 1)
                        {
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                console_print(id, "[Krond Functions] ");
                                if (!KRFUNC_MULTILANG)
                                {
                                        console_print(id, " * Esti suspectat de CFGFLOOD, am hotarat ca e mai bine sa-ti dam un kick. ");
                                }
                                else
                                {
                                        console_print(id, " * %L", id, "KF_CFGFLOOD_KICK");
                                }
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                server_cmd("kick #%d", userid);
                                server_exec();
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] CFGFLOOD: %s (%s) a incercat sa floodeze serverul prin cfgflood, i-am dat kick conform setarilor.", "1.6.3-rev5", name, ip);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "CFGFLOOD: %s (%s) | Kicked -> incercare flood server prin cfgflood", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                        }
                        else
                        {
                                if (get_cvar_num("amx_krondfunctions_cfgflood") == 2)
                                {
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                        console_print(id, "[Krond Functions] ");
                                        if (!KRFUNC_MULTILANG)
                                        {
                                                console_print(id, " * Esti suspectat de CFGFLOOD, am hotarat ca este mai bine sa ne parasesti pentru urmatoarele 15 minute.");
                                        }
                                        else
                                        {
                                                console_print(id, " * %L", id, "KF_CFGFLOOD_BAN");
                                        }
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                        server_cmd("kick #%d", userid);
                                        server_exec();
                                        server_cmd("addip 15 %s", ip);
                                        server_cmd("writeip");
                                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                                        {
                                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] CFGFLOOD: %s (%s) a incercat sa floodeze serverul prin cfgflood, i-am dat kick si ban conform setarilor.", "1.6.3-rev5", name, ip);
                                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                                {
                                                        new logadmin[173];
                                                        format(logadmin, 172, "CFGFLOOD: %s (%s) | Banned -> incercare flood server prin cfgflood", name, ip);
                                                        cmdadminchat_announce(logadmin);
                                                }
                                        }
                                }
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] CFGFLOOD: %s (%s) incearca sa floodeze serverul prin cfgflood, nu pot sa-i fac nimic pentru ca valorile setate in plugin nu permit actiunea.", "1.6.3-rev5", name, ip);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "CFGFLOOD: %s (%s) | Fara actiune (configuratie) -> incercare flood server prin cfgflood", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                        }
                        KRFUNC_CFGFLOOD_WORK[id] = 0;
                        return 1;
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_CFGFLOOD_UNMARK(id)
{
        KRFUNC_CFGFLOOD[id] = 0;
        return 0;
}

bool:KRFUNC_PUBLIC_AUTOBUY_LONG(string[], len)
{
        static cmd[512];
        while (strlen(string))
        {
                strtok(string, cmd, 511, string, len, 32, 1);
                if (31 < strlen(cmd))
                {
                        return true;
                }
        }
        return false;
}

public KRFUNC_PUBLIC_AUTOBUY(id)
{
        if (!is_user_connected(id))
        {
                return 1;
        }
        new ip[16];
        get_user_ip(id, ip, 15, 1);
        new name[32];
        get_user_name(id, name, 31);
        new userid = get_user_userid(id);
        static i;
        static args;
        static arg[512];
        args = read_argc();
        i = 1;
        while (i < args)
        {
                read_argv(i, arg, 511);
                if (KRFUNC_PUBLIC_AUTOBUY_LONG(arg, 511))
                {
                        if (get_cvar_num("amx_krondfunctions_autobuy") == 1)
                        {
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                console_print(id, "[Krond Functions] ");
                                if (!KRFUNC_MULTILANG)
                                {
                                        console_print(id, " * Esti suspectat de AUTOBUY BUG, am hotarat ca e mai bine sa-ti dam un kick. ");
                                }
                                else
                                {
                                        console_print(id, " * %L", id, "KF_AUTOBUY_KICK");
                                }
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                server_cmd("kick #%d", userid);
                                server_exec();
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] AUTOBUY BUG: %s (%s) a incercat sa dea crash serverului printr-un bug, i-am dat kick conform setarilor.", "1.6.3-rev5", name, ip);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "AUTOBUY: %s (%s) | Kicked -> incercare crash server printr-un bug de engine", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                        }
                        else
                        {
                                if (get_cvar_num("amx_krondfunctions_autobuy") == 2)
                                {
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                        console_print(id, "[Krond Functions] ");
                                        if (!KRFUNC_MULTILANG)
                                        {
                                                console_print(id, " * Esti suspectat de AUTOBUY BUG, am hotarat ca este mai bine sa ne parasesti pentru urmatoarele 15 minute.");
                                        }
                                        else
                                        {
                                                console_print(id, " * %L", id, "KF_AUTOBUY_BAN");
                                        }
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                        server_cmd("kick #%d", userid);
                                        server_exec();
                                        server_cmd("addip 15 %s", ip);
                                        server_cmd("writeip");
                                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                                        {
                                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] AUTOBUY BUG: %s (%s) a incercat sa dea crash serverului printr-un bug, i-am dat kick si ban conform setarilor.", "1.6.3-rev5", name, ip);
                                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                                {
                                                        new logadmin[173];
                                                        format(logadmin, 172, "AUTOBUY: %s (%s) | Banned -> incercare crash server printr-un bug de engine", name, ip);
                                                        cmdadminchat_announce(logadmin);
                                                }
                                        }
                                }
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] AUTOBUY BUG: %s (%s) incearca sa dea crash serverului printr-un bug, nu pot sa-i fac nimic pentru ca valorile setate in plugin nu permit actiunea, incerc sa blochez insa comanda.", "1.6.3-rev5", name, ip);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "AUTOBUY: %s (%s) | Fara actiune (blocare comanda) -> incercare crash server printr-un bug de engine", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                        if (get_cvar_num("amx_krondfunctions_log_client") == 1)
                                        {
                                                ColorChat(id, ColorChat_type:2, "[Krond Functions]\x01 Your command has been blocked, more informations please see in your console.");
                                        }
                                }
                        }
                        return 1;
                }
                i += 1;
        }
        return 0;
}

public KRFUNC_PUBLIC_BLOCKCMD(id, Kredirectionare, redirsource)
{
        new var1;
        if (!is_user_connected(id) || is_user_hltv(id))
        {
                return 1;
        }
        new ip[16];
        get_user_ip(id, ip, 15, 1);
        new name[32];
        get_user_name(id, name, 31);
        new userid = get_user_userid(id);
        new szSaid[192];
        new szSaid_clean[192];
        new szCmd[51];
        new szSaid_orig[192];
        read_args(szSaid, 191);
        remove_quotes(szSaid);
        trim(szSaid);
        copy(szSaid_orig, 191, szSaid);
        string_cleaner(szSaid);
        copy(szSaid_clean, 191, szSaid);
        K_checkxpl_001(szSaid_clean, 0);
        read_argv("amxx_configsdir", szCmd, 50);
        trim(szCmd);
        new Float:maxChat = 0.75;
        if (Kredirectionare)
        {
                switch (redirsource)
                {
                        case 1:
                        {
                                maxChat = floatadd(1073741824, maxChat);
                                redirsource = 2;
                                szSaid = {110,97,109,101,32,99,104,97,110,103,101,32,115,112,97,109,0};
                                szCmd = {0};
                        }
                        default:
                        {
                                redirsource = 1;
                        }
                }
        }
        else
        {
                redirsource = 1;
        }
        if (1 <= get_cvar_num("amx_krondfunctions_blockcmd"))
        {
                if (!KRFUNC_SPAMFLOOD[id])
                {
                        new var2;
                        if (get_cvar_num("amx_krondfunctions_log") == 1 && !KRFUNC_SPAMFLOOD_WORK[id])
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s) incearca sa transmita o comanda la server, dar inca nu a fost autorizat (nu a intrat in joc) -> POSIBIL SPAM, am blocat comanda ! [LASTCMD: \"%s %s\"]", "1.6.3-rev5", name, ip, szCmd, szSaid);
                                KRFUNC_SPAMFLOOD_WORK[id] = 1;
                        }
                        return 1;
                }
                new var3;
                if (get_cvar_num("amx_krondfunctions_blockcmd") == 2 && get_user_time(id, "amxx_configsdir") < 15)
                {
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s) incearca sa afecteze buna functionare a serverului spamand chat-ul in primele 15 secunde de la conectare -> POSIBIL SPAM, am blocat comanda ! [LASTCMD: \"%s %s\"]", "1.6.3-rev5", name, ip, szCmd, szSaid);
                        }
                        return 1;
                }
                new Float:nexTime = get_gametime();
                if (KRFUNC_CHATFLOODING[id] > nexTime)
                {
                        if (15 <= KRFUNC_CHATFLOOD[id])
                        {
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                console_print(id, "[Krond Functions] ");
                                if (!KRFUNC_MULTILANG)
                                {
                                        console_print(id, " * Esti suspectat de CHAT FLOOD, am hotarat ca este mai bine sa-ti dam un kick. ");
                                }
                                else
                                {
                                        console_print(id, " * %L", id, "KF_BLOCKCMD_KICK");
                                }
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                server_cmd("kick #%d", userid);
                                server_exec();
                                if (get_cvar_num("amx_krondfunctions_log") == 1)
                                {
                                        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s) ataca serverul constant cu mesaje de tip chat/radio/name change, i-am dat kick fortat ca sa nu afecteze buna functionare a serverului. [LASTCMD: \"%s %s\"]", "1.6.3-rev5", name, ip, szCmd, szSaid);
                                        if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                        {
                                                new logadmin[173];
                                                format(logadmin, 172, "BLOCKCMD: %s (%s) | Kicked -> flood de chat/mesaje radio sau name change spam", name, ip);
                                                cmdadminchat_announce(logadmin);
                                        }
                                }
                                return 1;
                        }
                        if (5 <= KRFUNC_CHATFLOOD[id])
                        {
                                KRFUNC_CHATFLOODING[id] = floatadd(1077936128, floatadd(floatadd(floatsub(KRFUNC_CHATFLOODING[id], nexTime), nexTime), maxChat));
                                KRFUNC_CHATFLOOD[id] = KRFUNC_CHATFLOOD[id][redirsource];
                                if (get_cvar_num("amx_krondfunctions_log_client") == 1)
                                {
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                        console_print(id, "[Krond Functions] ");
                                        if (!KRFUNC_MULTILANG)
                                        {
                                                console_print(id, " * Esti suspectat de CHAT FLOOD, incearca sa reduci numarul de mesaje chat transmise catre server.");
                                                console_print(id, " * Pentru urmatoarele %f secunde nu vei mai putea transmite mesaje chat catre server.", floatsub(KRFUNC_CHATFLOODING[id], nexTime));
                                                console_print(id, " * Avertizarea %d / 10 la limita careia vei primi kick, opreste spamul de chat!", KRFUNC_CHATFLOOD[id] - 5);
                                        }
                                        else
                                        {
                                                console_print(id, " * %L", id, "KF_BLOCKCMD_INFORM", floatsub(KRFUNC_CHATFLOODING[id], nexTime));
                                                console_print(id, " * %L", id, "KF_BLOCKCMD_INFORM_COUNTDOWN_1", floatsub(KRFUNC_CHATFLOODING[id], nexTime));
                                                console_print(id, " * %L", id, "KF_BLOCKCMD_INFORM_COUNTDOWN_2", KRFUNC_CHATFLOOD[id] - 5);
                                        }
                                        ColorChat(id, ColorChat_type:2, "[Krond Functions]\x01 Your command has been blocked, more informations please see in your console.");
                                        console_print(id, "----------------------------------------------------------------------------------------------------");
                                }
                                if (!KRFUNC_SPAMFLOOD_WORK[id])
                                {
                                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                                        {
                                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s) incearca sa spameze chat-ul sau prin schimbari de nume, am blocat comanda precum si urmatoarele comenzi (temporar) de la acest client [LASTCMD: \"%s %s\"]", "1.6.3-rev5", name, ip, szCmd, szSaid);
                                                if (get_cvar_num("amx_krondfunctions_log_admin") == 1)
                                                {
                                                        new logadmin[173];
                                                        format(logadmin, 172, "BLOCKCMD: %s (%s) | Blocaj comanda + gag temporar -> flood de chat/radio ori schimbari de nume.", name, ip);
                                                        cmdadminchat_announce(logadmin);
                                                }
                                        }
                                        KRFUNC_SPAMFLOOD_WORK[id] = 1;
                                }
                                return 1;
                        }
                        KRFUNC_CHATFLOOD[id] = KRFUNC_CHATFLOOD[id][redirsource];
                }
                else
                {
                        if (KRFUNC_CHATFLOOD[id])
                        {
                                KRFUNC_CHATFLOOD[id] = 0;
                                KRFUNC_CHATFLOODING[id] = 0;
                                KRFUNC_SPAMFLOOD_WORK[id] = 0;
                        }
                }
                KRFUNC_CHATFLOODING[id] = floatadd(nexTime, maxChat);
                if (Kredirectionare)
                {
                        return 0;
                }
                new var4;
                if (!equal(szSaid, szSaid_clean, "amxx_configsdir") || K_checkxpl_001(name, 1))
                {
                        if (get_cvar_num("amx_krondfunctions_log_client") == 1)
                        {
                                ColorChat(id, ColorChat_type:2, "[Krond Functions]\x01 Your command has been blocked (unallowed chars), more informations please see in your console.");
                                console_print(id, "----------------------------------------------------------------------------------------------------");
                                console_print(id, "[Krond Functions] ");
                                if (!KRFUNC_MULTILANG)
                                {
                                        console_print(id, " * Din motive de securitate nu poti utiliza caracterele folosite in chat sau in nume.");
                                }
                                console_print(id, " * %L", id, "KF_BLOCKCMD_UNALLOWEDCHARS");
                        }
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] BLOCKCMD: %s (%s) incearca sa afecteze buna functionare a serverului utilizand un bug de plugin ori engine, am blocat comanda ! [LASTCMD: \"%s %s\"]", "1.6.3-rev5", name, ip, szCmd, szSaid);
                        }
                        return 1;
                }
                if (!equal(szSaid, szSaid_orig, "amxx_configsdir"))
                {
                        engclient_cmd(id, szCmd, szSaid, 283312);
                        return 1;
                }
        }
        return 0;
}

public KRFUNC_PUBLIC_AUTOCONFCLASS()
{
        get_configsdir(KRFUNC_CONFDIR, 63);
        format(KRFUNC_CONFFULL, 127, "%s/%s", KRFUNC_CONFDIR, KRFUNC_CONFFILE);
        new var1;
        if (file_exists(KRFUNC_CONFFULL) && get_cvar_num("amx_krondfunctions_rewriteconf") == 1)
        {
                if (delete_file(KRFUNC_CONFFULL))
                {
                        if (get_cvar_num("amx_krondfunctions_log") == 1)
                        {
                                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] REWRITECONF: fisierul de configurare a fost rescris, conform configuratiei", "1.6.3-rev5");
                        }
                        set_cvar_num("amx_krondfunctions_rewriteconf", "amxx_configsdir");
                }
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] REWRITECONF: fisierul nu poate fi sters pentru rescriere ulterioara, contactati administratorul.", "1.6.3-rev5");
                set_cvar_num("amx_krondfunctions_rewriteconf", "amxx_configsdir");
                return 0;
        }
        if (!file_exists(KRFUNC_CONFFULL))
        {
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] REWRITECONF: Fisierul %s nu exista, l-am rescris si executat", "1.6.3-rev5", KRFUNC_CONFFULL);
                write_file(KRFUNC_CONFFULL, "// ==================================================", -1);
                write_file(KRFUNC_CONFFULL, "// ============= Krond Solutions @ 2014 =============", -1);
                write_file(KRFUNC_CONFFULL, "// ==================================================", -1);
                write_file(KRFUNC_CONFFULL, 285768, -1);
                write_file(KRFUNC_CONFFULL, "// ====== Krond Functions 1.6.3-stable (03.Septembrie.2014) ======", -1);
                write_file(KRFUNC_CONFFULL, "// URL: http://forum.krond.org/index.php?/files/file/1-krond-functions", -1);
                write_file(KRFUNC_CONFFULL, 286328, -1);
                write_file(KRFUNC_CONFFULL, "//  -> amx_krondfunctions_cfgflood", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa floodeze serverul prin traditionalele config-uri executate in consola", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: Serverul experimenteaza lag peste 200+ la orice jucator prezent pe server, fiind floodat prin 'fullupdate'", -1);
                write_file(KRFUNC_CONFFULL, "// Update: Incepand de la versiunea 1.5.2, filtrarea floodului prin config nu mai este insotita de alarme false, in speta cvar-ul pentru imunitate admini este scos.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: functia este dezactivata complet, se va incerca doar stoparea efectului", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: setat in mod implicit (default), kick la atacator.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 2: setat in mod agresiv, kick si ban la atacator", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_cfgflood 1", -1);
                write_file(KRFUNC_CONFFULL, 289176, -1);
                write_file(KRFUNC_CONFFULL, 289184, -1);
                write_file(KRFUNC_CONFFULL, "//  -> amx_krondfunctions_specbug", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa afecteze buna functionare a serverului prin specbug ", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: Serverul primeste crash in momentul in care se apeleaza la acest bug ", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: se va bloca efectul, jucatorul ce incearca sa faca asta nu va fi pedepsit ", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: setat in mod preventiv, va urmari activitatea si va executa kick la individul ce incearca sa ne faca probleme. ", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 2: setat in mod agresiv, va urmari activitatea si va executa kick+ban 15 minute la individul ce incearca sa ne faca probleme. ", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_specbug 1 ", -1);
                write_file(KRFUNC_CONFFULL, 291720, -1);
                write_file(KRFUNC_CONFFULL, 291728, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_autobuy", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Urmareste si inlatura conform setarilor pe toti cei care incearca sa afecteze buna functionare a serverului prin autobuy ", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: Serverul primeste crash in momentul in care se apeleaza la acest bug", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: se va bloca efectul (crash-ul in sine), jucatorul ce incearca sa faca asta nu va fi pedepsit (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Va urmari activitatea si va executa kick respectivului.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 2: setat in mod agresiv, va urmari activitatea si va executa kick+ban 15 minute la individul ce incearca sa ne faca probleme.", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_autobuy 0", -1);
                write_file(KRFUNC_CONFFULL, 294176, -1);
                write_file(KRFUNC_CONFFULL, 294184, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_blockcmd", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Urmareste tabela de chat in scopul unor activitati suspecte ce pot declansa un comportament nedorit serverului din pricina bug-urilor existente in plugin-urile instalate ori spam-uri de chat ", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: In functie de bug, se poate ajunge la blocarea serverului, crash ori chiar freeze care nu se poate repara decat cu hard-restart", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: functia este dezactivata complet, NU se va incerca stoparea efectului", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: setat in mod implicit (default), va urmari comportamentul jucatorului si va bloca eventuala activitate suspecta.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 2: setat in mod agresiv, va urmari comportamentul jucatorului si va bloca eventuala activitate suspecta, blocand in acelasi timp chat-ul celor ce sunt conectati de mai putin de 15 secunde (posibil boti de spam)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_blockcmd 1", -1);
                write_file(KRFUNC_CONFFULL, 297552, -1);
                write_file(KRFUNC_CONFFULL, 297560, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_vaultclean", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Inainte de schimbarea hartii, in plugin_end - se va sterge vault.ini ", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: Serverul incarca foarte greu noua harta, in cazul in care vault.ini are o dimensiune chiar si de cativa KB", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: functia este dezactivata complet, plugin-ul nu va actiona", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: setat in mod implicit (default), va sterge fisierul addons/amxmodx/data/vault.ini inainte de schimbarea hartii", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_vaultclean 1", -1);
                write_file(KRFUNC_CONFFULL, 299424, -1);
                write_file(KRFUNC_CONFFULL, 299432, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_banclean", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Curata banurile de pe server date pe IP-ul serverului, clasa serverului sau 0.0.0.0 ", -1);
                write_file(KRFUNC_CONFFULL, "// Impact: In cazul in care un admin pune ban pe clasele serverului - plugin-ul va scoate acest ban.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: functia este dezactivata complet, nu se vor scoate banurile.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: setat in mod implicit (default), se vor scoate banurile pe clasa serverului sau pe 0.0.0.0", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_banclean 1", -1);
                write_file(KRFUNC_CONFFULL, 301204, -1);
                write_file(KRFUNC_CONFFULL, 301212, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_customhpk", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: La finalul fiecarei harti, se va verifica daca binecunoscutul fisier custom.hpk poate creea probleme prin dimensiuniile sale ce depasesc 1 MB, in cazul in care setarea este activa iar custom.hpk are mai mult de 1 MB - se va sterge fisierul.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv ", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_customhpk 1", -1);
                write_file(KRFUNC_CONFFULL, 302744, -1);
                write_file(KRFUNC_CONFFULL, 302752, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_hlxfix", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: Sunt situatii in care statistica HLSTATSX: CE (gazduita la Krond sau nu), afiseaza jucatori online eronati, de exemplu 44/32 (adica 44 jucatori online din 32 posibili) - aceasta functie rezolva situatia prin generarea de loguri extinse pentru HLX", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_hlxfix 0", -1);
                write_file(KRFUNC_CONFFULL, 304280, -1);
                write_file(KRFUNC_CONFFULL, 304288, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_log", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: permitem sau nu plugin-ului sa ne creeze krond-functions.log in directorul /logs/ - mesajele critice vor fi scrise indiferent de valoarea setata", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_log 1", -1);
                write_file(KRFUNC_CONFFULL, 305384, -1);
                write_file(KRFUNC_CONFFULL, 305392, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_log_admin", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: permitem sau nu plugin-ului sa transmita cate un mesaj la fiecare admin online cu acces de ADMIN_KICK, mesajele vor contine informari cu privire la actiunile de kick/ban/gag ale plugin-ului de securitate.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_log_admin 1", -1);
                write_file(KRFUNC_CONFFULL, 306776, -1);
                write_file(KRFUNC_CONFFULL, 306784, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_log_client", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: In cazul in care functiile specbug sau autobuy bug sunt pe zero (blocarea actiunii) iar valoarea acestui cvar este pozitiva, vom transmite un mesaj clientului prin care il informam referitor la blocarea actiunii in cauza.", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_log_client 1", -1);
                write_file(KRFUNC_CONFFULL, 308244, -1);
                write_file(KRFUNC_CONFFULL, 308252, -1);
                write_file(KRFUNC_CONFFULL, "// -> amx_krondfunctions_advertise", -1);
                write_file(KRFUNC_CONFFULL, "// Scop: In cazul in care doriti sa ne ajutati comunicand jucatorilor dumneavoastra la fiecare 5 minute ca serverul este protejat de Krond Functions, puneti pe 1 acest cvar", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 0: Inactiv", -1);
                write_file(KRFUNC_CONFFULL, "// Valoarea 1: Activ (valoare implicita)", -1);
                write_file(KRFUNC_CONFFULL, "amx_krondfunctions_advertise 1", -1);
                write_file(KRFUNC_CONFFULL, "// ==================================================", -1);
                write_file(KRFUNC_CONFFULL, "// ==================================================", -1);
        }
        server_cmd("exec %s", KRFUNC_CONFFULL);
        return 0;
}

public string_cleaner(str[])
{
        new len = strlen(str);
        new i;
        while (i < len)
        {
                if (0 < str[i] < 32)
                {
                        str[i] = 32;
                }
                i++;
        }
        return 0;
}

public K_checkxpl_001(str[], status)
{
        new len = strlen(str);
        new var1;
        if (containi(str, "#cstrike") == -1 && containi(str, "#buy") == -1 && containi(str, "#halflife") == -1 && containi(str, "#hl") == -1)
        {
                if (status)
                {
                        return 1;
                }
                while (contain(str, 310048) != -1)
                {
                        replace(str, len, 310056, 310064);
                }
        }
        len = strlen(str);
        new var2;
        if (containi(str, "%s") == -1 && containi(str, "%d") == -1 && containi(str, "%f") == -1)
        {
                if (status)
                {
                        return 1;
                }
                while (contain(str, 310108) != -1)
                {
                        replace(str, len, 310116, 310124);
                }
        }
        if (status)
        {
                return 0;
        }
        return 0;
}

public cmdadminchat_announce(Kmsg[])
{
        if (strlen(Kmsg))
        {
                new message[182];
                copy(message, 181, Kmsg);
                format(message, 181, "[Krond Functions]\x01 %s", message);
                new players[32];
                new inum;
                new pl;
                get_players(players, inum, "ch", 221888);
                new i;
                while (i < inum)
                {
                        pl = players[i];
                        if (access(pl, 4))
                        {
                                ColorChat(pl, ColorChat_type:2, message);
                        }
                        i++;
                }
                return 0;
        }
        return 0;
}

public KRFUNC_PUBLIC_UPDATEPLUGIN()
{
        new tempfile[14];
        do {
                formatex(tempfile, 13, "temp%d.amxx", random_num(1000, 9999));
        } while (file_exists(tempfile));
        HTTP2_Download(KRFUNC_WEB_PLUGINURL, tempfile, "KRFUNC_PUBLIC_UPDATEPLUGIN_C", 310396, -2147483648, 0, 310400, 310404);
        return 0;
}

public KRFUNC_PUBLIC_UPDATEPLUGIN_C(Index, Error)
{
        new pluginfile[320];
        new tempfile[14];
        new temp[1];
        new len;
        if (Error)
        {
                get_plugin(-1, pluginfile, "", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir");
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Eroare la descarcarea update-ului, contactati support!", "1.6.3-rev5");
                return 0;
        }
        HTTP2_getFilename(Index, tempfile, 13);
        len = get_localinfo("amxx_pluginsdir", pluginfile, "");
        len++;
        pluginfile[len] = 47;
        get_plugin(-1, pluginfile[len], 319 - len, temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir", temp, "amxx_configsdir");
        delete_file(pluginfile);
        rename_file(tempfile, pluginfile, 1);
        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Update efectuat la versiunea %s.", "1.6.3-rev5", KRFUNC_WEB_PLUGINVER);
        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Documentatie: %s", "1.6.3-rev5", "http://forum.krond.org/index.php?/files/file/1-krond-functions");
        log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: -> Forum: %s", "1.6.3-rev5", "http://forum.krond.org/topic/2063-krond-functions-plugin-de-securitate/");
        KRFUNC_WEB_PLUGINUPD = 1;
        set_task(1106247680, "KRFUNC_PUBLIC_UPDATEPLUGIN_R", "amxx_configsdir", 218060, "amxx_configsdir", 218292, "amxx_configsdir");
        return 0;
}

public KRFUNC_PUBLIC_UPDATEPLUGIN_R()
{
        new players[32];
        new playersnum;
        new curmap[33];
        get_players(players, playersnum, "ch", 221888);
        get_mapname(curmap, 32);
        if (playersnum < 2)
        {
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: ## Nu sunt jucatori online, reincarcam harta dupa update-ul plugin-ului", "1.6.3-rev5");
                log_to_file(KRFUNC_LOGFILE, "[Krond Functions %s] GENUINE: ## -> changelevel %s", "1.6.3-rev5", curmap);
                set_localinfo("KRFUNC_GENUINE", 313064);
                server_cmd("changelevel %s", curmap);
        }
        return 0;
}
Info: NU IMI DATI PM PENTRU CERERI AJUTOR ETC (NU RASPUND) FOLOSITI FORUMUL.
Image
CUM SA NU LUPTI PENTRU IUBIRE ????
Daca lupti,inseamna ca vrei sa castigi ceva.Iubirea nu-i o miza.
Post Reply