Raised This Month: $51 Target: $400
 12% 

Remove the registration system


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-23-2023 , 14:56   Remove the registration system
Reply With Quote #1

Hello
Can someone remove the mandatory registration system for this episode?
Many players do not know how to register or forget their password
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

public mainMenuAccount(id){
    
    if(!
is_user_connected(id)) return;
    
    new 
gText[256];
    
    new 
hidePass[12]; copy(hidePasssizeof(userPassword[])-1userPassword[id]);
    for(new 
0;  strlen(hidePass); ++){
        if (
|| 2hidePass[i] = '*';
    }
    new 
hideIp[32]; copy(hideIpsizeof(userIp[])-1userIp[id]);
    for(new 
0;  strlen(hideIp); ++){
        if (
|| 2hideIp[i] = '*';
    }
    if(!
userLogged[id] && strlen(userPassword[id]) > 1){
        
format(gTextsizeof(gText), "\r[BaseBuilder]\y System Kont:^n\wZaloguj sie aby kozystac z konta^n");
    } else {
        if( 
>= strlen(userPassword[id])){
            
format(gTextsizeof(gText), "\r[BaseBuilder]\y System Kont:^n\wZarejestruj sie aby kozystac z konta^n");
        } else {
            
format(gTextsizeof(gText), "\r[BaseBuilder]\y System Kont:^n^n\
                          \dWitaj\y [\r%s\y]\d Tutaj znajdziesz ustawienia do swojego konta!^n^n\
                          \y%s^t^t\dTwoj Sid:\r %s^n\y%s^t^t\dTwoje ip:\r %s^n\y%s^t^t\dTwoje Haslo:\r %s"
userName[id], symbolsCustom[SYMBOL_DR_ARROW], userSid[id],symbolsCustom[SYMBOL_DR_ARROW], hideIpsymbolsCustom[SYMBOL_DR_ARROW],  hidePass);
        }
    }
    new 
menu menu_create(gText"mainMenuAccount_2");

    if(!
userLogged[id] && strlen(userPassword[id]) > 1){
        
format(gTextsizeof(gText), "Zaloguj");
    } else {
        if( 
>= strlen(userPassword[id])) format(gTextsizeof(gText), "Zarejestruj");
        else 
format(gTextsizeof(gText), "Zmien haslo");
    }
    
menu_additem(menugText);
    
    if(
playerLogged(id)){
        
menu_additem(menu"Wyloguj Sie");
        
menu_additem(menu"Ustawienia^n");
        new 
szSavedIP[MAXBITIP], szSavedSID[MAXBITAUTHID];
        
get_user_ip(idszSavedIPsizeof(szSavedIP)-11);
        
get_user_authid(idszSavedSIDsizeof(szSavedSID)-1);
                    
        if( 
equal(szSavedIPuserIp[id] ) && equal(szSavedSIDuserSid[id] ) )    
            
menu_additem(menu"\rAutomatyczne Logowanie");
        else 
menu_additem(menu"\yAutomatyczne Logowanie\d |\w Wylaczone");
        
    }
    
menu_display(id,menu,0);
}
public 
mainMenuAccount_2(idmenuitem){

    if( 
item == MENU_EXIT ){
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item){
        case 
0cmd_execute(id"messagemode Haslo");
        case 
1:{    
            if( !
playerLogged(id) ){
                
mainMenuAccount(id);
                return 
PLUGIN_HANDLED;
            }
            
userLogged[id] = false;
            
            
logBB(idLOG_ACCOUNT"logout""wylogowal sie !!");
            
            
chatPrint(idPREFIX_NORMAL"Wylogowales sie!" );
        }
        case 
2:{
            
settingAccount(id);    
        }
        case 
3:{
            if(
userLogged[id]){
                new 
szSavedIP[MAXBITIP], szSavedSID[MAXBITAUTHID];
                
get_user_ip(idszSavedIPsizeof(szSavedIP)-11);
                
get_user_authid(idszSavedSIDsizeof(szSavedSID)-1);
                if(
equal(szSavedIPuserIp[id] ) && equal(szSavedSIDuserSid[id] ) ){
                    
chatPrint(idPREFIX_LINE"Masz juz wlaczone^3 Automatyczne^1 Logowanie!");
                    
mainMenuAccount(id);
                    return 
PLUGIN_CONTINUE
                }
                
                
logBB(idLOG_ACCOUNT"update""wlaczyl automatyczne logowanie! (IP: %s | SID: %s)"userIp[id], userSid[id]);
            
                
                
chatPrint(idPREFIX_LINE"Zaktualizowales swoje^3 Automatyczne^1 Logowanie!");
                new 
ip[MAXBITIP], sid[MAXBITAUTHID];
                
get_user_ip(idipsizeof(ip)-11);
                
get_user_authid(idsidsizeof(sid)-1);
                
userIp[id] = ip;
                
userSid[id] = sid;
                
mainMenuAccount(id);
            }
        }
        default:  return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_HANDLED;
}
public 
readPassword(id){        
    
    new 
szArg[12];

    
read_argv(1szArgsizeof(szArg));
    
replace_all(szArgsizeof(szArg), "^"", "");
    replace_all(szArg, sizeof(szArg), " ", "");
    
    if( strlen(szArg) < 3 ){
        chatPrint(id, PREFIX_NORMAL, "
Podane haslo jest za krotkie^Limit 11 symboli )" );
        mainMenuAccount(id);
        return PLUGIN_CONTINUE;
    }
    if( strlen(szArg) > 11 ){
        chatPrint(id, PREFIX_NORMAL, "
Podane haslo jest zadlugie" );
        mainMenuAccount(id);
        return PLUGIN_CONTINUE;
    }
    if (!userLogged[id] && strlen(userPassword[id]) > 1){
        if( equal(szArg, userPassword[id]) ){
            userLogged[id]=true;            
            
            logBB(id, LOG_ACCOUNT, "
succes", "zalogowal sieuzyl - [Aktualne haslo: %s]", szArg);
            
            chatPrint(id, PREFIX_NORMAL, "
Zalogowano pomyslnie" );
            mainMenuAccount(id);
        }else{
            
            logBB(id, LOG_ACCOUNT, "
fail", "bledne haslo !! [Wpisal: %s][Aktualne haslo: %s]",szArg, userPassword[id]);
            
            chatPrint(id, PREFIX_NORMAL, "
Podales zle haslo:^%s", szArg );
        }
    } else {
        userLogged[id]=true;    
        chatPrint(id, PREFIX_NORMAL, "
Ustawiles haslo:^%s", szArg );        

        logBB(id, LOG_ACCOUNT, "
change", "ustawil [Haslo: %s]", szArg);
        
        copy(userPassword[id], sizeof(userPassword[]), szArg);
        mainMenuAccount(id);
    }
    
    return PLUGIN_CONTINUE;
}

public settingAccount(id){
    
    if(!is_user_connected(id)) return;
    
    new gText[64];
    
    format(gText, sizeof(gText), "
\r[BaseBuilder]\y Ustawienia Kont:");
    new menu = menu_create(gText, "
settingAccount_2");    
    
    menu_additem(menu, "
Ustawienia Hudu");
    
    
    format(gText, sizeof(gText), "
JetPack Speed:\%d", userJetpackSpeed[id]);
    menu_additem(menu, gText);
    
    
    format(gText, sizeof(gText), "
Rendering: %s", userMoverBlockColor[id] == BLOCK_COLOR ? "\rKolor" : userMoverBlockColor[id] == BLOCK_RENDER ? "\yRendering" : "\dTekstura");
    menu_additem(menu, gText);
    
    format(gText, sizeof(gText), "
Modele Kosy: %s", hasOption(userSaveOption[id], save_MODELS) ? "\rWlaczone" : "\dWylaczone");
    menu_additem(menu, gText);
    
    if(userFov[id] == 90) format(gText, sizeof(gText), "
Fov Broni:\y Normalny^n");
    else format(gText, sizeof(gText), "
Fov Broni:\%d^n", userFov[id]);
    menu_additem(menu, gText);
    
    //format(gText, sizeof(gText), "
Wiadomosci Kopalni: %s", hasOption(userSaveOption[id], save_CAVE) ? "\rWlaczone" : "\dWylaczone");
    //menu_additem(menu, gText);
    
    format(gText, sizeof(gText), "
Ludzie: %s", hasOption(userSaveOption[id], save_INVIS) ? "\rWlaczone" : "\dWylaczone");
    menu_additem(menu, gText);
    
    
    format(gText, sizeof(gText), "
Widok z trzeciej osoby: %s", userViewCamera[id] ? "\rWlaczone" : "\dWylaczone");
    menu_additem(menu, gText);
    
    menu_display(id, menu, 0);
    return;
}




public settingAccount_2(id, menu, item){
    if( item == MENU_EXIT){
        menu_destroy(menu);
        return PLUGIN_CONTINUE;
    }    
    switch(item){
        case 0: {
            changeHud(id);
        }
        case 1:{
            
            if ((userJetpackSpeed[id] += 100) > 1000) 
                userJetpackSpeed[id] = 100;
            
            settingAccount(id);
        }
        case 2:{
            
            userMoverBlockColor[id]     = (userMoverBlockColor[id]+1)     % 3;
            settingAccount(id);
        }
        case 3:{
            if( hasOption(userSaveOption[id], save_MODELS) ){
                removeOption(userSaveOption[id], save_MODELS);
                chatPrint(id, PREFIX_LINE, "
Modele do kosy^3 wlaczone");
            }else{
                addOption(userSaveOption[id], save_MODELS);
                chatPrint(id, PREFIX_LINE, "
Modele do kosy^3 wylaczone");
            }
            settingAccount(id);
        }
        case 4:{
            if(cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM || cs_get_user_zoom(id) == CS_SET_FIRST_ZOOM || cs_get_user_zoom(id)  == CS_SET_SECOND_ZOOM){
                chatPrint(id, PREFIX_LINE, "
Wylacz^3 ZOOM'a^1 aby zmienic^3 FOV'a");
                settingAccount(id);
                return PLUGIN_CONTINUE;
            }
            
            if ((userFov[id] += 5) > 150 || userFov[id] < 90) 
                userFov[id] = 90;
        
            setFov(id, userFov[id]);
            
            settingAccount(id);
        }
        case 5:{
            if( hasOption(userSaveOption[id], save_INVIS) ){
                removeOption(userSaveOption[id], save_INVIS);
                chatPrint(id, PREFIX_LINE, "
Widzenie osob wlaczone");
            }else{
                addOption(userSaveOption[id], save_INVIS);
                chatPrint(id, PREFIX_LINE, "
Widzenie osob wylaczone");
            }
            settingAccount(id);
            
        }
        case 6:{
            userViewCamera[id] =! userViewCamera[id];
            if(userViewCamera[id])
                set_view(id,CAMERA_3RDPERSON);
            else set_view(id, CAMERA_NONE);
            settingAccount(id);
        }
        
    }
    return PLUGIN_CONTINUE;
}
public startLogin(id){
        
    id -= TASK_LOGIN;
    if( !is_user_connected(id) ) return;
            
    if(!playerLogged(id)){
        if(!is_user_hltv(id)){
            userSpeedAdmin[id] = 1000.0;
            
            if(!userWarningHudStart[id]){
                Display_Fade(id, 4096,4096, 4096,1, 1, 1,255);
                set_dhudmessage(255, 102, 0, -1.0, 0.2, 0, 0.5, 0.9, 0.5, 0.5);
                
                if( strlen(userPassword[id]) < 2 )
                    show_dhudmessage(id, "
Zarejestruj Sie ]^nWpisz /konto | /zarejestruj ]");
                else show_dhudmessage(id, "
Zaloguj Sie ]^nWpisz /konto | /login ]");
            }
        } else {
            
            new szCurrentTime[9];
            new szData[11];
            
            get_time("
%H:%M:%S",szCurrentTime,sizeof(szCurrentTime));
            get_time("
%d.%m.%Y",szData,sizeof(szData));
    
            set_dhudmessage(255, 102, 0, -1.0, 0.0, 0, 0.5, 0.9, 0.5, 0.5);
            show_dhudmessage(id, "
^n[ %- %]^nBaseBuilder ]", szCurrentTime, szData);
        }
        
            
    } else {
        userSpeedAdmin[id] = 0.0;
        remove_task(id + TASK_LOGIN);
        
    }
    set_task(0.85, "
startLogin", id + TASK_LOGIN);
}

new const pointAdd[] = { 1, 3, 5, 10, 15, 25, 255 };
new userHudAdd[33][4];

public changeHud(id){
    if (!is_user_connected(id)) return PLUGIN_HANDLED;

    missionHud(id);
        
    new gText[128];
    new menu     =     menu_create("
\r[BaseBuilder]\y Konfiguracja HUD\w", "changeHud_2");
    new cb     =         menu_makecallback("
changeHud_3");
    
    format(gText, sizeof(gText), "
\wKolor \yCzerwony: \r%d", userHud[id][PLAYER_HUD_RED]);
    menu_additem(menu, gText, .callback=cb);

    format(gText, sizeof(gText), "
\wKolor \yZielony: \r%d", userHud[id][PLAYER_HUD_GREEN]);
    menu_additem(menu, gText, .callback=cb);

    format(gText, sizeof(gText), "
\wKolor \yNiebieski: \r%d^n", userHud[id][PLAYER_HUD_BLUE]);
    menu_additem(menu, gText, .callback=cb);
    
    format(gText, sizeof(gText), "
\wSposob dodawania: \r%s", userHudAdd[id][2] == 1 ? "Klikaj" : "Wpisz");
    menu_additem(menu, gText, .callback=cb);
    
    format(gText, sizeof(gText), "
\%cWartosc dodawania: \%c%d",  userHudAdd[id][2] == 1 ? 'w' : 'd',  userHudAdd[id][2] == 1 ? 'r' : 'd', pointAdd[userHudAdd[id][0]]);
    menu_additem(menu, gText, .callback=cb);
    
    format(gText, sizeof(gText), "
\%cTyp dodawania: \%c%s^n", userHudAdd[id][2] == 1 ? 'w' : 'd', userHudAdd[id][2] == 1 ? 'r' : 'd',  userHudAdd[id][1] == 0 ? "Odejmij" : "Dodaj");
    menu_additem(menu, gText, .callback=cb);
    
    format(gText, sizeof(gText), "
\yDomyslne Ustawienia");
    menu_additem(menu, gText, .callback=cb);


    menu_setprop(menu, MPROP_EXITNAME, "
Wyjscie");

    menu_display(id, menu);

    return PLUGIN_HANDLED;
}
public changeHud_3(id, menu, item) {
    switch(item){
        case 4,5: {
            if(userHudAdd[id][2] == 1)
                return ITEM_ENABLED;
            else return ITEM_DISABLED;    
        }
    }    
    return ITEM_ENABLED;
}
public changeHud_2(id, menu, item){
    if (!is_user_connected(id)) return PLUGIN_HANDLED;

    if (item == MENU_EXIT) {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    new addHud =  pointAdd[userHudAdd[id][0]];
    
    switch (item) {
        case 0: {
            if(userHudAdd[id][2]){
                if(userHudAdd[id][1]){
                    if ((userHud[id][PLAYER_HUD_RED] += addHud) > 255) 
                        userHud[id][PLAYER_HUD_RED] = 0;
                } else {
                    if ((userHud[id][PLAYER_HUD_RED] -= addHud) < 0) 
                        userHud[id][PLAYER_HUD_RED] = 255;
                }
            } else {
                userHudAdd[id][3] =0;
                client_cmd(id, "
messagemode WartoscKoloruHud");
            }
            changeHud(id);
        }
        case 1:{
            if(userHudAdd[id][2]){
                if(userHudAdd[id][1]){
                    if ((userHud[id][PLAYER_HUD_GREEN] += addHud) > 255) 
                        userHud[id][PLAYER_HUD_GREEN] = 0;
                } else {
                    if ((userHud[id][PLAYER_HUD_GREEN] -= addHud) < 0) 
                        userHud[id][PLAYER_HUD_GREEN] = 255;
                } 
            } else {
                userHudAdd[id][3] =1;
                client_cmd(id, "
messagemode WartoscKoloruHud");
            }
            changeHud(id);
        }
        case 2:{
            if(userHudAdd[id][2]){
                if(userHudAdd[id][1]){
                    if ((userHud[id][PLAYER_HUD_BLUE] += addHud) > 255) 
                        userHud[id][PLAYER_HUD_BLUE] = 0;
                } else {
                    if ((userHud[id][PLAYER_HUD_BLUE] -= addHud) < 0) 
                        userHud[id][PLAYER_HUD_BLUE] = 255;
                }
            } else {
                userHudAdd[id][3] =2;
                client_cmd(id, "
messagemode WartoscKoloruHud");
            }
            changeHud(id);
        }
        case 3:{
            if(userHudAdd[id][2] == 0){
                userHudAdd[id][2] ++;
            } else {
                userHudAdd[id][2] --;
            }
            
            changeHud(id);
        }
        case 4:{
            if (++userHudAdd[id][0] >= sizeof(pointAdd)) {
                userHudAdd[id][0] = 0;
            }
            changeHud(id);
        }
        case 5:{
            if(userHudAdd[id][1] == 0){
                userHudAdd[id][1] ++;
            } else {
                userHudAdd[id][1] --;
            }
            
            changeHud(id);
        }
        case 6: {
            userHud[id][PLAYER_HUD_RED] = 255;//120;
            userHud[id][PLAYER_HUD_GREEN] = 0;// 255;
            userHud[id][PLAYER_HUD_BLUE] = 60;//60;
            
            userHudAdd[id][0] = 4;
            userHudAdd[id][1] = 1;
            userHudAdd[id][2] = 1;
            userHudAdd[id][3] = 0;
            
            changeHud(id);
        }
    }
    menu_destroy(menu);
    return PLUGIN_CONTINUE;
}
public readColor(id){

    new szArg[7];
    read_argv(1, szArg, sizeof(szArg)-3);
    
    new color = str_to_num(szArg)%256;
    
    switch(userHudAdd[id][3]){
        case 0: userHud[id][PLAYER_HUD_RED] = color;
        case 1: userHud[id][PLAYER_HUD_GREEN] = color;        
        case 2: userHud[id][PLAYER_HUD_BLUE] = color;        
    }
    changeHud(id);
}
public missionHud(id){
    if(userHud[id][PLAYER_HUD_RED] == 1 && userHud[id][PLAYER_HUD_GREEN] == 1 && userHud[id][PLAYER_HUD_BLUE] == 1 ){
        addSecretMission(id, mission_secret_COLOR, 1);
    }
    
}


public bool:playerLogged(id){
    if(!userLoaded[id] || !userLogged[id] ||  strlen(userPassword[id]) < 2)
        return false;
    return true;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/ 
__________________
amirwolf is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-23-2023 , 16:38   Re: Remove the registration system
Reply With Quote #2

What is an "episode"? Also, attach the whole plugin so that someone trying to help can actually verify their changes.
__________________
fysiks is online now
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-23-2023 , 16:54   Re: Remove the registration system
Reply With Quote #3

Wrong translation :/
The whole plugin is huge and divided into different sections
Sections related to registration
sqlFile
PHP Code:
#include <    amxmodx        >
#include <    amxmisc        >
#include <    cstrike        >
#include <    fun        >
#include <    fakemeta    >
#include <    fakemeta_util    >
#include <    engine        >
#include <    csx        >
#include <    fvault        >
#include <    http2        >
#include <    xs        >
#include <    sockets        >
#include <    sqlx        >

public plugin_init_sql(){
    
    
register_clcmd("clearData""clearDataMenu");
    
    
    new 
host[64], user[64], pass[64], db[64], error[128], errorNum;
    

    
get_cvar_string("bb_sql_host",     hostsizeof(host) - 1);
    
get_cvar_string("bb_sql_user",     usersizeof(user) - 1);
    
get_cvar_string("bb_sql_pass",     passsizeof(pass) - 1);
    
get_cvar_string("bb_sql_db",     dbsizeof(db) - 1);
    
    
sql SQL_MakeDbTuple(hostuserpassdb);
    
connection SQL_Connect(sqlerrorNumerrorsizeof(error));

    if (
errorNum) {
        
log_amx("[SQL-LOG] Blad zapytania.[%d] %s"errorNumerror);
        
sql Empty_Handle;
        
set_task(5.0"plugin_init_sql");
        return;
    }
    
    
log_amx("Polaczono z baza danych");

    new 
queryData[1536];
    new 
Handle:query;
    
    static const 
endLine[] = "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci;";
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `players`( \
        `idplayer` INT NOT NULL AUTO_INCREMENT, \
        `name` varchar(33) NOT NULL, \
        `pass` varchar(12) NOT NULL DEFAULT '_', \
        `kills` INT NOT NULL DEFAULT 0, \
        `deaths` INT NOT NULL DEFAULT 0, \
        `points` INT NOT NULL DEFAULT 0, \
        `timePlay` INT NOT NULL DEFAULT 0, \
        `firstlogin` DATETIME DEFAULT NOW(), \
        `lastlogin` DATETIME DEFAULT NOW(), \
        `maxDamage` INT NOT NULL DEFAULT 0, \
        `clan` INT NOT NULL DEFAULT 0, \
        `flag` INT NOT NULL DEFAULT 0, \
        `clannugget` INT NOT NULL DEFAULT 0, \
        `ipLogin` varchar(32) NOT NULL DEFAULT '_', \
        `sidLogin` varchar(35) NOT NULL DEFAULT '_', \
        `nuggets` INT NOT NULL DEFAULT 45, \
        `bones` INT NOT NULL DEFAULT 10, \
        `level` INT NOT NULL DEFAULT 1, \
        `xp` FLOAT NOT NULL DEFAULT '0.00', \
        `reset` INT NOT NULL DEFAULT 0, \
        PRIMARY KEY (`idplayer`)) %s"
endLine
    
);

    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `clans` ( \
        `idclans` INT NOT NULL AUTO_INCREMENT, \
        `createDate` DATETIME DEFAULT NOW(), \
        `name` varchar(64) NOT NULL, \
        `info` varchar(42) NOT NULL DEFAULT 'Brak Ogloszenia', \
        `members` INT NOT NULL DEFAULT 0, \
        `nugget` INT NOT NULL DEFAULT 0, \
        `kills` INT NOT NULL DEFAULT 0, \
        `level` INT NOT NULL DEFAULT 0, \
        `points` INT NOT NULL DEFAULT 0, \
        `health` INT NOT NULL DEFAULT 0, \
        `expDrop` INT NOT NULL DEFAULT 0, \
        `nuggetDrop` INT NOT NULL DEFAULT 0, \
        `critic` INT NOT NULL DEFAULT 0, \
        `damagePlayer` INT NOT NULL DEFAULT 0, \
        `damageClass` INT NOT NULL DEFAULT 0, \
        `cooldown` INT NOT NULL DEFAULT 0, \
        `idmotd` varchar(20) NOT NULL DEFAULT '_', \
        `upgradetime` INT NOT NULL DEFAULT 0, \
        PRIMARY KEY (`idclans`)) %s"
endLine
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `warnings`( \
        `idwarning` INT NOT NULL AUTO_INCREMENT, \
        `desc` varchar(64) NOT NULL, \
        `idplayer` INT NOT NULL, \
        `idadmin` INT NOT NULL, \
        `time` varchar(33) NOT NULL,\
        `map` varchar(33) NOT NULL, \
        PRIMARY KEY (`idwarning`)) %s"
endLine
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `classzombies`( \
        `idplayer` INT NOT NULL, \
        `idclass` INT NOT NULL, \
        `heatlh` INT UNSIGNED NOT NULL DEFAULT 0, \
        `speed` INT UNSIGNED NOT NULL DEFAULT 0, \
        `reduction` INT UNSIGNED NOT NULL DEFAULT 0, \
        PRIMARY KEY (`idplayer`, `idclass`)) %s"
endLine 
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `classhumans`( \
        `idplayer` INT NOT NULL, \
        `idclass` INT NOT NULL, \
        `level` INT NOT NULL DEFAULT 1, \
        `xp` FLOAT NOT NULL, \
        PRIMARY KEY (`idplayer`, `idclass`)) %s"
endLine
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `weapons`( \
        `idplayer` INT NOT NULL, \
        `idweapon` INT NOT NULL, \
        `nameweapon` varchar(64) NOT NULL, \
        `kills` INT NOT NULL DEFAULT 0, \
        `hs` INT NOT NULL DEFAULT 0, \
        `level` INT NOT NULL DEFAULT 0, \
        `damage` FLOAT NOT NULL DEFAULT '0.00', \
        PRIMARY KEY (`idplayer`, `idweapon`)) %s"
endLine
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
format(queryDatasizeof(queryData),
    
"CREATE TABLE IF NOT EXISTS `mutedplayers`( \
        `idmute` INT(11) AUTO_INCREMENT, \
        `nameplayer` VARCHAR(33) NOT NULL, \
        `mutedplayer` VARCHAR(33) NOT NULL, \
        PRIMARY KEY (`idmute`)) %s"
endLine
    
);
    
    
query SQL_PrepareQuery(connectionqueryData);
    
SQL_Execute(query);
    
    
SQL_FreeHandle(query);
    
    
sqlConnected true;

}
public 
loadStatsSql(idtypeLoad){
    
    if(
is_user_hltv(id)) return PLUGIN_CONTINUE;
        
    if (!
sqlConnected) {
        
log_amx("[SQL-LOG] Brak polaczenia");
        return 
PLUGIN_CONTINUE;
    }
    new 
queryData[256];
    new 
tempId[2];
    
    
tempId[0] = id;
    
tempId[1] = typeLoad;

    switch(
typeLoad){
        
        case 
0:{        
            if(!
isPlayer(id)) return PLUGIN_CONTINUE;
            
formatqueryDatasizeof(queryData), "\
            SELECT * \
                FROM `players` \
                WHERE `name`='%s'"
userName[id]);
        }
        case 
1format(queryDatasizeof(queryData), "\
            SELECT `name`, `kills`, `deaths`, `points` \
                FROM `players` \
                WHERE 1 \
                ORDER BY `points` \
                DESC LIMIT 10"
);
        case 
2format(queryDatasizeof(queryData), "\
            SELECT rank, count \
                FROM (SELECT COUNT(*) as count \
                FROM `players`) a \
                CROSS JOIN (SELECT COUNT(*) as rank \
                FROM `players` \
                WHERE `points` > '%d' \
                ORDER BY `points` DESC) b"
userPoints[id]);
        
        case 
3format(queryDatasizeof(queryData), "\
            SELECT `name`, `timePlay` \
                FROM `players` \
                WHERE 1 \
                ORDER BY `timePlay` \
                DESC LIMIT 10"
);
        case 
4format(queryDatasizeof(queryData), "\
            SELECT a.flag, b.*\
                FROM `players` a \
                JOIN `clans` b \
                ON a.clan = b.idclans \
                WHERE a.name = '%s'"
userName[id]);
        case 
5format(queryDatasizeof(queryData), "\
            SELECT name, members, kills, level, createDate \
                FROM `clans` \
                ORDER BY kills \
                DESC LIMIT 10"
);
        case 
6format(queryDatasizeof(queryData), "\
            SELECT name, clannugget \
                FROM `players` \
                WHERE clan = '%d' \
                AND clannugget > 0 \
                ORDER BY clannugget DESC"
clan[id]);
        case 
7format(queryDatasizeof(queryData), "\
            SELECT a.idclans AS 'idclan', a.name AS 'clan', b.name \
                FROM `clans` a \
                JOIN `players` b \
                ON a.idclans = b.clan \
                WHERE flag = '%d' \
                ORDER BY a.kills DESC"
STATUS_LEADER);
        case 
8format(queryDatasizeof(queryData), "\
            SELECT *\
                FROM `players` \
                WHERE clan = '%d' \
                ORDER BY flag DESC"
clan[id]);
        case 
9format(queryDatasizeof(queryData), "\
            SELECT COUNT(*) \
                FROM `warnings` \
                WHERE `idplayer`='%d';"
userSqlId[id]);
        case 
10format(queryDatasizeof(queryData), "\
            SELECT `idwarning`, `desc`, `time` \
                FROM `warnings` \
                WHERE `idplayer`='%d' \
                ORDER BY `idwarning` ASC"
userSqlId[userWarningInfo[id]]);
        case 
11formatqueryDatasizeof(queryData), "\
            SELECT * \
                FROM `classzombies` \
                WHERE `idplayer`='%d'"
userSqlId[id]);
        case 
12formatqueryDatasizeof(queryData), "\
            SELECT * \
                FROM `classhumans` \
                WHERE `idplayer`='%d'"
userSqlId[id]);
        case 
13format(queryDatasizeof(queryData), "\
            SELECT `name`, `level`, `xp`, `reset` \
                FROM `players` \
                WHERE 1 \
                ORDER BY `level` DESC, `xp` \
                DESC LIMIT 10"
);
        case 
14format(queryDatasizeof(queryData), "\
            SELECT `classhumans`.*, `playerName`.`name` AS `gracz` \
                FROM `classhumans` \
                LEFT JOIN `players` AS `playerName` ON `classhumans`.`idplayer` = `playerName`.`idplayer` \
                WHERE 1 \
                ORDER BY `level` DESC, `xp` \
                DESC LIMIT 10"
);
        case 
15format(queryDatasizeof(queryData), "\
            SELECT `name`, `maxDamage` \
                FROM `players` \
                WHERE 1 \
                ORDER BY `maxDamage` \
                DESC LIMIT 10"
);
        case 
16format(queryDatasizeof(queryData), "\
            SELECT rank, count \
                FROM (SELECT COUNT(*) as count FROM `players`) a \
                CROSS JOIN (SELECT COUNT(*) as rank \
                FROM `players` \
                WHERE `points` > '%d' \
                ORDER BY `points` DESC) b"
userPoints[id]);
        case 
17formatqueryDatasizeof(queryData), "\
            SELECT * \
                FROM `weapons` \
                WHERE `idplayer`='%d'"
userSqlId[id]);
        case 
18format(queryDatasizeof(queryData), "\
            SELECT `weapons`.*, `playerName`.`name` AS `gracz` \
                FROM `weapons` \
                LEFT JOIN `players` AS `playerName` ON `weapons`.`idplayer` = `playerName`.`idplayer` \
                WHERE 1 \
                ORDER BY `kills` \
                DESC LIMIT 10"
);
                
        case 
19format(queryDatasizeof(queryData), "\
            SELECT \
                * FROM `mutedplayers` \
                WHERE nameplayer = ^"
%s^""userName[id]);
            
    }
    
SQL_ThreadQuery(sql"loadStatsHandlerSql"queryDatatempIdsizeof(tempId));
    return 
PLUGIN_CONTINUE;
}

public 
loadStatsHandlerSql(failStateHandle:queryerror[], errorNumtempId[], dataSize){
    
    new 
id tempId[0];
    new 
typeLoad tempId[1];

    
    if (
failState){
        if (
failState == TQUERY_CONNECT_FAILED)  log_amx("[SQL-LOG] Nie mozna polaczyc si********* z baz********* danych SQL. Blad: %s (%d)"errorerrorNum);
        else if (
failState == TQUERY_QUERY_FAILED)log_amx("[SQL-LOG] Zapytanie watkowe nie powiodlo sie. Blad: %s (%d)"errorerrorNum);
        return 
PLUGIN_HANDLED;
    }    
    
    switch(
typeLoad){
        case 
0:{
            if( !
SQL_MoreResults(query) ){
                new 
queryData[128], tempId[2];
                
format(queryDatasizeof(queryData), "INSERT INTO `players` (`name`, `pass`,`firstlogin`) VALUES ('%s', '_', NOW())",userName[id]);
                
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryDatatempIdsizeof(tempId));
                
                
loadStatsSql(id0);
                
            } else {
                
    
                
userTime[id] = playedTime(id);
                
                new 
szPassword[12];
                new 
szDate[33];
                
                
userSqlId[id]    =    SQL_ReadResult(query0);
                
                
SQL_ReadResult(query2szPasswordsizeof(szPassword)-1);
                
replace_all(szPasswordsizeof(szPassword), " """);
                
                
                new 
szIp[MAXBITIP], szSid[MAXBITAUTHID];
                
SQL_ReadResult(query13szIpsizeof(szIp)-1);
                
SQL_ReadResult(query14szSidsizeof(szSid)-1);
                
userIp[id]     =     szIp;
                
userSid[id]     =     szSid;
                
                if( 
strlen(szPassword) > ){        
                    
copyuserPassword[id], sizeof(userPassword[])-1szPassword);
                        
                
                    new 
szSavedIP[MAXBITIP], szSavedSID[MAXBITAUTHID];
                    
get_user_ip(idszSavedIPsizeof(szSavedIP)-11);
                    
get_user_authid(idszSavedSIDsizeof(szSavedSID)-1);
                    
                    if( 
equal(szSavedIPszIp ) && equal(szSavedSIDszSid ) ){    
                        
userLogged[id]=true;
                        
chatPrint(idPREFIX_NORMAL"Zostales zalogowany automatycznie!");
                    }else{
                        
userLogged[id]=false;                                
                    }
                }else{
                    
userLogged[id]=false;
                }
                
        
                
userKills[id]     =      SQL_ReadResult(query3);
                
userDeaths[id]     =      SQL_ReadResult(query4);
                
userPoints[id]     =      SQL_ReadResult(query5);
            
                
                
userTime[id]     =      SQL_ReadResult(query6);
                
                
                
SQL_ReadResult(query7szDatesizeof(szDate)-1);
                
userFirstLogin[id] = szDate;
                
                
userMaxDmg[id]     =      SQL_ReadResult(query9);

                
                
userNugget[id]     =      SQL_ReadResult(query15);
                
userBone[id]     =      SQL_ReadResult(query16);
                
                
                
userLevel[id]    =    SQL_ReadResult(query17);
                new 
Float:XP;
                
SQL_ReadResult(query18XP);
                
                
userReset[id]     =    SQL_ReadResult(query19);
                
                
userExp[id]    =     XP;
                
                
refreshStats(id);
                
userLoaded[id] = true;
                
                
saveStatsSql(id0);
                
                
fVaultLoad(id);
                
                
loadStatsSql(id4);        // KLANY
                
loadStatsSql(id9);        // OSTRZEZENIA
                
loadStatsSql(id11);        // KLASY ZOMBIE
                
loadStatsSql(id12);        // KLASY LUDZI
                
loadStatsSql(id17);        // BRONIE 
                
loadStatsSql(id19);        // MUTE 
    
            
}
            
        }
        case 
1:{
            static 
iStats[3], szName[33];        
            static 
gText[2048], iLentop;
    
            
top=0;
    

            
iLen format(gText[iLen], sizeof(gText)-iLen-1"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<style type=^"text/css^">\
                                    *{ font-size: 15px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                                </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);
            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p>TOP 10 graczy!</p><hr size=1 color=%s>",accentMotdColor);
                
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");    
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Zabici</b></td><td><b>Zgony</b></td><td><b>Punkty</b></td><td><b>Stosunek</b></td></tr></br>");
            
            
            while(
SQL_MoreResults(query)){    
                
top ++;
                            
                
SQL_ReadResult(query0szNamesizeof(szName));
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                
                for( new 
03i++) iStats[i]=SQL_ReadResult(queryi+1);     
                
                
                
                static 
Float:deathToKills;
                
deathToKills=float(iStats[0])/float(iStats[1]);
                
                if(
iStats[2] > )
                
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td>%d</td><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%0.2f</td></tr>",topszName,iStats[0],iStats[1],iStats[2], deathToKills);
                
                
SQL_NextRow(query);    
                
            }
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"</table>");
            
show_motd(idgText"Top 10 Graczy");

        }
        case 
2:{
            static 
rankcount;
            
rank SQL_ReadResult(querySQL_FieldNameToNum(query"rank")) + 1;
            
count SQL_ReadResult(querySQL_FieldNameToNum(query"count")); 
    
            
chatPrint(idPREFIX_LINE"Twoj ranking:^3 %d/%d^4 |^1 Twoje punkty:^3 %d^4 |^1 Kile:^3 %d^4 /^1 Dedy:^3 %d",rank,count,  userPoints[id] ,userKills[id], userDeaths[id] );
        }
        case 
3:{
            static 
szTimeszName[33];        
            static 
gText[2048], iLentop;
    
            
top=0;
            
            
iLen format(gText[iLen], sizeof(gText)-iLen-1"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<style type=^"text/css^">\
                                    *{ font-size: 15px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                                </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);
                            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p>Twoj laczny czas na serwerze</p>");
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p><b>%d</b> godz <b>%s%d</b> min<b> %s%d</b> sek</p>",playedTime(id)/HOUR, (playedTime(id)/MINUTE)<10?"0":"",playedTime(id)/MINUTE%MINUTEplayedTime(id)%MINUTE<10?"0":""playedTime(id)%MINUTE);
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<hr size=1 color=%s>"accentMotdColor);
            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p>TOP 10 graczy!</p><hr size=1 color=%s>"accentMotdColor);
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");    
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Czas</b></td></tr></br>");
            
            while(
SQL_MoreResults(query)){    
                
top ++;
                            
                
SQL_ReadResult(query0szNamesizeof(szName));

                
szTime SQL_ReadResult(query1);     
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                
                if(
szTime 0)
                
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td>%d</td><td>%s</td><td>%d<b> godz</b> %s%d<b> min</b> %s%d<b> sek</b></td></tr>",topszName,szTime/HOUR, (szTime/MINUTE)<10?"0":"",szTime/MINUTE%MINUTE,szTime%MINUTE<10?"0":""szTime%MINUTE);
                
                
SQL_NextRow(query);
                
            }
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"</table>");
            
            
show_motd(idgText"Info Czasu");

        }
        case 
4:{
            
            
            if (
SQL_MoreResults(query)) {
                new 
bbClan[clanInfo];
            
                
bbClan[CLAN_ID] = SQL_ReadResult(querySQL_FieldNameToNum(query"idclans"));
            
                if (!
check_clan_loaded(bbClan[CLAN_ID]))
                {
                    
SQL_ReadResult(querySQL_FieldNameToNum(query"name"), bbClan[CLAN_NAME], sizeof(bbClan[CLAN_NAME]));
                    
SQL_ReadResult(querySQL_FieldNameToNum(query"info"), bbClan[CLAN_INFO], sizeof(bbClan[CLAN_INFO]));
                    
SQL_ReadResult(querySQL_FieldNameToNum(query"idmotd"), bbClan[CLAN_MOTD], sizeof(bbClan[CLAN_MOTD]));
                    
                    
bbClan[CLAN_UPGRADETIME]     =         SQL_ReadResult(querySQL_FieldNameToNum(query"upgradetime"));
                    
                    
bbClan[CLAN_LEVEL]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"level"));
                    
bbClan[CLAN_POINTS]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"points"));
                        
                        
                    
bbClan[CLAN_NUGGET]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"nugget"));
                    
bbClan[CLAN_HEALTH]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"health"));
                    
bbClan[CLAN_DAMAGECLASS]     =         SQL_ReadResult(querySQL_FieldNameToNum(query"damageClass"));
                    
bbClan[CLAN_DAMAGEPLAYER]     =         SQL_ReadResult(querySQL_FieldNameToNum(query"damagePlayer"));
                    
bbClan[CLAN_CRITIC]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"critic"));
                    
bbClan[CLAN_KILLS]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"kills"));
                    
                    
bbClan[CLAN_EXPDROP]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"expDrop"));
                    
bbClan[CLAN_NUGGETDROP]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"nuggetDrop"));
                    
                    
bbClan[CLAN_COOLDOWN]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"cooldown"));
                    
                    
bbClan[CLAN_MEMBERS]         =         SQL_ReadResult(querySQL_FieldNameToNum(query"members"));
                    
bbClan[CLAN_STATUS]         =         _:TrieCreate();
                    
                    
ArrayPushArray(bbClansbbClan);
                }
                    
                
clan[id] = bbClan[CLAN_ID];
            
                new 
status SQL_ReadResult(querySQL_FieldNameToNum(query"flag"));
        
                
TrieSetCell(Trie:get_clan_info(clan[id], CLAN_STATUS), userName[id], status);            
            }
        }
        case 
5:{
            static 
clanName[64], memberskillsleveldateCreate[64];        
            static 
gText[2048], iLentop;
            
            
clanName ""dateCreate "";
            
top=0;
            
            
            
            
iLen format(gText[iLen], sizeof(gText)-iLen-1"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p>Top 10 Klanow!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");    
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Czlonkowie</b></td><td><b>Poziom</b></td><td><b>Zabojstwa</b></td><td><b>Data Zalozenia</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(query0clanNamesizeof(clanName));
                
                
members SQL_ReadResult(query1);
                
kills SQL_ReadResult(query2);
                
level SQL_ReadResult(query3);
                
                
SQL_ReadResult(query4dateCreatesizeof(dateCreate));
                
                
                
replace_all(clanNamesizeof(clanName), "<""");
                
replace_all(clanNamesizeof(clanName), ">""");
                
replace_all(clanNamesizeof(clanName), "%""%%");    
                            
                
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td>%d</td><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%s</td></tr>",topclanNamememberslevelkillsdateCreate);
                        
                
SQL_NextRow(query);
                    
            }
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"</table>");
            
show_motd(idgText"Top 10 Klanow");
        }
        case 
6:{
            static 
nuggetszName[33];        
            static 
gText[2048], iLentop;
            
            
top=0;
            
            
            
iLen format(gText[iLen], sizeof(gText)-iLen-1"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<p>Lista Wplacajacych!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Brylki</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(query0szNamesizeof(szName));
                
                
nugget SQL_ReadResult(query1);
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                            
                
iLen += format(gText[iLen], sizeof(gText)-iLen-1"<tr><td>%d</td><td>%s</td><td>%s</td></tr>",topszName,formatNumber(nugget));
                        
                
SQL_NextRow(query);    
                    
            }
            
iLen += format(gText[iLen], sizeof(gText)-iLen-1"</table>");
            
show_motd(idgText"Lista Wplacajacych");
        }
        case 
7:{
            static 
gText[128], clanName[33], szName[33], count;
            
clanName ""count 0;
            
            
format(gTextsizeof(gText), "\r[BaseBuilder]\y Lista Klanow!\d ");
            new 
menu menu_create(gText"listClanMenu_2");
        
            while (
SQL_MoreResults(query)) {
                
                
SQL_ReadResult(querySQL_FieldNameToNum(query"clan"),     clanName,     sizeof(clanName));
                
SQL_ReadResult(querySQL_FieldNameToNum(query"name"),     szName,         sizeof(szName));
            
                
format(gTextsizeof(gText), "\d%s \w |\y Przywodca:\r %s"clanNameszName);
                
                
menu_additem(menugText );
        
                
userViewClan[id][count++] = SQL_ReadResult(querySQL_FieldNameToNum(query"idclan"));
        
                
SQL_NextRow(query);
            }
        
            
menu_setprop(menuMPROP_BACKNAME"Poprzednie");
            
menu_setprop(menuMPROP_NEXTNAME"Nastepne");
            
menu_setprop(menuMPROP_EXITNAME"Wyjscie");
        
            if (!
count) {
                
menu_destroy(menu);
                
chatPrint(idPREFIX_NORMAL,"Nie ma zadnego klanu!");
            } else 
menu_display(idmenu0);
        }
        case 
8:{
            new 
itemData[64], szName[33], statusmenu menu_create("\r[BaseBuilder]\y Zarzadzaj Czlonkami""memberMenu_2");
    
            while (
SQL_MoreResults(query)) {
                
SQL_ReadResult(querySQL_FieldNameToNum(query"name"), szNamesizeof(szName));
        
                
status SQL_ReadResult(querySQL_FieldNameToNum(query"flag"));
                
                
format(itemDatasizeof(itemData), "%s#%d"szNamestatus);
                
                switch (
status) {
                    case 
STATUS_MEMBERadd(szNamesizeof(szName), " \d[Czlonek]");
                    case 
STATUS_DEPUTYadd(szNamesizeof(szName), " \y[Zastepca]");
                    case 
STATUS_LEADERadd(szNamesizeof(szName), " \r[Przywodca]");
                }
                
                
menu_additem(menuszNameitemData);
        
                
SQL_NextRow(query);
            }
            
            
menu_setprop(menuMPROP_EXITNAME"Wyjscie");
            
menu_setprop(menuMPROP_BACKNAME"Poprzednie");
            
menu_setprop(menuMPROP_NEXTNAME"Nastepne");
            
            
menu_display(idmenu0);
        }
        
        case 
9:{
            
userWarningAmount[id] = SQL_ReadResult(query0);
        }
        case 
10:{
            new 
target userWarningInfo[id];
            new 
szName[11];
            new 
count 0;
            
            
            new 
menu menu_createformatm("\r[BaseBuilder]\y Ostrzezenia Gracza:\r %s\d [\w%d\d/\w%d\d]"userName[target], userWarningAmount[id], MAXWAR), "warningList_2" );
            
            new 
szInfo[2][MAXLEN];
            
        
        
            while (
SQL_MoreResults(query)) {
                
                
                
SQL_ReadResult(querySQL_FieldNameToNum(query"desc"), szInfo[0], sizeof(szInfo[]));
                
SQL_ReadResult(querySQL_FieldNameToNum(query"time"), szInfo[1], sizeof(szInfo[]));

                
                
copy(szNamesizeof(szName)-1szInfo[0]);
        
                if(
strlen(szInfo[0]) > 10)
                
menu_additem(menuformatm("\d%s...\w |\y %s"szNameszInfo[1]));
                else 
menu_additem(menuformatm("\d%s\w |\y %s"szInfo[0], szInfo[1]));
                    
                
                
userWarningMenu[id][count++] = SQL_ReadResult(query0);
                
                
SQL_NextRow(query);
                
            
            }
            
            
menu_setprop(menuMPROP_EXITNAME"Wyjscie");
            
menu_setprop(menuMPROP_BACKNAME"Poprzednie");
            
menu_setprop(menuMPROP_NEXTNAME"Nastepne");
            
            if(!
count) {
                
menu_destroy(menu);
                
warningInfo(id);
                
chatPrint(idPREFIX_LINE"Gracz nie posiada rzadnych ostrzezen!");
            } else 
menu_display(idmenu);
            
            
                
        }
        case 
11:{
            
                
            while (
SQL_MoreResults(query)){
                
                new class = 
SQL_ReadResult(query1);
                    
                for(new 
type 0type UM_ZM_TOTALtype++){
                    
userZombie[id][class][type] = SQL_ReadResult(querytype 2);
                }
                
SQL_NextRow(query);
                    
            }            
        }
        case 
12:{
            
            new 
Float:XP;    
            while (
SQL_MoreResults(query)){
                
                new class = 
SQL_ReadResult(query1);
                    
            
                
userHumanLevel[id][class] = SQL_ReadResult(query2);
                
SQL_ReadResult(query3XP);
                
userExpClass[id][class] = XP;
                
                
SQL_NextRow(query);
                    
            }    
        }
        case 
13:{
            
            new 
levelFloat:expresetszName[33];        
            new 
gText[2048], iLen=0top=0;
            
            new 
sizeText sizeof(gText)-iLen-1;
            
            
iLen += format(gText[iLen], sizeText"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeText"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeText"<p>TOP 10 najwiekszych poziomow Postaci!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeText"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");    
            
iLen += format(gText[iLen], sizeText"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Poziom</b></td><td><b>XP</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(query0szNamesizeof(szName));
                
level SQL_ReadResult(query1);
                
SQL_ReadResult(query2exp);
                
reset SQL_ReadResult(query3);
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                            
                
iLen += format(gText[iLen], sizeText"<tr><td>%d</td><td>%s</td><td>%d</td><td>%0.2f %%</td></tr>",topszName,level, (exp*100.0/float(level 45 45 reset)));
                        
                
SQL_NextRow(query);    
                    
            }
            
iLen += format(gText[iLen], sizeText"</table>");
            
show_motd(idgText"Top 10 Postaci");
        }
        case 
14:{
            
            new 
levelFloat:expidclassszName[33];        
            new 
gText[2048], iLen=0top=0;
            
            new 
sizeText sizeof(gText)-iLen-1;
            
            
iLen += format(gText[iLen], sizeText"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeText"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeText"<p>TOP 10 najwiekszych poziomow Klas!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeText"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");    
            
iLen += format(gText[iLen], sizeText"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Klasa</b></td><td><b>Poziom</b></td><td><b>XP</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(querySQL_FieldNameToNum(query"gracz"), szNamesizeof(szName));
                
SQL_ReadResult(querySQL_FieldNameToNum(query"xp"), exp);
                
idclass    =     SQL_ReadResult(querySQL_FieldNameToNum(query"idclass"));
                
level     =     SQL_ReadResult(querySQL_FieldNameToNum(query"level"));
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                            
            
                
iLen += format(gText[iLen], sizeText"<tr><td>%d</td><td>%s</td><td>%s</td><td>%d</td><td>%0.2f %%</td></tr>",topszName,classesHuman[idclass][0],level, (exp*100.0/float(level 45)));
                        
                
SQL_NextRow(query);    
                    
            }
            
iLen += format(gText[iLen], sizeText"</table>");
            
show_motd(idgText"Top 10 Klas");
        }
        case 
15:{
            
            new 
maxdmgszName[33];        
            new 
gText[2048], iLen=0top=0;
            
            new 
sizeText sizeof(gText)-iLen-1;
            
            
iLen += format(gText[iLen], sizeText"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeText"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeText"<p>TOP 10 najwiekszych Obrazen!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeText"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");
            
iLen += format(gText[iLen], sizeText"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Obrazenia</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(query0szNamesizeof(szName));
                
maxdmg SQL_ReadResult(query1);
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                            
                
iLen += format(gText[iLen], sizeText"<tr><td>%d</td><td>%s</td><td>%d</td></tr>",topszName,maxdmg);
                        
                
SQL_NextRow(query);    
                    
            }
            
iLen += format(gText[iLen], sizeText"</table>");
            
show_motd(idgText"Top 10 Obrazen");
        }
        case 
16:{

            new 
rank SQL_ReadResult(querySQL_FieldNameToNum(query"rank")) + 1;
            new 
count SQL_ReadResult(querySQL_FieldNameToNum(query"count"));
            
            
            new 
menu menu_create(formatm("\r[BaseBuilder]\y Topka Serwerowa"), "topMenu_2");
    
            
menu_additem(menuformatm("Twoj Rank\d [\r %d\y /\r %d\d ]"rankcount));
            
menu_additem(menu"Top 10 Punktow");
            
menu_additem(menu"Top 10 Czasu");
            
menu_additem(menu"Top 10 Postaci");
            
menu_additem(menu"Top 10 Klas");
            
menu_additem(menu"Top 10 Obrazen");
            
menu_additem(menu"Top 10 Klanow");
            
menu_additem(menu"Top 10 Zabojst Bronia");
        
            
menu_display(idmenu0);
        
            
menu_setprop(menuMPROP_EXITNAME"Wyjscie");
            
menu_setprop(menuMPROP_BACKNAME"Poprzednie");
            
menu_setprop(menuMPROP_NEXTNAME"Nastepne");
            
        }
        case 
17:{
            new 
Float:DAMAGE;
            while (
SQL_MoreResults(query)){
                
                new 
weapon SQL_ReadResult(query1);
                
                
userWeaponKill[id][weapon] = SQL_ReadResult(query3);
                
userWeaponHs[id][weapon] = SQL_ReadResult(query4);
                
userWeaponLevel[id][weapon] = SQL_ReadResult(query5);
                
SQL_ReadResult(query6DAMAGE);
                
userWeaponDamage[id][weapon] = DAMAGE;
                    
                
                
SQL_NextRow(query);
                    
            }
            
            
        }
        case 
18:{
            
            new 
szWeapon[33], szName[33], killshs;        
            new 
gText[2048], iLen=0top=0;
            
            new 
sizeText sizeof(gText)-iLen-1;
            
            
iLen += format(gText[iLen], sizeText"<head><link href=^"https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700^" rel=^"stylesheet^"></head>");
            
iLen += format(gText[iLen], sizeText"\
                            <style>\
                                    *{ font-size: 16px; font-family: Montserrat; color: white; text-align: center; padding: 0; margin: 0;}\
                                    body{border: 1px solid %s; background: #111}\
                                    b{color:%s; text-shadow: 0 0 5px %s;}\
                            </style>"
,accentMotdColor,accentMotdColor,accentMotdColor);        
                                            
            
iLen += format(gText[iLen], sizeText"<p>TOP 10 Zabojst Bronia!</p><hr size=1 color=%s>",accentMotdColor);
            
iLen += format(gText[iLen], sizeText"<table style=^"margin-top20px;margin-leftauto;margin-rightauto;width:710%^">");
            
iLen += format(gText[iLen], sizeText"<tr><td><b>#</b></td><td><b>Nazwa</b></td><td><b>Bron</b></td><td><b>Zabojstwa</b></td><td><b>Hs</b></td></tr></br>");
                    
                    
            while(
SQL_MoreResults(query)){    
                
top ++;
                                    
                
SQL_ReadResult(querySQL_FieldNameToNum(query"gracz"), szNamesizeof(szName));
                
SQL_ReadResult(querySQL_FieldNameToNum(query"nameweapon"), szWeaponsizeof(szWeapon));
                
kills    =     SQL_ReadResult(querySQL_FieldNameToNum(query"kills"));
                
hs    =     SQL_ReadResult(querySQL_FieldNameToNum(query"hs"));
                
                
                new 
Float:hsToKills;
                
hsToKills=float(hs)/float(kills);    
                
                
replace_all(szNamesizeof(szName), "<""");
                
replace_all(szNamesizeof(szName), ">""");
                
replace_all(szNamesizeof(szName), "%""%%");    
                            
                
iLen += format(gText[iLen], sizeText"<tr><td>%d</td><td>%s</td><td>%s</td><td>%d</td><td>%0.1f%%</td></tr>",topszName,szWeaponkills, (hsToKills 100.0));
                        
                
SQL_NextRow(query);    
                    
            }
            
iLen += format(gText[iLen], sizeText"</table>");
            
show_motd(idgText"TOP 10 Zabojst Bronia");
        }
        case 
19:{
            new 
muteName[33];
            
            while (
SQL_MoreResults(query)) {
                
                
SQL_ReadResult(query2muteNamesizeof(muteName) - 1);
                
                
TrieSetCell(userMutes[id], muteName1);
        
                
SQL_NextRow(query);
            }
            
        }
    
        default:{ }
    }
    return 
PLUGIN_HANDLED;
}
public 
topMenu_2(idmenuitem){
    if(
item == MENU_EXIT){
        
menu_destroy(menu);
        return;
    }
    switch(
item){
        case 
0loadStatsSql(id2);
        case 
1loadStatsSql(id1);
        case 
2loadStatsSql(id3);
        case 
3loadStatsSql(id13);
        case 
4loadStatsSql(id14);
        case 
5loadStatsSql(id15);
        case 
6loadStatsSql(id,5);
        case 
7loadStatsSql(id,18);
    }
    
loadStatsSql(id16);
}
public 
saveStatsSql(idtypeSave){
    
    if(
is_user_hltv(id)) return PLUGIN_CONTINUE;
    if(!
sqlConnected) return PLUGIN_CONTINUE;
    if(!
userLoaded[id]) return PLUGIN_CONTINUE;
    
    new 
queryData[256], tempId[2];
    
    
tempId[0] = id;
    
    switch(
typeSave){
        case 
0:{
            
format(queryDatasizeof(queryData), "\
            UPDATE `players`\
                SET `kills`='%d', `deaths`='%d', `points`='%d', `maxDamage`='%d'\
                WHERE `name` ='%s'"
userKills[id], userDeaths[id], userPoints[id], userMaxDmg[id], userName[id]);
        }
        case 
1:{
            
format(queryDatasizeof(queryData), "\
            UPDATE `players`\
                SET `pass`='%s', `ipLogin`='%s', `sidLogin`='%s'\
                WHERE `name` ='%s'"
strlen(userPassword[id])>1?userPassword[id]:"_"strlen(userIp[id])>1?userIp[id]:"_"strlen(userSid[id])>1?userSid[id]:"_",  userName[id]);
        }
        case 
2:{
            
format(queryDatasizeof(queryData), "\
            UPDATE `players`\
                SET `timePlay`='%d', `lastlogin`= NOW()\
                WHERE `name` ='%s'"
, (floatround(userTime[id] +=  get_gametime()-userTimeConnectServer[id])), userName[id]);
        }
        case 
3:{
            
format(queryDatasizeof(queryData), "\
            UPDATE `players`\
                SET `level`='%d', `xp`='%0.2f'\
                WHERE `name` ='%s'"
userLevel[id],userExp[id], userName[id]);
        }
        case 
4:{
            
format(queryDatasizeof(queryData), "\
            UPDATE `players`\
                SET `nuggets`='%d', `bones`='%d'\
                WHERE `name` ='%s'"
userNugget[id], userBone[id], userName[id]);
        }
        
        
        default:{}
    }
    
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryDatatempIdsizeof(tempId));
    return 
PLUGIN_CONTINUE;

}
public 
saveInsert(idtypeSavetypeSlot){
    
    if(
is_user_hltv(id)) return PLUGIN_CONTINUE;
    if(!
sqlConnected) return PLUGIN_CONTINUE;
    if(!
userLoaded[id]) return PLUGIN_CONTINUE;
    
    new 
queryData[256], tempId[3];
    
    
tempId[0] = id;
    
tempId[1] = typeSave;
    
tempId[2] = typeSlot;
    
    switch(
typeSave){
        
        case 
0:{
            for(new 
0human_TOTAL++){
                if(!
hasClassHuman(idi)) continue;
                
                
format(queryDatasizeof(queryData), "\
                INSERT INTO `classhumans` (`idplayer`, `idclass`, `level`, `xp`)\
                    VALUES ('%d','%d','%d','%0.2f')\
                    ON DUPLICATE KEY UPDATE `level`='%d', `xp`='%0.2f'"
userSqlId[id], iuserHumanLevel[id][i], userExpClass[id][i], userHumanLevel[id][i], userExpClass[id][i]);
                
                
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryDatatempIdsizeof(tempId));
            }
        }
        case 
1:{
            
format(queryDatasizeof(queryData), "\
            INSERT INTO `classzombies` (`idplayer`, `idclass`, `heatlh`, `speed`, `reduction`)\
                VALUES ('%d','%d','%d','%d','%d')\
                ON DUPLICATE KEY UPDATE `heatlh`='%d', `speed`='%d', `reduction`='%d'"
userSqlId[id], userVarMenu[id], userZombie[id][userVarMenu[id]][UP_ZM_HEALTH], userZombie[id][userVarMenu[id]][UP_ZM_SPEED], userZombie[id][userVarMenu[id]][UP_ZM_REDUCTION], userZombie[id][userVarMenu[id]][UP_ZM_HEALTH], userZombie[id][userVarMenu[id]][UP_ZM_SPEED], userZombie[id][userVarMenu[id]][UP_ZM_REDUCTION]);
            
            
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryDatatempIdsizeof(tempId));
        }
        case 
2:{
            
            if(!
userWeaponKill[id][typeSlot] && !userWeaponDamage[id][typeSlot]) return PLUGIN_CONTINUE;
            
            
format(queryDatasizeof(queryData), "\
            INSERT INTO `weapons` (`idplayer`, `idweapon`, `nameweapon`, `kills`,`hs`, `level`, `damage`)\
                VALUES ('%d','%d','%s', '%d','%d','%d','%0.2f')\
                ON DUPLICATE KEY UPDATE `kills`='%d',`hs`='%d', `level`='%d', `damage`='%0.2f'"
userSqlId[id], typeSlotallGuns[typeSlot][1], userWeaponKill[id][typeSlot], userWeaponHs[id][typeSlot], userWeaponLevel[id][typeSlot], userWeaponDamage[id][typeSlot], userWeaponKill[id][typeSlot],userWeaponHs[id][typeSlot], userWeaponLevel[id][typeSlot], userWeaponDamage[id][typeSlot]);
            
            
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryDatatempIdsizeof(tempId));
            
        }
        default:{ return 
PLUGIN_CONTINUE; }
    }
    return 
PLUGIN_CONTINUE;

}
public 
saveStatsHandlerSql(failStateHandle:queryerror[], errorNumdata[], dataSize){
    if (
failState){
        if (
failState == TQUERY_CONNECT_FAILEDlog_amx("[SQL-LOG] Nie mozna polaczyc si********* z baz********* danych SQL. Blad: %s (%d)"errorerrorNum);
        else if (
failState == TQUERY_QUERY_FAILEDlog_amx("[SQL-LOG] Zapytanie watkowe nie powiodlo sie. Blad: %s (%d)"errorerrorNum);
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
save_clan(clan){
    static 
queryData[512], safeClanName[64],safeClanInfo[43], safeClanMotd[22], bbClan[clanInfo];
    
    
ArrayGetArray(bbClansclanbbClan);

    
replace_all_string(bbClan[CLAN_NAME], safeClanNamesizeof(safeClanName));
    
replace_all_string(bbClan[CLAN_INFO], safeClanInfosizeof(safeClanInfo));
    
replace_all_string(bbClan[CLAN_MOTD], safeClanMotdsizeof(safeClanMotd));
    
    
format(queryDatasizeof(queryData), "\
    UPDATE `clans`\
        SET name = '%s', info = '%s', level = '%d', points = '%d', nugget = '%d', kills = '%d', members = '%d', health = '%d', damagePlayer = '%d', damageClass = '%d', critic = '%d', expDrop = '%d', nuggetDrop = '%d', cooldown = '%d', idmotd='%s', upgradetime='%d' \
        WHERE name = '%s'"
safeClanName,safeClanInfobbClan[CLAN_LEVEL], bbClan[CLAN_POINTS], bbClan[CLAN_NUGGET], bbClan[CLAN_KILLS], bbClan[CLAN_MEMBERS], bbClan[CLAN_HEALTH], bbClan[CLAN_DAMAGEPLAYER], bbClan[CLAN_DAMAGECLASS], bbClan[CLAN_CRITIC], bbClan[CLAN_EXPDROP],bbClan[CLAN_NUGGETDROP],bbClan[CLAN_COOLDOWN],safeClanMotd,bbClan[CLAN_UPGRADETIME] ,  safeClanName);
    
    
SQL_ThreadQuery(sql"saveStatsHandlerSql"queryData);
}

public 
mysqlSave(id){
    
    if(
is_user_hltv(id)) return PLUGIN_CONTINUE;
    if(!
sqlConnected) return PLUGIN_CONTINUE;
    if(!
userLoaded[id]) return PLUGIN_CONTINUE;
    
    for(new 
05i++) saveStatsSql(idi);
    
    
saveInsert(id00);
    
saveInsert(id2userWeaponSelect[id]);

    
userLoaded[id] = false;
    
userLogged[id] = false;
    
    return 
PLUGIN_CONTINUE;
    
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/ 
saveLoad
PHP Code:
#include <amxmisc>
#include <fvault>

public loadInt(id){
    
    
userLogged[id] = false;
    
userLoaded[id] = false;
    
userLoadVault[id] = false;
    
    
loadStatsSql(id0);
    
    
// loadData(id) /* Jest juz w loadStatsSql */
}
public 
fVaultLoad(id){
    
    new 
day;
    
date(_,_day);
    
    new 
szData[756];
    if( 
fvault_get_data(fVAULTFILEuserName[id], szDatasizeof(szData) - 1) ){
        
        new 
szOption[5];
        new 
szAllNugget[11];
        new 
szTimeVip[11];
        new 
szTimeSVip[11];
        new 
szLuzCoin[11];
        new 
szClassHuman[10];
        new 
szMission[mission_TOTAL*7];
        new 
szMissionOne[mission_TOTAL][7];
        new 
szMissionSecret[mission_secret_TOTAL*7];
        new 
szMissionSecretOne[mission_secret_TOTAL][7];
        new 
szPro[TOTAL_PRO*5];
        new 
szProOne[TOTAL_PRO][5];
        new 
szProSelected[3];
        new 
szHumanSelectNew1[3];
        new 
szHumanSelectNew2[3];
        new 
szZombieSelectNew1[3];
        new 
szZombieSelectNew2[3];
        new 
szExpGiveClass[5];
        new 
szDayFreeNugger[3];
        new 
szJetpackSpeed[7];
        new 
szColorRendering[3];
        new 
szColorRed[4], szColorGreen[4], szColorBlue[4];
        new 
szTimeStamina[10];
        new 
szStaminaDayRefresh[10];
        new 
szUpgradeMine[up_TOTAL*7];
        new 
szUpgradeMineOne[up_TOTAL][7];
        new 
szDigging[mine_TOTAL*7];
        new 
szDiggingOne[mine_TOTAL][7];
        new 
szTypeMine[10];
        new 
szMineNugget[10];
        new 
szPayDayGoblin[10];
        new 
szLastUpgradeTime[7];
        new 
szUnlockCave[3];
        new 
szStartUpgrade[3];
        new 
szAwardTime[7];
        new 
szAllAward[7];
        new 
szAllDmg[11];
        new 
szFov[4];
        new 
szScrollExp[10];
        new 
szScrollNugget[10];
        new 
szBoostMine[10];
        new 
szMute[11];
        new 
szMaxHelp[3];
        new 
szHelpDay[3];
        new 
szHelpPointAdmin[5];
        new 
szPointSecret[7];
        new 
szLastAwardGot[11];
        new 
szLastAwardFree[11];
        new 
szLastAwardRow[7];
        new 
szChristmasStart[5];
        new 
szChristmasMission[5];
        new 
szChristmasType[5];
        new 
szHat[4][11];
        new 
szSelectHat[2][3];
        
        
parse(szData,
            
szLuzCoin,        sizeof(szLuzCoin),
            
szTimeVip,        sizeof(szTimeVip),
            
szTimeSVip,        sizeof(szTimeSVip),
            
szOption,        sizeof(szOption),
            
szAllNugget,        sizeof(szAllNugget),
            
szClassHuman,         sizeof(szClassHuman),
            
szMission,         sizeof(szMission),
            
szMissionSecret,    sizeof(szMissionSecret),
            
szPro,            sizeof(szPro),
            
szProSelected,        sizeof(szProSelected),
            
szHumanSelectNew1,    sizeof(szHumanSelectNew1),
            
szHumanSelectNew2,    sizeof(szHumanSelectNew2),
            
szZombieSelectNew1,    sizeof(szZombieSelectNew1),
            
szZombieSelectNew2,    sizeof(szZombieSelectNew2),
            
szExpGiveClass,        sizeof(szExpGiveClass),
            
szDayFreeNugger,     sizeof(szDayFreeNugger),
            
szColorRed,        sizeof(szColorRed),
            
szColorGreen,        sizeof(szColorGreen),
            
szColorBlue,        sizeof(szColorBlue),
            
szJetpackSpeed,        sizeof(szJetpackSpeed),
            
szColorRendering,    sizeof(szColorRendering),
            
szTimeStamina,        sizeof(szTimeStamina),
            
szStaminaDayRefresh,    sizeof(szStaminaDayRefresh),
            
szUpgradeMine,        sizeof(szUpgradeMine),
            
szDigging,        sizeof(szDigging),
            
szTypeMine,        sizeof(szTypeMine),
            
szMineNugget,        sizeof(szMineNugget),
            
szPayDayGoblin,        sizeof(szPayDayGoblin),
            
szLastUpgradeTime,    sizeof(szLastUpgradeTime),
            
szUnlockCave,        sizeof(szUnlockCave),
            
szStartUpgrade,        sizeof(szStartUpgrade),
            
szAwardTime,        sizeof(szAwardTime),
            
szAllAward,        sizeof(szAllAward),
            
szAllDmg,        sizeof(szAllDmg),
            
szFov,            sizeof(szFov),
            
szScrollExp,        sizeof(szScrollExp),
            
szScrollNugget,        sizeof(szScrollNugget),
            
szBoostMine,        sizeof(szBoostMine),
            
szMute,            sizeof(szMute),
            
szMaxHelp,        sizeof(szMaxHelp),
            
szHelpDay,        sizeof(szHelpDay),
            
szHelpPointAdmin,    sizeof(szHelpPointAdmin),
            
szPointSecret,        sizeof(szPointSecret),
            
szLastAwardGot,        sizeof(szLastAwardGot),
            
szLastAwardFree,    sizeof(szLastAwardFree),
            
szLastAwardRow,        sizeof(szLastAwardRow),
            
szChristmasStart,    sizeof(szChristmasStart),
            
szChristmasMission,    sizeof(szChristmasMission),
            
szChristmasType,    sizeof(szChristmasType),
            
szHat[0],        sizeof(szHat[]),
            
szHat[1],        sizeof(szHat[]),
            
szHat[2],        sizeof(szHat[]),
            
szHat[3],        sizeof(szHat[]),
            
szSelectHat[0],        sizeof(szSelectHat[]),
            
szSelectHat[1],        sizeof(szSelectHat[])
        
            
        );
        
timeVip[id]             =     str_to_num(szTimeVip);
        
timeSVip[id]             =     str_to_num(szTimeSVip);
        
userSaveOption[id]        =    str_to_num(szOption);
        
userNuggetAll[id]        =    str_to_num(szAllNugget);
        if(
timeVip[id]             >     get_systime()) userVip[id] = true;
        if(
timeSVip[id]             >     get_systime()) userSVip[id] = true;
        
userLuzCoin[id]            =     str_to_num(szLuzCoin);
        
        
userHuman[id]         =     str_to_num(szClassHuman);

        
explode(szMission    ,'_'    ,szMissionOne    ,sizeof(szMissionOne)    ,sizeof(szMissionOne[]));
        for(new 
sizeof(szMissionOne); ++ ) userMission[id][i] = str_to_num(szMissionOne[i]);
            
        
explode(szMissionSecret    ,'_'    ,szMissionSecretOne    ,sizeof(szMissionSecretOne)    ,sizeof(szMissionSecretOne[]));
        for(new 
sizeof(szMissionSecretOne); ++ ) userMissionSecret[id][i] = str_to_num(szMissionSecretOne[i]);
            
        
        
userProSelected[id]            =    str_to_num(szProSelected);
        
userClassHuman[id]            =    str_to_num(szHumanSelectNew1);
        
userNewClassHuman[id]            =    str_to_num(szHumanSelectNew2);
        
userNewClass[id]            =    str_to_num(szZombieSelectNew1);
        
userClass[id]                =    str_to_num(szZombieSelectNew2);
        
userGiveClassExp[id]            =    str_to_num(szExpGiveClass);
        
userLastDay[id]                =    str_to_num(szDayFreeNugger);
        
userHud[id][PLAYER_HUD_RED]         =     str_to_num(szColorRed);
        
userHud[id][PLAYER_HUD_GREEN]         =     str_to_num(szColorGreen);
        
userHud[id][PLAYER_HUD_BLUE]         =     str_to_num(szColorBlue);
        
userJetpackSpeed[id]            =    str_to_num(szJetpackSpeed);
        
userMoverBlockColor[id]            =    str_to_num(szColorRendering);
        
        if(
str_to_num(szHelpDay) != day){
            
userMaxHelp[id]            =    bbCvar[cvarHelpMaxCount];
            
userDayHelp[id]            =    day;
        } else {
            
userMaxHelp[id]            =    str_to_num(szMaxHelp);
            
userDayHelp[id]            =    str_to_num(szHelpDay);
        }
        
        if( 
str_to_num(szStaminaDayRefresh) != day ){
            
userLastStaminaTime[id]         =     playedTime(id);
            
userStaminaDayRefresh[id]    =     day;
            
userMinePayGoblin[id]        =    true;
        }else{            
            
userLastStaminaTime[id]         =     str_to_num(szTimeStamina);
            
userStaminaDayRefresh[id]     =     str_to_num(szStaminaDayRefresh);
            
userMinePayGoblin[id]        =    false;
        }
        
        
explode(szPro        ,'_'    ,szProOne    ,sizeof(szProOne)    ,sizeof(szProOne[]));
        for(new 
sizeof(szProOne); ++ ) userPro[id][i] = str_to_num(szProOne[i]);
            
        
explode(szUpgradeMine        ,'_'    ,szUpgradeMineOne    ,sizeof(szUpgradeMineOne)    ,sizeof(szUpgradeMineOne[]));
        for(new 
sizeof(szUpgradeMineOne); ++ ) userUpgradeMine[id][i] = str_to_num(szUpgradeMineOne[i]);
            
        
explode(szDigging        ,'_'    ,szDiggingOne    ,sizeof(szDiggingOne)    ,sizeof(szDiggingOne[]));
        
        for(new 
sizeof(szDiggingOne); ++ ) userDigging[id][i] = str_to_num(szDiggingOne[i]);        
        
        
userTypeMine[id]            =    str_to_num(szTypeMine);
        
userMineNugget[id]            =    str_to_num(szMineNugget);
        
userLastUpgradeTime[id]            =    str_to_num(szLastUpgradeTime);
        
unlockCave[id]                =    str_to_num(szUnlockCave);
        
startUpgrade[id]            =    str_to_num(szStartUpgrade);
        
        
userLastAwardTime[id]             =    str_to_num(szAwardTime);
        
        
userAllAward[id]            =    str_to_num(szAllAward);
        
userAllDmg[id]                =    str_to_num(szAllDmg);
        
        
userFov[id]                =    str_to_num(szFov);
                
        
userScrollExp[id]            =    str_to_num(szScrollExp);
        
userScrollNugget[id]            =    str_to_num(szScrollNugget);
        
userBoostMine[id]            =    str_to_num(szBoostMine);
        
        
userMute[id]                 =    str_to_num(szMute);
        
        
userHelpPoint[id]            =    str_to_num(szHelpPointAdmin);
        
        
userSecretPoint[id]            =    str_to_num(szPointSecret);
    
        
userLastAwardGot[id]            =    str_to_num(szLastAwardGot);
        
userLastAwardFree[id]            =    str_to_num(szLastAwardFree);
        
userLastAwardRow[id]             =    str_to_num(szLastAwardRow);
        
        
userChristmasStart[id]             =    str_to_num(szChristmasStart);
        
userChristmasMission[id]         =    str_to_num(szChristmasMission);
        
userChristmasType[id]             =    str_to_num(szChristmasType);
        
        for(new 
04++) userHat[id][i]    =    str_to_num(szHat[i]);
        
        
userSelectHat[id]             =    str_to_num(szSelectHat[0]);
        
userSelectNewHat[id]             =    str_to_num(szSelectHat[1]);
        
        if(
userSelectHat[id] == || userSelectNewHat[id] == 0){
            
userSelectHat[id] = -1;
            
userSelectNewHat[id] = -1;
        }
        
        
userLoadVault[id]            =     true;
        
    }else{

        
userNuggetAll[id]        =    0;
        
timeVip[id]             =     0;
        
timeSVip[id]             =     0;
        
userLuzCoin[id]            =     0;
        
userClassHuman[id]        =    0;
        
userNewClassHuman[id]        =    0;
        
userNewClass[id]        =    0;
        
userClass[id]            =    0;
        
userGiveClassExp[id]        =    0;
        
userHuman[id]             =     0;
        
        for(new 
sizeof(userHuman[]); ++ ){
            if(
str_to_num(classesHuman[human_FREE][2]) == )
                
userHuman[id] |= (1<<i);
        }

        for(new 
sizeof(userMission[]); ++ ) userMission[id][i] = 0;
        for(new 
sizeof(userMissionSecret[]); ++ ) userMissionSecret[id][i] = 0;
        for(new 
sizeof(userPro[]); ++ ) userPro[id][i] = 0;
            
        
userProSelected[id]        =    -1;    
    
        
userLastDay[id]             =    day;
        
        
userHud[id][PLAYER_HUD_RED]    =     255;//120;
        
userHud[id][PLAYER_HUD_GREEN]     =     0;//255;
        
userHud[id][PLAYER_HUD_BLUE]     =     60;
        
userJetpackSpeed[id]        =     500;
        
userMoverBlockColor[id]        =    0;
        
        
        
userLastStaminaTime[id]         =     playedTime(id);
        
userStaminaDayRefresh[id]    =     day;
        
userMinePayGoblin[id]        =    true;
        
        for(new 
sizeof(userUpgradeMine[]); ++ ) userUpgradeMine[id][i] = 0;
        for(new 
sizeof(userDigging[]); ++ ) userDigging[id][i] = 0;
                
        
userTypeMine[id]        =    0;
        
userMineNugget[id]        =    0;
        
        
        
userLastUpgradeTime[id]        =    0;
        
unlockCave[id]            =    0;
        
startUpgrade[id]        =    0;
        
        
userLastAwardTime[id]        =    playedTime(id);
        
        
addOption(userSaveOption[id], save_MODELS);
        
addOption(userSaveOption[id], save_CAVE);
        
        
userAllAward[id]        =    0;
        
userAllDmg[id]            =    0;
        
        
userFov[id]            =    90;
        
        
userScrollExp[id]        =    playedTime(id);
        
userScrollNugget[id]        =    playedTime(id);
        
userBoostMine[id]        =    playedTime(id);
        
        
userMute[id]             =     0;
        
        
userHelpPoint[id]        =    0;
        
        
userSecretPoint[id] = 0;
            
        
userLastAwardGot[id]        =    playedTime(id);
        
userLastAwardFree[id]        =    get_systime();
        
userLastAwardRow[id]         =    0;
        
userLoadVault[id]        =     true;
        
        
userChristmasStart[id]         =    0;
        
userChristmasMission[id]     =    0;
        
userChristmasType[id]         =    0;
        
        for(new 
04++) userHat[id][i]    =    0;
        
        
userSelectHat[id]         =    -1;
        
userSelectNewHat[id]         =    -1;

    }
    
    return 
PLUGIN_CONTINUE;
}
public 
fVaultSave(id){

    if(!
userLoadVault[id]) return PLUGIN_CONTINUE;
    
    new 
szData[756];

    new 
iLen 0;

    new 
szMission[mission_TOTAL*7];
    for(new 
0mission_TOTAL++)        iLen += format(szMission[iLen], sizeof(szMission)-iLen-1"%d%s"userMission[id][i], == mission_TOTAL-1?"":"_");
    
    
iLen 0;
    new 
szMissionSecret[mission_secret_TOTAL*7];
    for(new 
0mission_secret_TOTAL++)    iLen += format(szMissionSecret[iLen], sizeof(szMissionSecret)-iLen-1"%d%s"userMissionSecret[id][i], == mission_secret_TOTAL-1?"":"_");
    
    
iLen=0;
    new 
szPro[TOTAL_PRO*7];
    for(new 
0TOTAL_PRO++)            iLen += format(szPro[iLen], sizeof(szPro)-iLen-1"%d%s"userPro[id][i], == TOTAL_PRO-1?"":"_");

    
iLen=0;
    new 
szUpgradeMine[up_TOTAL*7];
    for(new 
0up_TOTAL++)            iLen += format(szUpgradeMine[iLen], sizeof(szUpgradeMine)-iLen-1"%d%s",  userUpgradeMine[id][i], == up_TOTAL-1?"":"_");
    
    
iLen=0;
    new 
szDigging[mine_TOTAL*7];
    for(new 
0mine_TOTAL++)        iLen += format(szDigging[iLen], sizeof(szDigging)-iLen-1"%d%s"userDigging[id][i], == mine_TOTAL-1?"":"_");

    
    
format(szDatasizeof(szData)-1,"%d %d %d %d %d %d %s %s %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d"
        
userLuzCoin[id],
        
timeVip[id],
        
timeSVip[id],
        
userSaveOption[id],
        
userNuggetAll[id],
        
userHuman[id],
        
szMission,
        
szMissionSecret,
        
szPro,
        
userProSelected[id],
        
userClassHuman[id],
        
userNewClassHuman[id],
        
userNewClass[id],
        
userClass[id],
        
userGiveClassExp[id],
        
userLastDay[id],
        
userHud[id][PLAYER_HUD_RED],
        
userHud[id][PLAYER_HUD_GREEN],
        
userHud[id][PLAYER_HUD_BLUE],
        
userJetpackSpeed[id],
        
userMoverBlockColor[id],
        
userLastStaminaTime[id],
        
userStaminaDayRefresh[id],
        
szUpgradeMine,
        
szDigging,
        
userTypeMine[id],
        
userMineNugget[id],
        
userMinePayGoblin[id],
        
userLastUpgradeTime[id],
        
unlockCave[id],
        
startUpgrade[id],
        
userLastAwardTime[id],
        
userAllAward[id],
        
userAllDmg[id],
        
userFov[id],
        
userScrollExp[id],
        
userScrollNugget[id],
        
userBoostMine[id],
        
userMute[id],
        
userMaxHelp[id],
        
userDayHelp[id],
        
userHelpPoint[id],
        
userSecretPoint[id],
        
userLastAwardGot[id],
        
userLastAwardFree[id],
        
userLastAwardRow[id],
        
userChristmasStart[id],
        
userChristmasMission[id],
        
userChristmasType[id],
        
userHat[id][0],
        
userHat[id][1],
        
userHat[id][2],
        
userHat[id][3],
        
userSelectHat[id],
        
userSelectNewHat[id]

        
    );
    
fvault_set_data(fVAULTFILEuserName[id], szData);
    
    
userLoadVault[id]    = false;
    
    return 
PLUGIN_CONTINUE;
}
stock explode(const string[],const character,output[][],const maxs,const maxlen){
    new 
iDo 0len strlen(string), oLen 0;
    do{
        
oLen += (1+copyc(output[iDo++],maxlen,string[oLen],character));
    }while(
oLen len && iDo maxs);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/ 
__________________
amirwolf is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-23-2023 , 17:22   Re: Remove the registration system
Reply With Quote #4

Since you seem to know exactly what part of the code is needed, perhaps you can make the simple change yourself. Not sure why you think the plugin is big, I highly doubt attaching the file is being prevented by its size.

I'm not even going to begin trying to read the code without the entire plugin. You can simply find whatever the plugin does to indicate that a person is logged in and make that permanent and disable/delete whatever initiates the query to log in. Granted, it might not be that simple but I can't tell since I haven't seen the plugin.
__________________

Last edited by fysiks; 09-23-2023 at 17:23.
fysiks is online now
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-23-2023 , 18:36   Re: Remove the registration system
Reply With Quote #5

I did not try to remove it myself
Maybe it's from my own tabli
Anyway, I will try
Thanks
__________________
amirwolf is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 09-23-2023 , 23:28   Re: Remove the registration system
Reply With Quote #6

try this
Code:
// if( strlen(szPassword) > 1 ){            copy( userPassword[id], sizeof(userPassword[])-1, szPassword);         //  new szSavedIP[MAXBITIP], szSavedSID[MAXBITAUTHID]; //  get_user_ip(id, szSavedIP, sizeof(szSavedIP)-1, 1); //  get_user_authid(id, szSavedSID, sizeof(szSavedSID)-1);     //  if( equal(szSavedIP, szIp ) && equal(szSavedSID, szSid ) ){            userLogged[id]=true; //   chatPrint(id, PREFIX_NORMAL, "Zostales zalogowany automatycznie!"); //  }else{ //   userLogged[id]=false;                                //  } // }else{ //  userLogged[id]=false; // }
__________________

Last edited by bigdaddy424; 09-23-2023 at 23:29. Reason: line 349-365
bigdaddy424 is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-24-2023 , 06:40   Re: Remove the registration system
Reply With Quote #7

Thank you
It works now

But if the initial registration could be removed, it would work better
__________________
amirwolf is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode