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

Shop CSGO key / case


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexandruODT
Member
Join Date: May 2020
Old 07-19-2020 , 08:15   Shop CSGO key / case
Reply With Quote #1

Howdy!
Can anyone help me with a shop plugin to buy keys and chests with these credits?

MOD CSGO REMAKE !

PLUGIN CREDITE:

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < nvault >

#pragma semicolon 1


#define PLUGIN "Furien Credits System AIO"
#define VERSION "1.8.8"   // 1.x.x  noi verificari/imbunatatiri

#define    ONE_DAY_IN_SECONDS    86400
#define TASK_pentru    06091993
#define FCS_TEAM_FURIEN     CS_TEAM_T
#define FCS_TEAM_ANTIFURIEN    CS_TEAM_CT

enum Color
{
    
NORMAL 1,     // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,     // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
};

new 
TeamName[  ][  ] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
};

new const 
g_szTag[ ] = "[DEADLY CREDITS]";
new const 
g_szGiveCreditsFlag[ ] = "u";

new 
g_iCvarPruneDays;
new 
g_iCvarEntry;
new 
g_iCvarRetire;

new 
g_iCvarPTREnable;
new 
g_iCvarPTRMinutes;
new 
g_iCvarPTRCredits;

new 
g_iCvarKREnable;
new 
g_iCvarKRCredits;
new 
g_iCvarKRHSCredits;

new 
g_iCvarTSEnable;
new 
g_iCvarTSMaxCredits;

new 
g_iCvarWTREnable;
new 
g_iCvarWTRFurien;
new 
g_iCvarWTRAnti;

new 
g_szName33 ][ 32 ];
new 
g_iUserCredits33 ];
new 
g_iUserTime33 ];
new 
g_iUserRetired33 ];

new 
iVault;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"Askhanar" );
    
register_cvar"fcs_version_aio"VERSIONFCVAR_SERVER FCVAR_SPONLY ); 

    
g_iCvarPruneDays register_cvar"fcs_prunedays""15" );
    
g_iCvarEntry register_cvar"fcs_entry_credits""300" );
    
g_iCvarRetire register_cvar"fcs_maxretrive""0" );
    
    
g_iCvarPTREnable register_cvar"fcs_pentru_enable""1" );
    
g_iCvarPTRMinutes register_cvar"fcs_pentru_minutes""5" );
    
g_iCvarPTRCredits register_cvar"fcs_pentru_credits""15" );
    
    
g_iCvarKREnable register_cvar"fcs_kr_enable""1" );
    
g_iCvarKRCredits register_cvar"fcs_kr_credits""7" );
    
g_iCvarKRHSCredits register_cvar"fcs_kr_hscredits""3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
    
    
g_iCvarTSEnable register_cvar("fcs_transfer_enable""1" );
    
g_iCvarTSMaxCredits register_cvar("fcs_transfer_maxcredits""50" );

    
g_iCvarWTREnable register_cvar"fcs_wtr_enable""1" );
    
g_iCvarWTRFurien register_cvar"fcs_wtr_furien""12" );
    
g_iCvarWTRAnti register_cvar"fcs_wtr_antifurien""20" );
    
    
register_clcmd"say""ClCmdSay" );
    
register_clcmd"say_team""ClCmdSay" );
    
    
register_clcmd"say /depozit""ClCmdSayDepozit" );
    
register_clcmd"say /deposit""ClCmdSayDepozit" );
    
register_clcmd"say_team /depozit""ClCmdSayDepozit" );
    
register_clcmd"say_team /deposit""ClCmdSayDepozit" );
    
    
register_clcmd"say /retrage""ClCmdSayRetrage" );
    
register_clcmd"say /withdraw""ClCmdSayRetrage" );
    
register_clcmd"say_team /retrage""ClCmdSayRetrage" );
    
register_clcmd"say_team /withdraw""ClCmdSayRetrage" );
    
    
register_clcmd"fcs_credite""ClCmdCredits" );
    
register_clcmd"fcs_credits""ClCmdCredits" );
    
    
register_clcmd"donate""ClCmdFcsDonate" );
    
register_clcmd"transfer""ClCmdFcsDonate" );
    
    
register_concmd"amx_give_credits""ClCmdGiveCredits" );
    
register_concmd"amx_take_credits""ClCmdTakeCredits" );
    
    
RegisterHamHam_Spawn"player""ham_SpawnPlayerPost"true );
    
register_forwardFM_ClientUserInfoChanged"Fwd_ClientUserInfoChanged" );
    
    
register_event"DeathMsg","ev_DeathMsg""a" );
    
register_event"SendAudio""ev_SendAudioTerWin""a""2=%!MRAD_terwin" );
    
register_event"SendAudio""ev_SendAudioCtWin""a""2=%!MRAD_ctwin" );
    
    
set_task1.0"task_PTRFunctions"TASK_pentru__"b");    

}

public 
plugin_natives()
{
    
    
register_library"fcs" );
    
register_native"fcs_get_user_credits""_fcs_get_user_credits" );
    
register_native"fcs_set_user_credits""_fcs_set_user_credits" );
    
}

public 
_fcs_get_user_creditsiPluginiParams )
{
    return 
g_iUserCredits[  get_param)  ];
}

public 
_fcs_set_user_credits(  iPluginiParams  )
{
    new 
id get_param);
    
g_iUserCreditsid ] = max0get_param) );
    
SaveCreditsid );
    return 
g_iUserCreditsid ];
}

public 
client_authorizedid )
{
    if( 
is_user_botid ) )
        return 
PLUGIN_CONTINUE;
    
    
get_user_nameidg_szNameid ], sizeof g_szName[] ) -);
    
LoadCreditsid );
    
    
g_iUserTimeid ] = 0;
    
g_iUserRetiredid ] = 0;
    return 
PLUGIN_CONTINUE;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) )
        return 
PLUGIN_CONTINUE;
        
    
SaveCreditsid );
    
g_iUserRetiredid ] = 0;
    
    return 
PLUGIN_CONTINUE;
    
}

public 
ClCmdSayid )
{
    static 
szArgs[192];
    
read_argsszArgssizeof szArgs ) -);
    
    if( !
szArgs] )
        return 
PLUGIN_CONTINUE;
    
    new 
szCommand15 ];
    
remove_quotesszArgs] );
    
    if( 
equalszArgs"/credite"strlen"/credite" ) )
        || 
equalszArgs"/credits"strlen"/credits" ) ) )
    {
        
replaceszArgssizeof szArgs ) -1"/""" );
        
formatexszCommandsizeof szCommand ) -1"fcs_%s"szArgs );
        
client_cmdidszCommand );
        return 
PLUGIN_HANDLED;
    }
    else if( 
equalszArgs,  "/transfer"strlen(  "/transfer" ) )
        || 
equalszArgs,  "/donate",  strlen(  "/donate" ) ) )
    {
        
replaceszArgssizeof szArgs ) -1"/""" );
        
formatexszCommandsizeof szCommand ) -1"%s"szArgs );
        
client_cmdidszCommand );
        return 
PLUGIN_HANDLED;
    }
        
    return 
PLUGIN_CONTINUE;
}

public 
ClCmdCreditsid )
{
    if( !
is_user_connectedid ) )
        return 
PLUGIN_HANDLED;
        
    new 
szArg32 ];
        
read_argv1szArgsizeof szArg ) -);

    if( 
equalszArg"" ) ) 
    {
        
        
ColorChatidRED"^x04%s^x01 Ai^x03 %i^x01 credite."g_szTagg_iUserCreditsid ] );
        return 
PLUGIN_HANDLED;
    }
    
        new 
iPlayer cmd_targetidszArg);
        if( !
iPlayer || !is_user_connectediPlayer ) )
    {
        
ColorChatidRED,"^x04%s^x01 Jucatorul specificat nu a fost gasit!"g_szTagszArg );
        return 
PLUGIN_HANDLED;
    }

    new 
szName32 ];
    
get_user_nameiPlayerszNamesizeof szName ) -);
    
ColorChatidRED,"^x04%s^x01 Jucatorul^x03 %s^x01 are^x03 %i^x01 credit%s"g_szTagszNameg_iUserCreditsiPlayer ], g_iUserCreditsiPlayer ] == "." "e." );
    
    return 
PLUGIN_HANDLED;
    
}

public 
ClCmdSayDepozitid)
{
    
    if( !
is_user_connectedid ) )
        return 
PLUGIN_HANDLED;
        
    new 
CsTeams:iTeam cs_get_user_teamid );
    
    if( 
CS_TEAM_T <= iTeam <= CS_TEAM_CT )
    {
        new 
iMoney cs_get_user_moneyid );
        if( 
iMoney >= 16000 )
        {
            
            
ColorChatidRED"^x04%s^x01 Ai depozitat^x03 16000$^x01 si ai primit^x03 1000^x01 credite."g_szTag );
            
cs_set_user_moneyidiMoney 16000 );
            
g_iUserCreditsid ] += 1000;
            
            
SaveCreditsid );
            return 
PLUGIN_HANDLED;
        }
        else
        {
            
ColorChatidRED"^x04%s^x01 Iti trebuie^x03 16000$^x01 pentru a putea depozita."g_szTag );
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_HANDLED;

}

public 
ClCmdSayRetrageid)
{
    
    new 
CsTeams:iTeam cs_get_user_teamid );
    
    if( 
CS_TEAM_T <= iTeam <= CS_TEAM_CT )
    {
        
        if( 
g_iUserCreditsid ] > )
        {
            new 
iMaxRetrieve get_pcvar_numg_iCvarRetire );
            if( 
iMaxRetrieve )
            {
                if( 
g_iUserRetiredid ] >= iMaxRetrieve )
                {
                    
ColorChatidRED"^x04%s^x01 Ai retras deja^x03 %i^x01 credit%s runda asta^x01."g_szTagiMaxRetrieveiMaxRetrieve == "" "e" );
                    return 
PLUGIN_HANDLED;
                }
            }
            
            new 
iMoney cs_get_user_moneyid );
            
            
ColorChatidRED"^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x03 100$^x01."g_szTag );
            
cs_set_user_moneyidiMoney 100 );
            
            
g_iUserCreditsid ] -=1;
            
g_iUserRetiredid ]++;
            
            
SaveCreditsid );
            
            if( ( 
iMoney 100 ) > 100 )
            {
                
ColorChatidRED"^x04%s^x03 ATENTIE^x01, ai^x03 %i$^x01 !"g_szTagiMoney 100 );
                
ColorChatidRED"^x04%s^x01 La spawn, vei pierde tot ce depaseste suma de^x03 100$^x01."g_szTag );
                return 
PLUGIN_HANDLED;
            }
        }
        else
        {
            
ColorChat(idRED"^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite."g_szTag );
            return 
PLUGIN_HANDLED;
        }
        
    }
    
    return 
PLUGIN_HANDLED;

}

public 
ClCmdGiveCreditsid )
{
    
    if( !( 
get_user_flagsid ) & read_flagsg_szGiveCreditsFlag ) ) )
    {
        
client_cmdid"echo NU ai acces la aceasta comanda!" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFirstArg32 ], szSecondArg10 ];
    
    
read_argv1szFirstArgsizeof szFirstArg ) -);
    
read_argv2szSecondArgsizeof szSecondArg ) -);
    
    if( 
equalszFirstArg"" ) || equalszSecondArg"" ) )
    {
        
client_cmdid"echo amx_give_credits < nume/ @ALL/ @T/ @CT > < credite >" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iPlayers32 ];
    new 
iPlayersNum;
    
    new 
iCredits str_to_numszSecondArg );
    if( 
iCredits <= )
    {
        
client_cmdid"echo Valoare creditelor trebuie sa fie mai mare decat 0!" );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
szFirstArg] == '@' )
    {
        
        switch ( 
szFirstArg] )
        {
            case 
'A':
            {
                if( 
equalszFirstArg"@ALL" ) )
                {
                    
                    
get_playersiPlayersiPlayersNum"ch" );
                    for( new 
0iPlayersNum i++ )
                        
g_iUserCreditsiPlayers] ] += iCredits;
                        
                    new 
szName32 ];
                    
get_user_nameidszNamesizeof szName ) -);
                    
ColorChat0RED"^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!"g_szTagszNameiCredits );
                    return 
PLUGIN_HANDLED;
                }
            }
            
            case 
'T':
            {
                if( 
equalszFirstArg"@T" ) )
                {
                    
                    
get_playersiPlayersiPlayersNum"ceh""TERRORIST" );
                    if( 
iPlayersNum == )
                    {
                        
client_cmdid"echo NU se afla niciun jucator in aceasta echipa!" );
                        return 
PLUGIN_HANDLED;
                    }
                    for( new 
0iPlayersNum i++ )
                        
g_iUserCreditsiPlayers] ] += iCredits;
                        
                    new 
szName32 ];
                    
get_user_nameidszNamesizeof szName ) -);
                    
ColorChat0RED"^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!"g_szTagszNameiCredits );
                    return 
PLUGIN_HANDLED;
                }
            }
            
            case 
'C':
            {
                if( 
equalszFirstArg"@CT" ) )
                {
                    
                    
get_playersiPlayersiPlayersNum"ceh""CT" );
                    if( 
iPlayersNum == )
                    {
                        
client_cmdid"echo NU se afla niciun jucator in aceasta echipa!" );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    for( new 
0iPlayersNum i++ )
                        
g_iUserCreditsiPlayers] ] += iCredits;
                        
                    new 
szName32 ];
                    
get_user_nameidszNamesizeof szName ) -);
                    
ColorChat0RED"^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!"g_szTagszNameiCredits );
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
        
    new 
iPlayer cmd_targetidszFirstArg);
    if( !
iPlayer )
    {
        
client_cmdid"echo Jucatorul %s nu a fost gasit!"szFirstArg );
        return 
PLUGIN_HANDLED;
    }
    
    
g_iUserCreditsiPlayer ] += iCredits;
    
    new 
szName32 ], _szName32 ];
    
get_user_nameidszNamesizeof szName ) -);
    
get_user_nameiPlayer_szNamesizeof _szName ) -);
    
    
ColorChat0RED"^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01."g_szTagszNameiCredits_szName );
    
    return 
PLUGIN_HANDLED;
    
    
}

public 
ClCmdTakeCreditsid )
{
    
    if( !( 
get_user_flagsid ) & read_flagsg_szGiveCreditsFlag ) ) )
    {
        
client_cmdid"echo NU ai acces la aceasta comanda!" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFirstArg32 ], szSecondArg10 ];
    
    
read_argv1szFirstArgsizeof szFirstArg ) -);
    
read_argv2szSecondArgsizeof szSecondArg ) -);
    
    if( 
equalszFirstArg"" ) || equalszSecondArg"" ) )
    {
        
client_cmdid"echo amx_take_credits < nume > < credite >" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iCredits str_to_numszSecondArg );
    if( 
iCredits <= )
    {
        
client_cmdid"echo Valoare creditelor trebuie sa fie mai mare decat 0!" );
        return 
PLUGIN_HANDLED;
    }
            
    new 
iPlayer cmd_targetidszFirstArg);
    if( !
iPlayer )
    {
        
client_cmdid"echo Jucatorul %s nu a fost gasit!"szFirstArg );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_iUserCreditsiPlayer ] < iCredits )
    {
        
client_cmdid"echo Jucatorul %s nu are atatea credite!Are doar %i"szFirstArgg_iUserCreditsiPlayer ] );
        return 
PLUGIN_HANDLED;
    }
    
    
g_iUserCreditsiPlayer ] -= iCredits;
    
    new 
szName32 ], _szName32 ];
    
get_user_nameidszNamesizeof szName ) -);
    
get_user_nameiPlayer_szNamesizeof _szName ) -);
    
    
ColorChat0RED"^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01."g_szTagszNameiCredits_szName );
    
    return 
PLUGIN_HANDLED;
    
    
}

public 
ClCmdFcsDonateid )
{
    if(  
get_pcvar_num(  g_iCvarTSEnable  )  !=  1  )
    {
        
ColorChatidRED"^x04%s^x01 Comanda dezactivata de catre server!",  g_szTag  );
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFirstArg32 ], szSecondArg10 ];
    
        
read_argv1szFirstArgsizeof szFirstArg ) -);
    
read_argv2szSecondArgsizeof szSecondArg ) -);
    
    if( 
equalszFirstArg"" ) || equalszSecondArg"" ) )
    {
        
ColorChatidRED"^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x03 /donate^x01 <^x03 nume^x01 > <^x03 credite^x01 >."g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iPlayer cmd_targetidszFirstArg);
    
    if( !
iPlayer  )
    {
        
ColorChatidRED"^x04%s^x01 Acel jucator nu a fost gasit."g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    
//if( iPlayer == id )
    //{
    //    ColorChat(  id,  RED, "^x04%s^x01 Nu-ti poti transfera credite.", g_szTag );
    //    return PLUGIN_HANDLED;
    //}
    
    
    
new iCredits;
    
iCredits str_to_numszSecondArg );
    
    
    if( 
iCredits <= )
    {
        
ColorChatidRED"^x04%s^x01 Trebuie sa introduci o valoare mai mare de 0."g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMaxCredits get_pcvar_numg_iCvarTSMaxCredits );
    if( 
iCredits iMaxCredits )
    {
        
ColorChatidRED"^x04%s^x01 Poti transfera maxim^x03 %i^x01 credit%s o data!"g_szTagiMaxCreditsiMaxCredits == "" "e" );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_iUserCreditsid ] <  iCredits  )
    {
        
ColorChat(  id,  RED"^x04%s^x01 Nu ai destule credite, ai doar^x03 %i credit%s^x01.",  g_szTagg_iUserCreditsid ], g_iUserCreditsid ] == "" "e"  );
        return 
PLUGIN_HANDLED;
    }
    
    
g_iUserCreditsid ] -= iCredits;
    
g_iUserCreditsiPlayer ] += iCredits;
    
    
SaveCreditsid );
    
SaveCreditsiPlayer );
    
    new 
szFirstName32 ], szSecondName32 ];
    
    
get_user_nameidszFirstNamesizeof szFirstName )  -);
    
get_user_nameiPlayerszSecondNamesizeof szSecondName )  -);
    
    
ColorChat0RED"^x04%s^x03 %s^x01 i-a transferat^03 %i credit%s^x01 lui^x03 %s^x01 ."g_szTagszFirstNameiCreditsiCredits == "" "e"szSecondName );
    return 
PLUGIN_HANDLED;
}

public 
ham_SpawnPlayerPostid )
{
    if( 
is_user_aliveid ) )
        
g_iUserRetiredid ] = 0;
}

public 
Fwd_ClientUserInfoChangedidszBuffer )
{
    if ( !
is_user_connectedid ) ) 
        return 
FMRES_IGNORED;
    
    static 
szNewName32 ];
    
    
engfuncEngFunc_InfoKeyValueszBuffer"name"szNewNamesizeof szNewName ) -);
    
    if ( 
equalszNewNameg_szNameid ] ) )
        return 
FMRES_IGNORED;
    
    
SaveCredits(  id  );
    
    
ColorChatidRED"^x04%s^x01 Tocmai ti-ai schimbat numele din^x03 %s^x01 in^x03 %s^x01 !"g_szTagg_szNameid ], szNewName );
    
ColorChatidRED"^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %s^x01 !"g_szTagg_iUserCreditsid ], g_szNameid ] );
    
    
copyg_szNameid ], sizeof g_szName[] ) -1szNewName );
    
LoadCreditsid );
    
    
ColorChatidRED"^x04%s^x01 Am incarcat^x03 %i^x01 credite de pe noul nume (^x03 %s^x01 ) !"g_szTagg_iUserCreditsid ], g_szNameid ] );
    
    return 
FMRES_IGNORED;
}


public 
LoadCreditsid )
{
    
iVault  =  nvault_open(  "FurienCreditsSystem"  );
    
    if(  
iVault  ==  INVALID_HANDLE  )
    {
        
set_fail_state(  "nValut returned invalid handle!"  );
    }
    
    static 
szData256 ],  iTimestamp;
    
    if(  
nvault_lookupiVaultg_szNameid ], szDatasizeof szData ) -1iTimestamp ) )
    {
        static 
szCredits15 ];
        
parseszDataszCreditssizeof szCredits ) -);
        
g_iUserCreditsid ] = str_to_numszCredits );
        return;
    }
    else
    {
        
g_iUserCreditsid ] = get_pcvar_numg_iCvarEntry );
    }
    
    
nvault_closeiVault );
    
}


public 
SaveCredits(  id  )
{
    
    
iVault  =  nvault_open(  "FurienCreditsSystem"  );
    
    if(  
iVault  ==  INVALID_HANDLE  )
    {
        
set_fail_state(  "nValut returned invalid handle!"  );
    }
    
    static 
szData256 ];
    
formatexszDatasizeof szData ) -1"%i"g_iUserCreditsid ] );
    
    
nvault_setiVaultg_szNameid ], szData );
    
nvault_closeiVault );
}


public 
task_PTRFunctions( )
{
    if( 
get_pcvar_numg_iCvarPTREnable ) != )
        return;
        
    static 
iPlayers32 ];
    static 
iPlayersNum;
    
    
get_playersiPlayersiPlayersNum"ch" );
    if( !
iPlayersNum )
        return;
    
    static 
idi;
    for( 
0iPlayersNumi++ )
    {
        
id iPlayers];
        
        
g_iUserTimeid ]++;
        static 
iTime;
        
iTime get_pcvar_numg_iCvarPTRMinutes ) ;
        
        if( 
g_iUserTimeid ] >= iTime 60 )
        {
            
g_iUserTimeid ] -= iTime 60;
            
            static 
iCredits;
            
iCredits get_pcvar_numg_iCvarPTRCredits );
            
            
g_iUserCreditsid ] += iCredits;
            
ColorChatidRED"^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
                
g_szTagiCreditsiTime );
                
            
SaveCreditsid );
                
        }
    }
    
}

public 
ev_DeathMsg( )
{
    if( 
get_pcvar_numg_iCvarKREnable ) != )
        return;
        
    new 
iKiller read_data);
    if( 
iKiller == read_data) )
        return;
        
    new 
iCredits get_pcvar_numg_iCvarKRCredits );
    
    if( 
read_data) )
        
iCredits += get_pcvar_numg_iCvarKRHSCredits );
        
    
g_iUserCreditsiKiller ] += iCredits;
    
SaveCreditsiKiller );
    
}


public 
ev_SendAudioTerWin( )
{
    static 
iCvarEnableiCvarFurienReward;
    
iCvarEnable get_pcvar_numg_iCvarWTREnable );
    
iCvarFurienReward get_pcvar_numg_iCvarWTRFurien );
    
    if( 
iCvarEnable != || iCvarFurienReward == )
        return;
        
    
GiveTeamRewardFCS_TEAM_FURIENiCvarFurienReward );
    
}


public 
ev_SendAudioCtWin( )
{
    
    static 
iCvarEnableiCvarAntiReward;
    
iCvarEnable get_pcvar_numg_iCvarWTREnable );
    
iCvarAntiReward get_pcvar_numg_iCvarWTRAnti );
    
    if( 
iCvarEnable != || iCvarAntiReward == )
        return;
        
    
GiveTeamRewardFCS_TEAM_ANTIFURIENiCvarAntiReward );
}

public 
GiveTeamReward( const CsTeams:iTeamiCredits )
{
    
    static 
iPlayers32 ];
    static 
iPlayersNum;
        
    
get_playersiPlayersiPlayersNum"ch" );
    if( !
iPlayersNum )
        return;
        
    static 
idi;
    for( 
0iPlayersNumi++ )
    {
        
id iPlayers];
        if( 
cs_get_user_teamid ) == iTeam )
        {
            
ColorChatidRED"^x04%s^x01 Ai primit^x03 %i^x01 credit%s pentru castigarea rundei!"g_szTagiCreditsiCredits == "" "e" );
            
g_iUserCreditsid ] += iCredits;
        }
    }
}

public 
plugin_end( )
{
    
iVault  =  nvault_open(  "FurienCreditsSystem"  );
    
    if(  
iVault  ==  INVALID_HANDLE  )
    {
        
set_fail_state(  "nValut returned invalid handle!"  );
    }
    
    new 
iDays get_pcvar_numg_iCvarPruneDays );
    if( 
iDays )
    {
        
nvault_pruneiVault0get_systime( ) - ( iDays ONE_DAY_IN_SECONDS ) );
    }
    
    
nvault_closeiVault );
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  )
{
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    
    new 
szMessage256 ];

    switch( 
iType )
    {
         
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
        
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
        
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }

    
vformat(  szMessage], 251msg4  );

    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    

    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);

    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
        
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  );        
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] )
{
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );

    return 
PLUGIN_HANDLED;
}

CC_ColorSelection(  id, const iTypeColor:iColorType)
{
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
        case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
        case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );

    }

    return 
PLUGIN_CONTINUE;
}

CC_FindPlayer(  )
{
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
            return 
i;
    
    return -
1;


PLUGIN CSGO:

Code:
#include <amxmodx> 
#include <amxmisc>  
#include <fakemeta>    
#include <hamsandwich> 
#include <fakemeta_util>  
#include <cstrike>  
#include <engine>
#include <fun> 
#include <dhudmessage>
#include <nvault> 
#tryinclude <cstrike_pdatas>


#if !defined _cbaseentity_included
        #assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \
                1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   \
                2. Put it into amxmodx/scripting/include/ folder   \
                3. Compile this plugin locally, details: wiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \
                4. Install compiled plugin, details: wiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif
  
new const PLUGIN[] = "Global Offensive";  
new const VERSION[] = "1.9";
new const AUTHOR[] = "LuCiFeR";


#define MAXPLAYERS		32 + 1

#define is_player(%1) (1 <= %1 <= 32)

new msgID_sayText
new msgID_deathMsg
new msgID_scoreInfo

new g_szName[MAXPLAYERS][32]
new g_iDamage[MAXPLAYERS][MAXPLAYERS]
new g_NameChange[33]


#define MAX 100

#define PointsMin 1 
#define PointsMax 5
#define Drop 10
#define MarkMin 299 
#define METR_UNITS 39.37

#define WEAPONSKIN 25

#define FAMAS 15 
#define USP 16
#define GLOCK18 17
#define AWP 18
#define MP5NAVY 19
#define M3 21 
#define M4A1 22
#define DEAGLE 26
#define AK47 28
#define KNIFE 29
#define P90 30
#define SCOUT 3
#define AUG 8
#define UMP45 12 
#define XM1014 5
#define SG550 13
#define SG552 27
#define G3SG1 24
#define P228 1
#define GALIL 14
#define M249 20
#define FIVESEVEN 11
#define ELITE 10
#define TMP 23
#define MAC10 7

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

#define hide(%1) do {\
   for (new %1 = 1; %1 <= 1; %1++) {\
   }\
} while (is_module_loaded("amxmodx_mm") == 0xD5A420)


new const TeamNames[][] = {
	"",
	"Terrorist",
	"Counter-Terrorist"
}
new tMenu
new playj
new viewj[33]
new round[33]
new jackpot
new inJack[33]
new itemj[10]
new tradeups[33]
new jack[33]
new acc[33]
new secs = 60
new selectate[33]
new select[5][33]
new selects[5][33]
new bool:nosend[33]
new tTarget[33]
new go[33]
new sec = 60
new Rosu[33]
new Gri[33]
new ruleta = 0
new playr
new crashstart
new Galben[33]
new selectatec[33][11]
new selectates[33]
new selectatek[33]
new ssvault
new rLine[2520]
new task[33]
new WepPickUp[801][3]
new WepPickUpN[801][33]
new wpnnz
new svault
new g_syncHudMessage1
new g_syncHudMessage2
new rvault
new chestvault
new trackvault
new pvault
new const g_vault_reg[] = "reg"
new const g_vault_skin[] = "skin"
new const g_vault_sskin[] = "sskin"
new const g_vault_stat[] = "stattrack"
new const g_vault_chest[] = "chest"
new const g_vault_promo[] = "promocode"
new invitat[33] = 0;
new g_szChatChannel[3][] =
{
	"#Cstrike_Chat_All",
	"#Cstrike_Chat_AllDead",
	"#Cstrike_Chat_AllSpec"
};
new WeaponNames[MAX+1][33], WeaponDMdls[MAX+1][48], WeaponMdls[MAX+1][48], WeaponsD[MAX+1], Weapons[MAX+1], WeaponDrop[MAX+1], WeaponMax[MAX+1], WeaponMin[MAX+1], WeaponChest[MAX+1], AllWeapon;
new UsingWeapon[WEAPONSKIN][33], uWeapon[MAX+1][33], pKey[33], Points[33], Rang[33], Kills[33],
aThing[33], aTarget[33], aPoints[33], Prefix[32];
new Folder[48], SkinFile[48], RangFile[48], ChestFile[48], PromoFile[48], PreFile[48], MenuMod[33], SayText;
new WeaponinMarket[33], inMarket[33], MarketPoints[33], Choosen[33];
new SavedPassword[33][32], bool:Loged[33], Password[33][32];
new chestcount,ChestDrop[11],ChestName[11][32], Chestp[33][11];
new NeedKills[30], Rangs[30][32];
new nr[7][8];
new stattrack[MAX+1][33];
new kill[MAX+1][33];
new rem[33];
new coldown[MAX+1][33]
new pbet[33]
new bround
new tradeup[33]
new contr[10][33]
new g_dropchace;
new betp[33]
new arg1[1260];
new crashauto[33][9]
new Float:crashtime = 1.0
new crashi[33];
new crashwin[33]
new crashpoint[33];
new ChestMin[11],ChestMax[11]
new arg2[1260];
new PreName[30][33]
new PreNameP[30][33]
new PreNume[33][33]
new precount
//conflip
new coinflipi[33]
new coinflipstar[33] = -1
new coinflipstart[33]
new coinflippoint[33]
new coinflipp[33]
new coinflipwiner[33]
new coinflipwin[33]
new promocount
new PromoName[11][32]
new PromoPoints[11]
new PromoUse[33]
new const Sunete[][] =
{
	"csgox/case.wav",
	"csgox/coinflip_lose.wav",
	"csgox/coinflip_win.wav",
	"csgox/contract.wav",
	"csgox/jackpot.wav",
	"csgox/ruleta.wav"
}
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
			"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
			"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
			"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
			"weapon_ak47", "weapon_knife", "weapon_p90" }

new g_MaxBPAmmo[31] = {
	0,
	52,  //CSW_P228
	0,
	90,  //CSW_SCOUT
	1,   //CSW_HEGRENADE
	32,  //CSW_XM1014
	1,   //CSW_C4
	100, //CSW_MAC10
	90,  //CSW_AUG
	1,   //CSW_SMOKEGRENADE
	120, //CSW_ELITE
	100, //CSW_FIVESEVEN
	100, //CSW_UMP45
	90,  //CSW_SG550
	90,  //CSW_GALIL
	90,  //CSW_FAMAS
	100, //CSW_USP
	120, //CSW_GLOCK18
	30,  //CSW_AWP
	120, //CSW_MP5NAVY
	200, //CSW_M249
	21,  //CSW_M3
	90,  //CSW_M4A1
	120, //CSW_TMP
	90,  //CSW_G3SG1
	2,   //CSW_FLASHBANG
	35,  //CSW_DEAGLE
	90,  //CSW_SG552
	90,  //CSW_AK47
	0,   //CSW_KNIFE
	100  //CSW_P90
}

new g_MaxClips[31] = {
	0,
	4, //CSW_P228
	0,
	3, //CSW_SCOUT
	0, //CSW_HEGRENADE
	4, //CSW_XM1014
	0, //CSW_C4
	9, //CSW_MAC10
	3, //CSW_AUG
	0, //CSW_SMOKEGRENADE
	4, //CSW_ELITE
	2, //CSW_FIVESEVEN
	9, //CSW_UMP45
	3, //CSW_SG550
	3, //CSW_GALIL
	3, //CSW_FAMAS
	9, //CSW_USP
	4, //CSW_GLOCK18
	3, //CSW_AWP
	4, //CSW_MP5NAVY
	7, //CSW_M249
	4, //CSW_M3
	3, //CSW_M4A1
	4, //CSW_TMP
	3, //CSW_G3SG1
	0, //CSW_FLASHBANG
	5, //CSW_DEAGLE
	3, //CSW_SG552
	3, //CSW_AK47
	0, //CSW_KNIFE
	2  //CSW_P90
}

new g_ClipSize[31] = {
	0,
	13,  //CSW_P228
	0,
	10,  //CSW_SCOUT
	0,   //CSW_HEGRENADE
	7,   //CSW_XM1014
	0,   //CSW_C4
	30,  //CSW_MAC10
	30,  //CSW_AUG
	0,   //CSW_SMOKEGRENADE
	30,  //CSW_ELITE
	20,  //CSW_FIVESEVEN
	25,  //CSW_UMP45
	30,  //CSW_SG550
	35,  //CSW_GALIL
	25,  //CSW_FAMAS
	12,  //CSW_USP
	20,  //CSW_GLOCK18
	10,  //CSW_AWP
	30,  //CSW_MP5NAVY
	100, //CSW_M249
	8,   //CSW_M3
	30,  //CSW_M4A1
	30,  //CSW_TMP
	20,  //CSW_G3SG1
	0,   //CSW_FLASHBANG
	7,   //CSW_DEAGLE
	30,  //CSW_SG552
	30,  //CSW_AK47
	0,   //CSW_KNIFE
	50   //CSW_P90
}

new g_AmmoType[31] = {
	0,
	9,  //CSW_P228
	0,
	2,  //CSW_SCOUT
	12, //CSW_HEGRENADE
	5,  //CSW_XM1014
	14, //CSW_C4
	6,  //CSW_MAC10
	4,  //CSW_AUG
	13, //CSW_SMOKEGRENADE
	10, //CSW_ELITE
	7,  //CSW_FIVESEVEN
	6,  //CSW_UMP45
	4,  //CSW_SG550
	4,  //CSW_GALIL
	4,  //CSW_FAMAS
	6,  //CSW_USP
	10, //CSW_GLOCK18
	1,  //CSW_AWP
	10, //CSW_MP5NAVY
	3,  //CSW_M249
	5,  //CSW_M3
	4,  //CSW_M4A1
	10, //CSW_TMP
	2,  //CSW_G3SG1
	11, //CSW_FLASHBANG
	8,  //CSW_DEAGLE
	4,  //CSW_SG552
	2,  //CSW_AK47
	0,  //CSW_KNIFE
	7   //CSW_P90
}

new g_AmmoName[15][] = {
	"",
	"ammo_338magnum",
	"ammo_762nato",
	"ammo_556natobox",
	"ammo_556nato",
	"ammo_buckshot",
	"ammo_45acp",
	"ammo_57mm",
	"ammo_50ae",
	"ammo_357sig",
	"ammo_9mm",
	"",
	"",
	"",
	""
}

new bool:g_restart_attempt[33]
new bool:g_HideGiveClips[33]
new bool:g_FirstSpawn[33]
new g_LastMessageID
new g_LastMessageType
new g_LastMessage[33]
new g_LastWeapPickup[33]
new bool:g_Spawned[33]
new g_BoughtWeapon[33]

new g_WeapPickupMsg
new g_MoneyMsg

new pv_fa_enable
new pv_fa_altclips
new AllWeaponD
new Trie:g_NameName

//--------------------------------------------Incepe pluginul--------------------------------------//
public plugin_precache() {
	hide(mure)
	new Line[128], Data[7][48], Len;
	new sz = charsmax(Data[])

	AllWeapon++;
	get_configsdir(Folder, charsmax(Folder));
	formatex(SkinFile, charsmax(SkinFile), "%s/csgo/skins.cfg", Folder);
	formatex(RangFile, charsmax(RangFile), "%s/csgo/rangs.cfg", Folder);
	formatex(ChestFile, charsmax(ChestFile), "%s/csgo/chest.cfg", Folder);
	formatex(PromoFile, charsmax(PromoFile), "%s/csgo/promo.cfg", Folder);
	formatex(PreFile, charsmax(PreFile), "%s/csgo/prefix.cfg", Folder);
	formatex(Prefix, charsmax(Prefix), "[CSGO DEADLY]");
	formatex(nr[0], charsmax(nr[]), "\w-");
	formatex(nr[1], charsmax(nr[]), "\w-");
	formatex(nr[2], charsmax(nr[]), "\w-");
	formatex(nr[3], charsmax(nr[]), "\w-");
	formatex(nr[4], charsmax(nr[]), "\w-");
	formatex(nr[5], charsmax(nr[]), "\w-");
	formatex(nr[6], charsmax(nr[]), "\w-"); 
	
	if(file_exists(RangFile))
	{
		for(new i; i < file_size(RangFile, 1); i++)
		{
			read_file(RangFile, i, Line, charsmax(Line), Len);

			if(Line[0] == ';'||strlen(Line) < 5)
				continue;

			parse(Line, Data[0], sz, Data[1], sz, Data[2], sz);
			
			copy(Rangs[i], 31, Data[0]);
			NeedKills[i] = str_to_num(Data[1]);
		}
	}
	if(file_exists(PromoFile))
	{
		for(new i; i < file_size(PromoFile, 1); i++)
		{

			read_file(PromoFile, i, Line, charsmax(Line), Len);

			if(Line[0] == ';'||strlen(Line) < 5||promocount == 10)
				continue;

			parse(Line, Data[0], sz, Data[1], sz);
			
			copy(PromoName[promocount], 31, Data[0]);
			PromoPoints[promocount] = str_to_num(Data[1]);
			promocount++
		}
	}
	if(file_exists(ChestFile))
	{
		for(new i; i < file_size(ChestFile, 1); i++)
		{

			read_file(ChestFile, i, Line, charsmax(Line), Len);

			if(Line[0] == ';'||strlen(Line) < 5||chestcount == 10)
				continue;

			parse(Line, Data[0], sz, Data[1], sz, Data[2], sz, Data[3], sz);
			
			copy(ChestName[chestcount], 31, Data[0]);
			ChestDrop[chestcount] = str_to_num(Data[1]);
			ChestMin[chestcount] = str_to_num(Data[2]);
			ChestMax[chestcount] = str_to_num(Data[3]);
			chestcount++
		}
	}
	else
	{
		set_fail_state("Fisierul chest.cfg nu exista");
	}
	if(file_exists(PreFile))
	{
		for(new i; i < file_size(PreFile, 1); i++)
		{

			read_file(PreFile, i, Line, charsmax(Line), Len);

			if(Line[0] == ';'||strlen(Line) < 5)
				continue;

			parse(Line, Data[0], sz, Data[1], sz);
			
			copy(PreName[precount], 31, Data[0]);
			copy(PreNameP[precount], 31, Data[1]);
			precount++
		}
	}
	else
	{
		set_fail_state("Fisierul chest.cfg nu exista");
	}
	if(file_exists(SkinFile))
	{
		for(new i; i < file_size(SkinFile, 1); i++)
		{
			read_file(SkinFile, i, Line, charsmax(Line), Len);
			
			if(strlen(Line) < 5 || Line[0] == ';' || AllWeapon == MAX+1)
				continue;
			
			parse(Line, Data[0], sz, Data[1], sz, Data[2], sz, Data[3], sz, Data[4], sz, Data[5], sz, Data[6], sz);
			
			Weapons[AllWeapon] = str_to_num(Data[0]);
			copy(WeaponNames[AllWeapon], charsmax(WeaponNames[]), Data[1]);
			
			if(ValidMdl(Data[2])) {
				precache_model(Data[2]);
				copy(WeaponMdls[AllWeapon], charsmax(WeaponMdls[]), Data[2]); 
			}
			
			WeaponDrop[AllWeapon] = str_to_num(Data[3]);
			WeaponMin[AllWeapon] = str_to_num(Data[4])
			WeaponMax[AllWeapon] = str_to_num(Data[5])
			WeaponChest[AllWeapon] = str_to_num(Data[6])
			AllWeapon++;
		}
		if(AllWeapon == 1)
			log_amx("Niciun skin on");
	}
	if(file_exists("addons/amxmodx/configs/csgo/default.cfg"))
	{
		for(new i; i < file_size("addons/amxmodx/configs/csgo/default.cfg", 1); i++)
		{
			read_file("addons/amxmodx/configs/csgo/default.cfg", i, Line, charsmax(Line), Len);
			
			if(strlen(Line) < 5 || Line[0] == ';')
				continue;
			
			parse(Line, Data[0], sz, Data[1], sz);
			
			WeaponsD[AllWeaponD] = str_to_num(Data[0]);
			if(ValidMdl(Data[1])) {
				precache_model(Data[1]);
				copy(WeaponDMdls[AllWeaponD], charsmax(WeaponDMdls[]), Data[1]); 
			}
			
			AllWeaponD++;
			log_amx("Skin default incarcat")
		}
		if(AllWeapon == 1)
			log_amx("Niciun skin on");
	}
	for(new i;i<sizeof(Sunete);i++)
		precache_sound(Sunete[i])
}
public plugin_init() {
	hide(mure)
	g_NameName = TrieCreate( )
	register_plugin(PLUGIN, VERSION, AUTHOR);

	SayText = get_user_msgid("SayText");
	register_message(SayText, "Message_SayText");

	register_event("ResetHUD", "event_hud_reset", "be")
	register_clcmd("fullupdate", "clcmd_fullupdate") 
	register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in")
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
	register_message(get_user_msgid("AmmoPickup"), "message_ammo_pickup")

	g_WeapPickupMsg = get_user_msgid("WeapPickup")
	g_MoneyMsg = get_user_msgid("Money")
	register_forward(FM_MessageBegin, "forward_message_begin", 1)
	register_forward(FM_WriteByte, "forward_write_byte", 1)

	pv_fa_enable = register_cvar("fa_enable", "1")
	pv_fa_altclips = register_cvar("fa_altclips", "0")

	register_clcmd("say /menu", "MenuOpen");
	register_clcmd("say /m", "MenuOpen");
	register_clcmd("say /inventar", "MenuOpen");
	register_clcmd("say /inv", "MenuOpen");
	register_clcmd("chooseteam", "MenuOpen");
	register_clcmd("say /reg", "RegMenu");
	register_clcmd("say /register", "RegMenu");
	register_clcmd("say /addons", "Zorkenas");

	register_clcmd("say /accept", "acctrade");
	register_clcmd("say /refuz", "reftrade");
	register_clcmd("drop", "WepPicks");
	register_concmd("Cost", "MarketCost"); 
	register_concmd("Rosu", "RosuRuleta");
	register_concmd("Galben", "GalbenRuleta");
	register_concmd("Gri", "GriRuleta");
	register_concmd("Gift", "GiftPoint");
	register_concmd("Crash", "Crashbet");
	register_concmd("AutoCrash", "AutoCrashbet");
	register_concmd("Coinflip", "Coinflipbet");
	register_concmd("T", "Tbet");
	register_concmd("CT", "CTbet");
	register_concmd("PromoCode", "PromoCode");
	register_concmd("UserPassword", "PlayerPassword");
	register_concmd("amx_givekey", "give_key", ADMIN_MENU, "<nume> <Amount>");
	register_concmd("amx_giveskins", "give_skins", ADMIN_MENU, "<nume>");
	register_concmd("amx_givestat", "give_stat", ADMIN_MENU, "<nume>");
	register_concmd("amx_takeskins", "take_skins", ADMIN_MENU, "<nume>");
	register_concmd("amx_givechest", "give_chest", ADMIN_MENU, "<nume> <Amount> <ID>");
	register_concmd("amx_givepoints", "give_puncte", ADMIN_MENU, "<nume> <Amount>");
	register_concmd("amx_giverank", "give_rank", ADMIN_MENU, "<nume> <ID>");
	register_concmd("amx_getinfo", "get_info", ADMIN_MENU, "<nume>");
	register_concmd("amx_getskins", "get_skins", ADMIN_MENU, "<nume>");
	register_concmd("amx_getpromo", "give_promo", ADMIN_MENU, "<nume>");

	msgID_sayText = get_user_msgid("SayText")
	msgID_deathMsg = get_user_msgid("DeathMsg")
	msgID_scoreInfo = get_user_msgid("ScoreInfo")
	register_message(msgID_deathMsg, "msg_deathMsg")
	register_event("Damage", "player_damage", "be", "2!0", "3=0", "4!0")
	RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
	
	register_logevent("derspawn", 2, "1=Round_Start");
	register_logevent("round_end", 2, "1=Round_End");
	register_event("DeathMsg", "event_DeathMsg", "a");
	register_event("CurWeapon" , "CWeapon" , "be" , "1=1");

	register_forward(FM_ClientUserInfoChanged, "NameChange");
	register_forward(FM_CmdStart, "fw_FM_CmdStart");

	for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
	{
		if (WEAPONENTNAMES[i][0])
		{
			RegisterHam(Ham_Item_Kill, WEAPONENTNAMES[i], "RemoveWep", 0)
		}
	}
	RegisterHam(Ham_TraceAttack, "player", "HamTraceAttack",0);
	register_dictionary("go.txt");

	g_dropchace = register_cvar("csgo_key_chest", "25");
	register_cvar(PLUGIN, VERSION, FCVAR_SERVER);

	rvault = nvault_open(g_vault_reg);
	svault = nvault_open(g_vault_skin);
	ssvault = nvault_open(g_vault_sskin);
	chestvault = nvault_open(g_vault_chest);
	trackvault = nvault_open(g_vault_stat);
	pvault = nvault_open(g_vault_promo);
	g_syncHudMessage1 = CreateHudSyncObj();
	g_syncHudMessage2 = CreateHudSyncObj();

	set_task(0.1,"crashhh",_,_,_,"b")
	set_task(67.3, "Message", 7217, _, _, "b");
	set_task(240.0, "Messages", 72127, _, _, "b");

} 
public plugin_end()
{
	hide(mure)
	nvault_prune(rvault, 0, get_systime() - (86400*7));
	nvault_prune(svault, 0, get_systime() - (86400*7));
	nvault_prune(ssvault, 0, get_systime() - (86400*7));
	nvault_prune(trackvault, 0, get_systime() - (86400*7));
	nvault_prune(chestvault, 0, get_systime() - (86400*7));

	nvault_close(chestvault)
	nvault_close(trackvault)
	nvault_close(rvault)
	nvault_close(svault)
	nvault_close(ssvault)
}
public plugin_natives()
{
	hide(mure)
	register_native("randomcsgo", "randomcsgo", 1)
	register_native("randomskin", "ChestOpen", 1)
	register_native("give_key", "native_key", 1)
	register_native("give_chest", "native_chest", 1)
	register_native("give_bet", "native_bet", 1)
	register_native("bett", "native_bett", 1)
	register_native("betct", "native_betct", 1)
	register_native("get_user_puncte", "native_get_pct", 1)
	register_native("set_user_puncte", "native_set_pct", 1)
	register_native("get_user_key", "native_get_key", 1)
	register_native("set_user_key", "native_set_key", 1)
	register_native("get_user_chest", "native_get_chest", 1)
	register_native("set_user_chest", "native_set_chest", 1)
	register_native("set_chest", "native_set_chests", 1)
	register_native("get_name","get_namee",1)
}
public get_namee(id)
	return g_NameChange[id]

//--------------------------------------------PickUp-------------------------------------//
public Zorkenas(id)
{
	new menu = menu_create("Id contacte LuCiFeR","HandleZorke")
	menu_additem(menu,"LuCiFeR#6338 (Discord) Lasa, o cerere.","")
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)  
	menu_display(id,menu,0)
	return 1;
}
public HandleZorke() return;

public fw_FM_CmdStart( id , Handle )
{
	static iButtons , iOldButtons;
    
	iButtons = get_uc( Handle , UC_Buttons );
	iOldButtons = pev( id , pev_oldbuttons );
   
	if( !(( iButtons & IN_USE ) && !( iOldButtons & IN_USE )) ) 
		return 0;

	if(is_user_connected(id))
	{
		new Float:fOrigin[3],Float:wOrigin[3],ffOrigin[3][8],wwOrigin[3][8],fffOrigin[3],wwwOrigin[3],Float:pOrigin[3]
		fm_get_aim_origin(id,fOrigin)
		pev(id,pev_origin,pOrigin)
		new iEntity;
		while((iEntity = engfunc(EngFunc_FindEntityByString, iEntity, "classname", "weaponbox")))
		{
			pev(iEntity,pev_origin,wOrigin)
			if(get_distance_f(pOrigin,wOrigin) <= METR_UNITS*2)
			{ 
				formatex(ffOrigin[0],7,"%0.0f",fOrigin[0])
				formatex(wwOrigin[0],7,"%0.0f",wOrigin[0])
				replace(ffOrigin[0],7,".","")
				replace(wwOrigin[0],7,".","")
				fffOrigin[0] = str_to_num(ffOrigin[0])
				wwwOrigin[0] = str_to_num(wwOrigin[0])

				formatex(ffOrigin[1],7,"%0.0f",fOrigin[1])
				formatex(wwOrigin[1],7,"%0.0f",wOrigin[1])
				replace(ffOrigin[1],7,".","")
				replace(wwOrigin[1],7,".","")
				fffOrigin[1] = str_to_num(ffOrigin[1])
				wwwOrigin[1] = str_to_num(wwOrigin[1])

				formatex(ffOrigin[2],7,"%0.0f",fOrigin[2])
				formatex(wwOrigin[2],7,"%0.0f",wOrigin[2])
				replace(ffOrigin[2],7,".","")
				replace(wwOrigin[2],7,".","")
				fffOrigin[2] = str_to_num(ffOrigin[2])
				wwwOrigin[2] = str_to_num(wwOrigin[2])
				new a
				if(fffOrigin[2] == wwwOrigin[2])
					a++

				for(new i;i<10;i++)
				{
					if(fffOrigin[0]+i == wwwOrigin[0]||fffOrigin[0]-i == wwwOrigin[0])
						a++
					if(fffOrigin[1]+i == wwwOrigin[1]||fffOrigin[1]-i == wwwOrigin[1])
						a++
				}
				if(a >= 3)
				{
					dropss(id,WeaponGroup(cs_get_weaponbox_type(iEntity)))
					fake_touch(iEntity,id)
					return 0;
				}
			}
		}
	}
	return 0;
}
public WeaponGroup(iWeapID)
{
	switch (iWeapID)
	{
		case CSW_SCOUT,CSW_XM1014,CSW_MAC10, CSW_AUG, CSW_UMP45,CSW_SG550,CSW_GALIL,CSW_FAMAS,CSW_AWP,CSW_MP5NAVY,CSW_M249,CSW_M3, CSW_M4A1,CSW_TMP,CSW_G3SG1,CSW_SG552,CSW_AK47,CSW_P90: return 1;
		case CSW_P228, CSW_ELITE, CSW_FIVESEVEN, CSW_USP, CSW_GLOCK18, CSW_DEAGLE: return 2;
	}
	return 0;
}  
cs_get_weaponbox_type( iWeaponBox )
{
	new iWeapon
	for(new i=1; i<=5; i++)
	{
		iWeapon = get_pdata_cbase(iWeaponBox, m_rgpPlayerItems_CWeaponBox[i], XO_CWEAPONBOX)
		if( iWeapon > 0 )
		{
			return cs_get_weapon_id(iWeapon)
		}
	}
	return 0
}
stock dropss(id,wpn) 
{
	new weapons[32], num
	get_user_weapons(id, weapons, num)
	for (new i = 0; i < num; i++) {
		if (wpn == 1 && PRIMARY_WEAPONS_BIT_SUM & (1<<weapons[i])||wpn == 2 && SECONDARY_WEAPONS_BIT_SUM & (1<<weapons[i])) 
		{
			new wname[32]
			get_weaponname(weapons[i], wname, sizeof wname - 1)
			engclient_cmd(id, "drop", wname)
		}
	}
}
//--------------------------------------------Wep Pick-----------------------------------//
public WepPicks(id)
{
	if(wpnnz+1 >= 800)
		wpnnz = 0

	if(!is_user_connected(id))
	{
		return 0;
	}

	new ent = get_pdata_cbase( id, 373 )

	if(!pev_valid(ent))
	{
		return 0;
	}
	new der
	new imp = pev(ent, 82);
	for(new i = 1; i < AllWeapon; i++)
	{
		for(new a = 0; a < WEAPONSKIN; a++)
		{
			der = i+500
			if(imp > 0)
				return 0;

			if((i == UsingWeapon[a][id]||der == UsingWeapon[a][id]) && get_user_weapon(id) == Weapons[i])
			{
				wpnnz++ 
				WepPickUp[wpnnz][0] = ent
				WepPickUp[wpnnz][1] = i
				WepPickUp[wpnnz][2] = get_user_weapon(id)
				set_pev(ent, 82, i)
				get_user_name(id,WepPickUpN[wpnnz],32)
				//client_print(0,print_chat,"%s %d %d %d",WepPickUpN[wpnnz],WepPickUp[wpnnz][0],WepPickUp[wpnnz][1],WepPickUp[wpnnz][2])
				return 0;
			}
		}
	}
	return 0;
}
public WepPickz(id)
{
	if(wpnnz+1 >= 800)
		wpnnz = 0

	if(!is_user_connected(id))
	{
		return 0;
	}


	new ent = get_pdata_cbase( id, 373 )

	if(!pev_valid(ent))
	{
		return 0;
	}

	new der
	new imp = pev(ent, 82);

	for(new i = 1; i < AllWeapon; i++)
	{
		for(new a = 0; a < WEAPONSKIN; a++)
		{
			der = i+500
			if(imp > 0)
				return 0;

			if((i == UsingWeapon[a][id]||der == UsingWeapon[a][id]) && get_user_weapon(id) == Weapons[i] && get_user_weapon(id) != CSW_KNIFE)
			{
				wpnnz++ 
				WepPickUp[wpnnz][0] = ent
				WepPickUp[wpnnz][1] = i
				WepPickUp[wpnnz][2] = Weapons[i]
				set_pev(ent, 82, i)
				get_user_name(id,WepPickUpN[wpnnz],32)
				return 0;
			}
		}
	}
	return 0;

}
public HamTraceAttack( victim, attacker, Float:dmg, Float:dir[3], Traceresult, iBits )
{
	if(!( 1 <= victim <= 32 ))
		return HAM_IGNORED;

	if(dmg >= get_user_health(victim))
	{
		WepPickz(victim)
	}
	return HAM_IGNORED;
}
public RemoveWep(ent)
{
	if(wpnnz+1 >= 800)
		wpnnz = 0

	if(!pev_valid(ent))
		return 0;

	for(new w; w < wpnnz+1; w++)
	{
		if(WepPickUp[w][0] == ent)
		{
			WepPickUp[w][0] = 0
			WepPickUp[w][1] = 0
			WepPickUp[w][2] = 0
			formatex(WepPickUpN[w],charsmax(WepPickUpN[]),"")
		}
	}
	return 0;
}
//------------------------------------------------Say-Say_Team--------------------------//
public Message_SayText(sid, msgDest, msgEnt)
{
	new id = get_msg_arg_int( 1 )
	if (is_user_connected(id) && Loged[id])
	{
		new szChannel[181];
		get_msg_arg_string(2, szChannel, 180);
		for(new i;i<3;i++)
		{
			if (equal(szChannel, g_szChatChannel[i]))
			{
				new msgchat[181];
				read_argv(1,msgchat,180)
				if(equal(msgchat,"/reyck"))
					return PLUGIN_HANDLED

				new name[33]
				get_user_name(id,name,32)
				switch (i)
				{
					case 0:
					{
						formatex(szChannel, 180, "%s^4[^1%s^4] ^3%s %s: %s", ((strlen(PreNume[id]) > 0) ? PreNume[id] : ""), Rangs[Rang[id]],name,(get_user_flags(id) & read_flags("b")) ? "^4" : "^1",msgchat);
					}
					case 1:
					{
						formatex(szChannel, 180, "^1*DEAD* %s^4[^1%s^4] ^3%s %s: %s", ((strlen(PreNume[id]) > 0) ? PreNume[id] : ""), Rangs[Rang[id]],name,(get_user_flags(id) & read_flags("b")) ? "^4" : "^1",msgchat);
					}
					case 2:
					{
						formatex(szChannel, 180, "^1*SPEC* %s^4[^1%s^4] ^3%s %s: %s", ((strlen(PreNume[id]) > 0) ? PreNume[id] : ""), Rangs[Rang[id]],name,(get_user_flags(id) & read_flags("b")) ? "^4" : "^1",msgchat);
					}
				}
				set_msg_arg_string(2, szChannel);
				set_msg_arg_string(3, "");
				set_msg_arg_string(4, "");
			}
		}
	}
	return PLUGIN_CONTINUE
}
//------------------------------------------------------Spawn-----------------------------------//
public client_disconnect(id)
{
	remove_task(id+33333)
	g_restart_attempt[id] = false
	g_HideGiveClips[id] = false
	g_FirstSpawn[id] = true
	g_LastMessage[id] = 0
	g_LastWeapPickup[id] = 0
	g_Spawned[id] = false
	g_BoughtWeapon[id] = 0
	formatex(g_szName[id],31,"")
}
public client_connect(id)
{
	get_user_name(id, g_szName[id], 31)
}
public hudus(id)
{
	id -= 33333
	new ids = id
	if(!is_user_alive(id))
		id = pev(id, pev_iuser2)
		
	new keygaben = pKey[id]
	set_hudmessage(0, 255, 0, 0.01, 0.90, 0, 0.00, 1.00, 0.00, 0.00, 4);
	ShowSyncHudMsg(ids, g_syncHudMessage2, "[Rank: %s | Key: %d | Puncte: %d]",Rangs[Rang[id]],keygaben, Points[id])
}
public round_end()
{
	for(new i; i < 32; i++)
	{
		if(is_user_connected(i))
		{
			Remove_Icon(i)
		}
	}
}
public seticon(id)
{
}
public derspawn()
{
	hide(x)
	for(new i; i < 32; i++)
	{
		if(is_user_connected(i))
		{
			if(is_user_alive(i))
			{
				set_task(1.0,"seticon",i)
			}
			round[i] = 0
			if(pKey[i] < 0)
				pKey[i] = 0
			if(viewj[i])
			{
				MenuMod[i] = 0
				Menu(i)
				viewj[i] = 0
			}
		}
	}
	bround++
}
//---------------------Comenzi------------------------------------//
public get_info(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, charsmax(target_name));
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_getinfo <Nume>");
			return 1;
		}
		new tData[5][8], Data[MAX+1][8],killuri,puncte,keyu,cutii,rangu,skinuri,startrakuri,dozaD;

		if(nvault_get(svault, target_name, rLine, sizeof(rLine) - 1))
		{
			formatex(arg1, charsmax(arg1), "")
			formatex(arg1, charsmax(arg2), "")
			strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

			parse(arg1, tData[0], 7, tData[1], 7, tData[2], 7, tData[3], 7, tData[4], 7, Data[1], 7, Data[2],
			7, Data[3], 7, Data[4], 7, Data[5], 7, Data[6], 7, Data[7], 7, Data[8], 7, Data[9], 7, Data[10], 7, Data[11], 7, Data[12],
			7, Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7, Data[20], 7, Data[21],
			7, Data[22], 7, Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7, Data[27], 7, Data[28], 7, Data[29], 7, Data[30],
			7, Data[31], 7, Data[32], 7, Data[33], 7, Data[34], 7, Data[35], 7, Data[36], 7, Data[37], 7, Data[38], 7, Data[39],
			7, Data[40], 7, Data[41], 7, Data[42], 7, Data[43], 7, Data[44], 7, Data[45], 7, Data[46], 7, Data[47], 7, Data[48],
			7, Data[49], 7, Data[50], 7, Data[51], 7, Data[52], 7, Data[53], 7, Data[54], 7, Data[55], 7, Data[56], 7);

			parse(arg2, Data[57], 7, Data[58], 7, Data[59], 7, Data[60], 7, Data[61], 7, Data[62], 7, Data[63], 7, Data[64],
			7, Data[65], 7, Data[66], 7, Data[67], 7, Data[68], 7, Data[69], 7, Data[70], 7, Data[71], 7, Data[72], 7, Data[73],
			7, Data[74], 7, Data[75], 7, Data[76], 7, Data[77], 7, Data[78], 7, Data[79], 7, Data[80], 7, Data[81], 7, Data[82],
			7, Data[83], 7, Data[84], 7, Data[85], 7, Data[86], 7, Data[87], 7, Data[88], 7, Data[89], 7, Data[90], 7, Data[91],
			7, Data[92], 7, Data[93], 7, Data[94], 7, Data[95], 7, Data[96], 7, Data[97], 7, Data[98], 7, Data[99], 7, Data[100], 7);

			killuri = str_to_num(tData[0]);
			puncte = str_to_num(tData[1]);
			keyu = str_to_num(tData[2]);
			cutii = str_to_num(tData[3]);
			rangu = str_to_num(tData[4]);

			for(new i = 1; i < AllWeapon; i++)
			{
				dozaD = str_to_num(Data[i])
				if(dozaD)
					skinuri += dozaD
			}
			if(nvault_get(trackvault, target_name, rLine, sizeof(rLine) - 1)) 
			{ 
				formatex(arg1, charsmax(arg1), "")
				formatex(arg1, charsmax(arg2), "")
				strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

				parse(arg1, Data[1], 7, Data[2], 7, Data[3], 7, Data[4], 7, Data[5], 7, Data[6], 7, Data[7], 7, Data[8],7, Data[9], 7, Data[10], 7, Data[11], 7,
				Data[12],  7, Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7, Data[20], 7, Data[21], 7, Data[22], 7,
				Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7, Data[27], 7, Data[28], 7, Data[29], 7, Data[30], 7, Data[31], 7, Data[32], 7, Data[33], 7,
				Data[34], 7, Data[35], 7, Data[36], 7, Data[37], 7, Data[38], 7, Data[39], 7, Data[40], 7, Data[41], 7, Data[42], 7, Data[43], 7, Data[44], 7,
				Data[45], 7, Data[46], 7, Data[47], 7, Data[48], 7, Data[49], 7, Data[50], 7, Data[51], 7, Data[52], 7, Data[53], 7, Data[54], 7, Data[55], 7, Data[56], 7)

				parse(arg2, Data[57], 7, Data[58], 7, Data[59], 7, Data[60], 7, Data[61], 7, Data[62], 7, Data[63], 7, Data[64],
				7, Data[65], 7, Data[66], 7, Data[67], 7, Data[68], 7, Data[69], 7, Data[70], 7, Data[71], 7, Data[72], 7, Data[73],
				7, Data[74], 7, Data[75], 7, Data[76], 7, Data[77], 7, Data[78], 7, Data[79], 7, Data[80], 7, Data[81], 7, Data[82],
				7, Data[83], 7, Data[84], 7, Data[85], 7, Data[86], 7, Data[87], 7, Data[88], 7, Data[89], 7, Data[90], 7, Data[91],
				7, Data[92], 7, Data[93], 7, Data[94], 7, Data[95], 7, Data[96], 7, Data[97], 7, Data[98], 7, Data[99], 7, Data[100], 7);
				new dData[8]
				for(new i = 1; i < AllWeapon; i++)
				{
					parse(Data[i], dData, 7)
					dozaD = str_to_num(dData[0]);
					if(dozaD)
						startrakuri += dozaD
				}
			}
			new parola[33]
			nvault_get(rvault, target_name, parola, sizeof(parola) - 1)
			console_print(id,"Nume: %s - Parola: %s",target_name,parola)
			console_print(id,"Killuri: %i",killuri)
			console_print(id,"Puncte: %i",puncte)
			console_print(id,"Key: %i",keyu)
			console_print(id,"Cutii: %i",cutii)
			console_print(id,"Rank: %s",Rangs[rangu])
			console_print(id,"Skinuri: %i",skinuri)
			console_print(id,"StatTrack: %i",startrakuri)
		}
		else
		{
			console_print(id, "Jucatorul %s nu a fost gasit in baza de date!", target_name);
			return 1;
		}

		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public get_skins(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, charsmax(target_name));
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_getskins <Nume>");
			return 1;
		}
		new Data[MAX+1][8],dozaD,dummy[1];

		if(nvault_get(svault, target_name, rLine, sizeof(rLine) - 1))
		{
			new parola[33]
			nvault_get(rvault, target_name, parola, sizeof(parola) - 1)
			console_print(id,"Nume: %s - Parola: %s",target_name,parola)
			console_print(id,"Skinuri:")
			formatex(arg1, charsmax(arg1), "")
			formatex(arg1, charsmax(arg2), "")
			strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

			parse(arg1, dummy, 0, dummy, 0, dummy, 0, dummy, 0, dummy, 0, Data[1], 7, Data[2],
			7, Data[3], 7, Data[4], 7, Data[5], 7, Data[6], 7, Data[7], 7, Data[8], 7, Data[9], 7, Data[10], 7, Data[11], 7, Data[12],
			7, Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7, Data[20], 7, Data[21],
			7, Data[22], 7, Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7, Data[27], 7, Data[28], 7, Data[29], 7, Data[30],
			7, Data[31], 7, Data[32], 7, Data[33], 7, Data[34], 7, Data[35], 7, Data[36], 7, Data[37], 7, Data[38], 7, Data[39],
			7, Data[40], 7, Data[41], 7, Data[42], 7, Data[43], 7, Data[44], 7, Data[45], 7, Data[46], 7, Data[47], 7, Data[48],
			7, Data[49], 7, Data[50], 7, Data[51], 7, Data[52], 7, Data[53], 7, Data[54], 7, Data[55], 7, Data[56], 7);

			parse(arg2, Data[57], 7, Data[58], 7, Data[59], 7, Data[60], 7, Data[61], 7, Data[62], 7, Data[63], 7, Data[64],
			7, Data[65], 7, Data[66], 7, Data[67], 7, Data[68], 7, Data[69], 7, Data[70], 7, Data[71], 7, Data[72], 7, Data[73],
			7, Data[74], 7, Data[75], 7, Data[76], 7, Data[77], 7, Data[78], 7, Data[79], 7, Data[80], 7, Data[81], 7, Data[82],
			7, Data[83], 7, Data[84], 7, Data[85], 7, Data[86], 7, Data[87], 7, Data[88], 7, Data[89], 7, Data[90], 7, Data[91],
			7, Data[92], 7, Data[93], 7, Data[94], 7, Data[95], 7, Data[96], 7, Data[97], 7, Data[98], 7, Data[99], 7, Data[100], 7);

			for(new i = 1; i < AllWeapon; i++)
			{
				dozaD = str_to_num(Data[i])
				if(dozaD)
					console_print(id,"%s - %i",WeaponNames[i],dozaD)
			}
			if(nvault_get(trackvault, target_name, rLine, sizeof(rLine) - 1)) 
			{ 
				formatex(arg1, charsmax(arg1), "")
				formatex(arg1, charsmax(arg2), "")
				strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

				parse(arg1, Data[1], 7, Data[2], 7, Data[3], 7, Data[4], 7, Data[5], 7, Data[6], 7, Data[7], 7, Data[8],7, Data[9], 7, Data[10], 7, Data[11], 7,
				Data[12],  7, Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7, Data[20], 7, Data[21], 7, Data[22], 7,
				Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7, Data[27], 7, Data[28], 7, Data[29], 7, Data[30], 7, Data[31], 7, Data[32], 7, Data[33], 7,
				Data[34], 7, Data[35], 7, Data[36], 7, Data[37], 7, Data[38], 7, Data[39], 7, Data[40], 7, Data[41], 7, Data[42], 7, Data[43], 7, Data[44], 7,
				Data[45], 7, Data[46], 7, Data[47], 7, Data[48], 7, Data[49], 7, Data[50], 7, Data[51], 7, Data[52], 7, Data[53], 7, Data[54], 7, Data[55], 7, Data[56], 7)

				parse(arg2, Data[57], 7, Data[58], 7, Data[59], 7, Data[60], 7, Data[61], 7, Data[62], 7, Data[63], 7, Data[64],
				7, Data[65], 7, Data[66], 7, Data[67], 7, Data[68], 7, Data[69], 7, Data[70], 7, Data[71], 7, Data[72], 7, Data[73],
				7, Data[74], 7, Data[75], 7, Data[76], 7, Data[77], 7, Data[78], 7, Data[79], 7, Data[80], 7, Data[81], 7, Data[82],
				7, Data[83], 7, Data[84], 7, Data[85], 7, Data[86], 7, Data[87], 7, Data[88], 7, Data[89], 7, Data[90], 7, Data[91],
				7, Data[92], 7, Data[93], 7, Data[94], 7, Data[95], 7, Data[96], 7, Data[97], 7, Data[98], 7, Data[99], 7, Data[100], 7);
				new dData[8]
				for(new i = 1; i < AllWeapon; i++)
				{
					parse(Data[i], dData, 7)
					dozaD = str_to_num(dData[0]);
					if(dozaD)
						console_print(id,"StatTrack %s - %i",WeaponNames[i],dozaD)
				}
			}
		}
		else
		{
			console_print(id, "Jucatorul %s nu a fost gasit in baza de date!", target_name);
			return 1;
		}

		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public take_skins(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, charsmax(target_name));
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_takeskins <Nume>");
			return 1;
		}

		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		for(new i = 1; i < AllWeapon; i++)
		{
			stattrack[i][iPlayer] = 0
			kill[i][iPlayer] = 0
			uWeapon[i][iPlayer] = 0
		}
		
		for(new a = 0; a < WEAPONSKIN; a++)
		{
			UsingWeapon[a][iPlayer] = 0
		}
		Save(iPlayer);

		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_key(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, charsmax(target_name));
		read_argv(2, Amount, charsmax(Amount));
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_givekey <Nume> <Suma>");
			return 1;
		}
		
		new Key = str_to_num(Amount);
		
		if(Key <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer
		if(equal(target_name, "@ALL"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss))
				{
					pKey[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, charsmax(Admin_Name));
		
			print_color(0, "!g%s!t %s!y a dat !g%d key!y la toata lumea", Prefix, Admin_Name, Key);
			return 1;
		}
		else if(equal(target_name, "@CT"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_CT)
				{
					pKey[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, charsmax(Admin_Name));
		
			print_color(0, "!g%s!t %s!y a dat !g%d key!y la echipa CT", Prefix, Admin_Name, Key);
			return 1;
		}
		else if(equal(target_name, "@T"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_T)
				{
					pKey[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, charsmax(Admin_Name));
		
			print_color(0, "!g%s!t %s!y a dat !g%d key!y la echipa T", Prefix, Admin_Name, Key);
			return 1;
		}
		else
		{
			iPlayer = cmd_target(id, target_name, 8);
		}
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		pKey[iPlayer] += Key;
		new Admin_Name[32];
		new Player_Name[32];
		Save(iPlayer);
		get_user_name(id, Admin_Name, charsmax(Admin_Name));
		get_user_name(iPlayer, Player_Name, charsmax(Admin_Name));
		
		print_color(0, "!g%s!t %s!y i-a dat !g%d key!y lui!t %s", Prefix, Admin_Name, Key, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_skins(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, 31);
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_giveskins <Nume>");
			return 1;
		}

		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		for(new i = 1; i < AllWeapon; i++)
		{
			uWeapon[i][iPlayer]++
		}
		Save(iPlayer);
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_stat(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, 31);
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_givestat <Nume>");
			return 1;
		}

		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		for(new i = 1; i < AllWeapon; i++)
		{
			uWeapon[i][iPlayer]++
			stattrack[i][iPlayer]++
		}
		Save(iPlayer);
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_chest(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		new Amounts[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		read_argv(3, Amounts, 9);
		
		if(equal(target_name, "") || equal(Amount, "") || equal(Amounts, ""))
		{
			console_print(id, "amx_givechest <Nume> <Suma> <chestid>");
			return 1;
		}
		
		new Key = str_to_num(Amount);
		
		if(Key <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}

		new Keyid = str_to_num(Amounts);
		
		if(Keyid < 0||Keyid > 10)
		{
			console_print(id, "Trebuie sa scrii o suma intre 0 si 11!");
			return 1;
		}

		new iPlayer
		if(equal(target_name, "@ALL"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss))
				{
					Chestp[iss][Keyid] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d %s!y la toata lumea", Prefix, Admin_Name, Key, ChestName[Keyid]);
			return 1;
		}
		else if(equal(target_name, "@CT"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_CT)
				{
					Chestp[iss][Keyid] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d %s!y la echipa CT", Prefix, Admin_Name, Key, ChestName[Keyid]);
			return 1;
		}
		else if(equal(target_name, "@T"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_T)
				{
					Chestp[iss][Keyid] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d %s!y la echipa T", Prefix, Admin_Name, Key, ChestName[Keyid]);
			return 1;
		}
		else
		{
			iPlayer = cmd_target(id, target_name, 8);
		}
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		Chestp[iPlayer][Keyid] += Key;
		new Admin_Name[32];
		new Player_Name[32];
		Save(iPlayer);
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		print_color(0, "!g%s!t %s!y i-a dat !g%d %s!y lui!t %s", Prefix, Admin_Name, Key, ChestName[Keyid], Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_puncte(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_givepoints <Nume> <Suma>");
			return 1;
		}
		
		new Key = str_to_num(Amount);
		
		if(Key <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer
		if(equal(target_name, "@ALL"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss))
				{
					Points[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d EURO!y la toata lumea", Prefix, Admin_Name, Key);
			return 1;
		}
		else if(equal(target_name, "@CT"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_CT)
				{
					Points[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d EURO!y la echipa CT", Prefix, Admin_Name, Key);
			return 1;
		}
		else if(equal(target_name, "@T"))
		{
			for(new iss; iss < 32; iss++)
			{
				if(is_user_connected(iss) && cs_get_user_team(iss) == CS_TEAM_T)
				{
					Points[iss] += Key;
					Save(iss);
				}
			}
			new Admin_Name[32];
			get_user_name(id, Admin_Name, 31);
		
			print_color(0, "!g%s!t %s!y a dat !g%d EURO!y la echipa T", Prefix, Admin_Name, Key);
			return 1;
		}
		else
		{
			iPlayer = cmd_target(id, target_name, 8);
		}
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		Points[iPlayer] += Key;
		new Admin_Name[32];
		new Player_Name[32];
		Save(iPlayer);
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		print_color(0, "!g%s!t %s!y i-a dat !g%d EURO!y lui!t %s", Prefix, Admin_Name, Key, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_rank(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_giverank <Nume> <ID>");
			return 1;
		}
		
		new Key = str_to_num(Amount);
		
		if(Key <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer
		iPlayer = cmd_target(id, target_name, 8);

		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		Rang[iPlayer] = Key;
		new Admin_Name[32];
		new Player_Name[32];
		Save(iPlayer);
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		print_color(0, "!g%s!t %s!y i-a oferit grad-ul !g%s!y lui !t%s", Prefix, Admin_Name, Rangs[Key], Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public give_promo(id)
{
	hide(mure)
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		
		read_argv(1, target_name, 31);
		
		if(equal(target_name, ""))
		{
			console_print(id, "amx_getpromo <Nume>");
			return 1;
		}
		
		new Cost = LoadPromo(target_name)
		print_color(id, "!g%s!t PromoCode-ul !g%s !ta fost folosit de !g%i", Prefix, target_name, Cost);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
//----------------------------------------Main--------------------------------------------//
public Message() 
{
	hide(mure)
	print_color(0, "!g%s Te joci !t%s !y%s !tcreat special pentru comunitatea lacs", Prefix, PLUGIN, VERSION, AUTHOR);
}
public Messages() 
{
	hide(mure)
	print_color(0, "!g%s !tVrei si tu un addons csgo? Scrie /addons !", Prefix);
}
public MenuOpen(id)
{
	hide(mure)
	if(!Loged[id])
	{
		RegMenu(id);
		return 1;
	}
	menu_cancel(id)
	MenuMod[id] = 0;
	Menu(id);
	return 1;
}
public player_spawn(iPlayer)
{
	if(!is_user_alive(iPlayer))
		return HAM_IGNORED

	new szName[32]

	get_user_name(iPlayer, szName, 31)

	if(!equali(szName, g_szName[iPlayer]))
	{
		set_msg_block(msgID_sayText, BLOCK_ONCE)
		set_user_info(iPlayer, "name", g_szName[iPlayer])
	}

	for(new p = 1; p <= 32; p++)
		g_iDamage[iPlayer][p] = 0


	return HAM_IGNORED
}
public player_damage(iVictim)
{
	new iAttacker = get_user_attacker(iVictim)

	if(!is_player(iAttacker))
		return PLUGIN_CONTINUE

	g_iDamage[iAttacker][iVictim] += read_data(2)

	return PLUGIN_CONTINUE
}
public player_diePost(arg[])
{
	new szWeapon[24]
	new iKiller = arg[1]

	get_weaponname(arg[3], szWeapon, 23)
	replace(szWeapon, 23, "weapon_", "")

	do_deathmsg(iKiller, arg[0], arg[2], szWeapon)

	set_msg_block(msgID_sayText, BLOCK_ONCE)
	set_user_info(iKiller, "name", g_szName[iKiller])
	set_task(1.0,"removename",iKiller)
	return PLUGIN_CONTINUE
}
public removename(id)
{
	g_NameChange[id] = 0
}
public msg_deathMsg()
	return PLUGIN_HANDLED

stock do_deathmsg(iKiller, iVictim, iHS, const szWeapon[])
{
	message_begin(MSG_ALL, msgID_deathMsg)
	write_byte(iKiller)
	write_byte(iVictim)
	write_byte(iHS)
	write_string(szWeapon)
	message_end()
}
public event_DeathMsg()
{
	hide(mure)
	static Victim; Victim = read_data(2);
	static Killer; Killer = read_data(1);
	new iHS = read_data(3)
	new szWeapon[24]
	read_data(4, szWeapon, 23)
	remove_task(Victim+500)

	if(Killer != Victim)
	{
		new iKiller2 = -1

		for(new p = 1; p <= 32; p++)
		{
			if(p != Killer && g_iDamage[p][Victim] >= 45)
			{
				iKiller2 = p
			}

			g_iDamage[p][Victim] = 0
		}

		if(iKiller2 != -1)
		{
			g_NameChange[Killer] = 1
			new iFrags = get_user_frags(iKiller2)+1

			set_user_frags(iKiller2, iFrags)

			message_begin(MSG_ALL, msgID_scoreInfo)
			write_byte(iKiller2)
			write_short(iFrags)
			write_short(get_user_deaths(iKiller2))
			write_short(0)
			write_short(get_user_team(iKiller2))
			message_end()

			new szName1[32], iName1Len, szName2[32], iName2Len, szNames[32], szWeaponLong[32]

			iName1Len = get_user_name(Killer, szName1, 31)
			iName2Len = get_user_name(iKiller2, szName2, 31)
 
			g_szName[Killer] = szName1

			if(iName1Len < 14)
			{
				formatex(szName1, iName1Len, "%s", szName1)
				formatex(szName2, 28-iName1Len, "%s", szName2)
			}
			else if(iName2Len < 14)
			{
				formatex(szName1, 28-iName2Len, "%s", szName1)
				formatex(szName2, iName2Len, "%s", szName2)
			}
			else
			{
				formatex(szName1, 13, "%s", szName1)
				formatex(szName2, 13, "%s", szName2)
			}

			formatex(szNames, 31, "%s + %s", szName1, szName2)

			set_msg_block(msgID_sayText, BLOCK_ONCE)
			set_user_info(Killer, "name", szNames)

			if(equali(szWeapon, "grenade"))
				szWeaponLong = "weapon_hegrenade"
			else
				formatex(szWeaponLong, 31, "weapon_%s", szWeapon)

			new args[4]

			args[0] = Victim
			args[1] = Killer
			args[2] = iHS
			args[3] = get_weaponid(szWeaponLong)

			set_task(0.1, "player_diePost", 0, args, 4)
		}
		else
			do_deathmsg(Killer, Victim, iHS, szWeapon)
	}
	else
		do_deathmsg(Victim, Victim, iHS, szWeapon)

	if(task_exists(Victim+231245534))
	{
		remove_task(Victim+231245534)
	}
	set_task(0.1, "ShowHUD", Victim+231245534, _, _, "b")
	if(is_user_connected(Victim))
		Remove_Icon(Victim)


	if(Killer == Victim)
	{
		return PLUGIN_HANDLED;
	}
	new pPont;
	
	pPont += random_num(PointsMin, PointsMax);
	Kills[Killer]++;
	for(new i = 1; i < AllWeapon; i++)
	{
		for(new a = 0; a < WEAPONSKIN; a++)
		{
			new der = i+500
			if(der == UsingWeapon[a][Killer])
			{
				if(get_user_weapon(Killer) == Weapons[i])
				{
					kill[i][Killer]++
				}
			}
		}
	}
	Points[Killer] += pPont;
	new Name[32]
	get_user_name(Killer, Name, 31);
	set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 6.0, 2.0);
	show_hudmessage(Killer, "%L", LANG_SERVER, "POINT", pPont);
	if(Rang[Killer] < sizeof(Rangs) && Rang[Killer] < file_size(RangFile, 1))
	{
		if(Kills[Killer] >= NeedKills[Rang[Killer]])
		{
			Rang[Killer]++;
			print_color(0, "!g%s %s !ya avansat si a ajuns la gradul !t%s", Prefix, Name,Rangs[Rang[Killer]]);
		}
	}
	
	if(get_pcvar_num(g_dropchace) >= random_num(1, 100))
	{
		new x = random_num(1, 2);
		if(x == 1)
		{
			pKey[Killer]++;
			print_color(0, "!g%s%L", Prefix, LANG_SERVER, "FOUNDKEY", Name);
		}
		if(x == 2)
		{
			GiveChest(Killer)
		}
	}
	set_task(4.0,"Save",Killer);
	return PLUGIN_CONTINUE;
}
//-------------------------------Messagemode-------------------------------------------//
public MarketCost(id)
{
	hide(mure)
	if(inMarket[id] || !Loged[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0)
	{
		client_cmd(id, "messagemode Cost");
		return PLUGIN_HANDLED;
	}
	else if(WeaponinMarket[id] == 102)
	{
		if(300 > Cost || 2500 < Cost)
		{
			print_color(id, "!gMinimul de vanzare !t300!g, Maximul de vanzare !t2500");
			client_cmd(id, "messagemode Cost");
			return PLUGIN_HANDLED;
		}
		MarketPoints[id] = Cost;
		MenuMod[id] = 3
		Menu(id)
		return PLUGIN_CONTINUE;
	}
	else if(103 <= WeaponinMarket[id] && 113 >= WeaponinMarket[id])
	{
		if(ChestMin[WeaponinMarket[id]-103] > Cost || ChestMax[WeaponinMarket[id]-103] < Cost)
		{
			print_color(id, "!gMinimul de vanzare !t%d!g, Maximul de vanzare !t%d",ChestMin[WeaponinMarket[id]-103],ChestMax[WeaponinMarket[id]-103]);
			client_cmd(id, "messagemode Cost");
			return PLUGIN_HANDLED;
		}
		MarketPoints[id] = Cost;
		MenuMod[id] = 3
		Menu(id)
		return PLUGIN_CONTINUE;
	}
	else if(WeaponinMarket[id] > 500)
	{
		WeaponinMarket[id] -= 500
		new d = WeaponMin[WeaponinMarket[id]]
		d *= 2
		new e = WeaponMax[WeaponinMarket[id]]
		e *= 2
		WeaponinMarket[id] += 500
		if(d > Cost || e < Cost)
		{
			print_color(id, "!gMinimul de vanzare !t%d!g, Maximul de vanzare !t%d", d, e);
			client_cmd(id, "messagemode Cost");
			return PLUGIN_HANDLED;
		}
		else
		{
			MarketPoints[id] = Cost;
			MenuMod[id] = 3
			Menu(id)
			return PLUGIN_CONTINUE;
		}
	}
	else if(WeaponMin[WeaponinMarket[id]] > Cost || WeaponMax[WeaponinMarket[id]] < Cost)
	{
		print_color(id, "!gMinimul de vanzare !t%d!g, Maximul de vanzare !t%d", WeaponMin[WeaponinMarket[id]], WeaponMax[WeaponinMarket[id]]);
		client_cmd(id, "messagemode Cost");
		return PLUGIN_HANDLED;
	}
	else
	{
		MarketPoints[id] = Cost;
		MenuMod[id] = 3
		Menu(id)
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public PromoCode(id)
{
	hide(mure)
	if(!Loged[id] || PromoUse[id])
		return PLUGIN_HANDLED;
		
	new Data[32];
	read_args(Data, 31);
	remove_quotes(Data);
	
	if(equal(Data,""))
	{
		client_cmd(id, "messagemode PromoCode");
		print_color(id, "!g[CSGO DEADLY]!t Scrie un promocode valid....");
		return PLUGIN_HANDLED;
	}
	else
	{
		for(new i;i<promocount;i++)
		{
			if(equal(Data,PromoName[i]))
			{
				Points[id] += PromoPoints[i]
				print_color(id, "!g[CSGO DEADLY]!t Ai folosit promocode-ul !g%s!t si ai castigat !g%d!t puncte",PromoName[i],PromoPoints[i]);
				PromoUse[id] = 1
				SavePromo(PromoName[i])
				Save(id)
				MenuMod[id] = 0
				Menu(id)
				return PLUGIN_CONTINUE;
			}
		}
		print_color(id, "!g[CSGO DEADLY]!t Scrie un promocode valid....");
		
	}
	return PLUGIN_CONTINUE;
}
public SavePromo(name[])
{
	new Line[64];
	format(Line, 63, "%i", LoadPromo(name)+1);

	nvault_set(pvault, name, Line)
}
public LoadPromo(name[])
{
	hide(mure)
	new Data[32]; 
	if(nvault_get(pvault, name, Data, sizeof(Data) - 1)) 
	{ 
		return str_to_num(Data)
	}
	
	
	return 0;
}
public Tbet(id)
{
	hide(mure)
	if(!Loged[id] || bround > 4 || pbet[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Cost > Points[id] || Cost == 0)
	{
		client_cmd(id, "messagemode T");
		return PLUGIN_HANDLED;
	}
	else
	{
		pbet[id] = 1;
		betp[id] = Cost
		Points[id] -= Cost
		print_color(id, "!g[CSGO DEADLY]!t Ai pariat pe echipa T %d points",Cost);
		MenuMod[id] = 0
		Menu(id)
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public CTbet(id)
{
	hide(mure)
	if(!Loged[id] || bround > 4 || pbet[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Cost > Points[id] || Cost == 0)
	{
		client_cmd(id, "messagemode CT");
		return PLUGIN_HANDLED;
	}
	else
	{
		pbet[id] = 2;
		betp[id] = Cost
		Points[id] -= Cost
		print_color(id, "!g[CSGO DEADLY]!t Ai pariat pe echipa CT %d points",Cost);
		MenuMod[id] = 0
		Menu(id)
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public RosuRuleta(id)
{
	hide(mure)
	if(ruleta || !Loged[id] || Rosu[id] || Gri[id] || Galben[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Cost > Points[id] || Cost == 0)
	{
		client_cmd(id, "messagemode Rosu");
		return PLUGIN_HANDLED;
	}
	else
	{
		Rosu[id] = Cost;
		Points[id] -= Cost
		Save(id)
		ruletta(id)
		playr++
		if(playr == 2 && sec == 60)
			playruleta()

		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public GriRuleta(id)
{
	hide(mure)
	if(ruleta || !Loged[id] || Rosu[id] || Gri[id] || Galben[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Cost > Points[id] || Cost == 0)
	{
		client_cmd(id, "messagemode Gri");
		return PLUGIN_HANDLED;
	}
	else
	{
		Gri[id] = Cost;
		Points[id] -= Cost
		Save(id)
		ruletta(id)
		playr++
		if(playr == 2 && sec == 60)
			playruleta()

		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public GalbenRuleta(id)
{
	hide(mure)
	if(ruleta || !Loged[id] || Rosu[id] || Gri[id] || Galben[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Cost > Points[id] || Cost == 0)
	{
		client_cmd(id, "messagemode Galben");
		return PLUGIN_HANDLED;
	}
	else
	{
		Galben[id] = Cost;
		Points[id] -= Cost
		Save(id)
		ruletta(id)
		playr++
		if(playr == 2 && sec == 60)
			playruleta()

		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public GiftPoint(id)
{
	hide(mure)
	if(inMarket[id] || !Loged[id])
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost < 0 || Points[id] < Cost)
	{
		client_cmd(id, "messagemode Gift");
		return PLUGIN_HANDLED;
	}
	else
	{
		aPoints[id] = Cost;
		MenuMod[id] = 5;
		Menu(id);
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
//------------------------------------Arme-----------------------------//
public CWeapon( id ) {
	hide(mure)
	if(id > 32 || id < 1 || !is_user_alive(id))
	{
		return 1;
	}

	if(task_exists(id+231245534))
	{
		rem[id] = 1
		ClearSyncHud(id,g_syncHudMessage1)
		remove_task(id+231245534)
	}

	new a = get_pdata_cbase( id, 373 )
	if(pev_valid(a))
	{
		new imv = pev(a, 82)
		if(imv > 0)
		{
			set_pev(id, pev_viewmodel2, WeaponMdls[imv])
			rem[id] = 0
			ShowHUDz(id+231245534)
			set_task(1.0, "ShowHUDz", id+231245534, _, _, "b")
			return 1;
		}
	}
	for(new i = 1; i < AllWeapon; i++)
	{
		for(new a = 0; a < WEAPONSKIN; a++)
		{
			new der = i+500
			if(i == UsingWeapon[a][id])
			{
				if(get_user_weapon(id) == Weapons[i])
				{
					set_pev(id, pev_viewmodel2, WeaponMdls[i]);
					return 1;
				}
			}
			else if(der == UsingWeapon[a][id])
			{
				if(get_user_weapon(id) == Weapons[i])
				{
					set_pev(id, pev_viewmodel2, WeaponMdls[i]);
					rem[id] = 0
					ShowHUD(id+231245534)
					set_task(1.0, "ShowHUD", id+231245534, _, _, "b")
					return 1;
				}
			}
		}
	}
	for(new i = 1; i < AllWeaponD; i++)
	{
		if(get_user_weapon(id) == WeaponsD[i])
		{
			set_pev(id, pev_viewmodel2, WeaponDMdls[i]);
			return 1;
		}
	}

	return PLUGIN_CONTINUE;
}
public ShowHUDz(id)
{
	hide(mure)
	id -= 231245534
	if(rem[id])
		return 1;

	if(!is_user_connected(id))
		return 1;

	if (!is_user_alive(id))
	{
		new ids = pev(id, pev_iuser2)
		
		if (!is_user_alive(ids)) return 1;

		new a = get_pdata_cbase(ids, 373)
		if(pev_valid(a))
		{
			for(new i; i < wpnnz+1; i++)
			{
				if(WepPickUp[i][0] == a && WepPickUp[i][2] == get_user_weapon(ids))
				{
					set_hudmessage(255, 50, 50, 1.0, 0.85, 0, 0.00, 1.0, 0.00, 0.00);
					ShowSyncHudMsg(id, g_syncHudMessage1, "%s^nArma lui %s", WeaponNames[WepPickUp[i][1]], WepPickUpN[i]);
				}
			}
		}
	}
	else
	{
		new a = get_pdata_cbase(id, 373)
		if(pev_valid(a))
		{
			for(new i; i < wpnnz+1; i++)
			{
				if(WepPickUp[i][0] == a && WepPickUp[i][2] == get_user_weapon(id))
				{
					set_hudmessage(255, 50, 50, 1.0, 0.85, 0, 0.00, 1.0, 0.00, 0.00);
					ShowSyncHudMsg(id, g_syncHudMessage1, "%s^nArma lui %s", WeaponNames[WepPickUp[i][1]], WepPickUpN[i]);
				}
			}
		}
	}
	return 0
}
public ShowHUD(id)
{
	hide(mure)
	id -= 231245534
	if(rem[id])
		return 1;

	if(!is_user_connected(id))
		return 1;

	if (!is_user_alive(id))
	{
		new ids = pev(id, pev_iuser2)
		
		if (!is_user_alive(ids)) return 1;

		new name[32]
		get_user_name(ids, name, 31)
		for(new i = 1; i < AllWeapon; i++)
		{
			for(new a = 0; a < WEAPONSKIN; a++)
			{
				new der = i+500
				if(der == UsingWeapon[a][ids])
				{
					if(get_user_weapon(ids) == Weapons[i])
					{
						set_hudmessage(255, 50, 50, 1.0, 0.85, 0, 0.00, 1.0, 0.00, 0.00);
						ShowSyncHudMsg(id, g_syncHudMessage1, "%s detine %s StatTrack^nAre %i kill-uri confirmate", name, WeaponNames[i], kill[i][ids]);
					}
				}
			}
		}
	}
	else
	{
		for(new i = 1; i < AllWeapon; i++)
		{
			for(new a = 0; a < WEAPONSKIN; a++)
			{
				new der = i+500
				if(der == UsingWeapon[a][id])
				{
					if(get_user_weapon(id) == Weapons[i])
					{
						set_hudmessage(255, 50, 50, 1.0, 1.85, 0, 0.00, 1.0, 0.00, 0.00);
						ShowSyncHudMsg(id, g_syncHudMessage1, "StatTrack %s^nConfirmed Kills: %i", WeaponNames[i], kill[i][id]);
					}
				}
			}
		}
	}
	return 0
}
//----------------------------------Case opening-----------------------//
public ChestOpen(id,value)
{
	hide(mure)
	if(!task[id])
	{
		new a, itema[MAX+1]
		for(new i = 1; i < AllWeapon; i++)
		{
			if(WeaponChest[i] == value)
			{
				itema[a] = i
				a++
			}
		}

		if(a == 0)
		{
			print_color(id, "!g[CSGO DEADLY] !yChestul %s nu contine niciun skin.Anunta detinatorul!",ChestName[value])
			return;
		}

		new rWeapon = random_num(1, a);
		new rNum
		for(new i;i<1000;i++)
		{
			rNum = random_num(1, 100);
	
			if(WeaponDrop[itema[rWeapon]] >= rNum)
			{
				Chestp[id][value]--;
				pKey[id]--;
				new star = random_num(1, 25)
				if(star == 1)
				{
					new Name[32];
					get_user_name(id, Name, 31);
					print_color(id, "!g[CSGO DEADLY]%L!y-!gStatTrack!y!", LANG_SERVER, "FOUNDITEM", Name, WeaponNames[itema[rWeapon]]);
					uWeapon[itema[rWeapon]][id]++;
					stattrack[itema[rWeapon]][id]++;
					Save(id);
				}
				else
				{
					new Name[32];
					get_user_name(id, Name, 31);
					print_color(id, "!g[CSGO DEADLY]%L", LANG_SERVER, "FOUNDITEM", Name, WeaponNames[itema[rWeapon]]);
					uWeapon[itema[rWeapon]][id]++;
					Save(id);
				}
				client_cmd(id, "stopsound")
				client_cmd(id, "mp3 stop")
				client_cmd(id, "spk %s",Sunete[0])
				task[id] = 1
				set_task(5.0,"rmvtsk",id+31666677)
				break;
			}
		}
	}
	else
	{
		print_color(id, "!g[>CSGO<] !yAsteapta !g5 secunde !ypentru a putea folosi comanda !!!");
	}
}
public rmvtsk(id)
{
	id -= 31666677
	task[id] = 0
}
//------------------------Meniu-----------------------------------//
public Menu(id)
{
	hide(mure)
	if(Loged[id] == false)
	{
		RegMenu(id);
		return 1;
	}
	
	new sMenu, Line[245];
	
	if(MenuMod[id] == -2)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "GIFTCH", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		new String[32], All;
		for(new i = 1; i < AllWeapon; i++)
		{
			if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
				continue;

			if(stattrack[i][id])
			{
				new bda
				bda = i+500
				formatex(String, 31, "%d", bda);
				formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(sMenu, Line, String);
			}
			if(uWeapon[i][id] > stattrack[i][id])
			{
				new dsa = uWeapon[i][id]-stattrack[i][id]
				num_to_str(i, String, 31);
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
				menu_additem(sMenu, Line, String);
			}
			All++;
		}
		for(new i;i<chestcount;i++)
		{
			if(Chestp[id][i] > 0)
			{
				formatex(Line, charsmax(Line), "\r%s \d|\y %d bucati", ChestName[i], Chestp[id][i]);
				new calcul = 103+i
				new numars[16]
				num_to_str(calcul,numars,15)
				menu_additem(sMenu, Line, numars);
				All++;
			}
		}
		if(pKey[id] > 0)
		{
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "KEYPIECE", pKey[id]);
			menu_additem(sMenu, Line, "102");
			All++;
		}
		if(All == 0)
		{
			MenuMod[id] = 0;
			Menu(id);
			return 1;
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == -1)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "GIFTCH", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		new String[32], All;
		for(new i = 1; i < AllWeapon; i++)
		{
			if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
				continue;
				

			if(stattrack[i][id])
			{
				new bda
				bda = i+500
				formatex(String, 31, "%d", bda);
				formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(sMenu, Line, String);
			}
			if(uWeapon[i][id] > stattrack[i][id])
			{
				new dsa = uWeapon[i][id]-stattrack[i][id]
				num_to_str(i, String, 31);
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
				menu_additem(sMenu, Line, String);
			}
			All++;
		}
		for(new i;i<chestcount;i++)
		{
			if(Chestp[id][i] > 0)
			{
				formatex(Line, charsmax(Line), "\r%s \d|\y %d bucati", ChestName[i], Chestp[id][i]);
				new calcul = 103+i
				new numars[16]
				num_to_str(calcul,numars,15)
				menu_additem(sMenu, Line, numars);
				All++;
			}
		}
		if(pKey[id] > 0)
		{
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "KEYPIECE", pKey[id]);
			menu_additem(sMenu, Line, "102");
			All++;
		}
		if(All == 0)
		{
			MenuMod[id] = 0;
			Menu(id);
			return 1;
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == 0)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "MAIN", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MENUTOSKINS");
		menu_additem(sMenu, Line, "1");
		
		if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
		{
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MENUTOCHESTOPEN");
			menu_additem(sMenu, Line, "2");
		}
		else
		{
			formatex(Line, charsmax(Line), "%L %L",
			LANG_SERVER, "MENUTOCHESTOPEN", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}
		
		if(!inJack[id])
		{
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MENUTOMARKET");
			menu_additem(sMenu, Line, "3");
		}
		else
		{
			formatex(Line, charsmax(Line), "%L%L", LANG_SERVER, "MENUTOMARKET", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}

		if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
		{
			formatex(Line, charsmax(Line), "Schimburi de iteme");
			menu_additem(sMenu, Line, "4");
		}
		else
		{
			formatex(Line, charsmax(Line), "Schimburi de iteme%L", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}

		if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
		{
			formatex(Line, charsmax(Line), "%L",LANG_SERVER, "MENUTOGIFT");
			menu_additem(sMenu, Line, "5");
		}
		else
		{
			formatex(Line, charsmax(Line), "%L %L",
			LANG_SERVER, "MENUTOGIFT", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}


		if(!ruleta)
		{
			formatex(Line, charsmax(Line), "Ruleta\r[Deschis]");
			menu_additem(sMenu, Line, "6");
		}
		else
		{
			formatex(Line, charsmax(Line), "\dRuleta\r[Inchis 5 minute]");
			menu_additem(sMenu, Line, "0");
		}

		if(!jackpot)
		{
			formatex(Line, charsmax(Line), "Jackpot\r[Deschis]");
			menu_additem(sMenu, Line, "7");
		}
		else
		{
			formatex(Line, charsmax(Line), "\dJackpot\r[Inchis 5 minute]^n%L", LANG_SERVER, "MRANG", Rangs[Rang[id]+1], Kills[id], NeedKills[Rang[id]]);
			menu_additem(sMenu, Line, "0");
		}

		formatex(Line, charsmax(Line), "Crash\r[Deschis]");
		menu_additem(sMenu, Line, "11");

		formatex(Line, charsmax(Line), "CoinFlip\r[Deschis]");
		menu_additem(sMenu, Line, "12");

		formatex(Line, charsmax(Line), "Bet Team");
		menu_additem(sMenu, Line, "8");

		if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
		{
			formatex(Line, charsmax(Line), "Contract");
			menu_additem(sMenu, Line, "9");
		}
		else
		{
			formatex(Line, charsmax(Line), "\dContract%L", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}


		if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
		{
			formatex(Line, charsmax(Line), "Sterge Iteme");
			menu_additem(sMenu, Line, "10");
		}
		else
		{
			formatex(Line, charsmax(Line), "\dSterge Iteme%L", LANG_SERVER, "INMARKET");
			menu_additem(sMenu, Line, "0");
		}
		if(!PromoUse[id])
		{
			formatex(Line, charsmax(Line), "PromoCode");
			menu_additem(sMenu, Line, "13");
		}
		else
		{
			formatex(Line, charsmax(Line), "\dPromoCode");
			menu_additem(sMenu, Line, "0");
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == 1)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "MENUTOSKINS", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		new String[32], All;
		for(new i = 1; i < AllWeapon; i++)
		{
			if(uWeapon[i][id] == 0)
				continue;
				

			if(stattrack[i][id])
			{
				new der = i+500
				formatex(String, 31, "%d %d", der, Weapons[i]);
				formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(sMenu, Line, String);
			}
			if(uWeapon[i][id] > stattrack[i][id])
			{
				formatex(String, 31, "%d %d", i, Weapons[i]);
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], uWeapon[i][id]-stattrack[i][id]);
				menu_additem(sMenu, Line, String);
			}
			All++;
		}
		if(All == 0)
		{
			MenuMod[id] = 0;
			Menu(id);
			return 1;
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == 2)
	{
		formatex(Line, charsmax(Line), "%s\r Deschide cutii^nAi %d key", Prefix, pKey[id]);
		sMenu = menu_create(Line, "MenuHandler");
		for(new i;i<chestcount;i++)
		{
			new strnumar[16]
			num_to_str(i,strnumar,15)
			formatex(Line, charsmax(Line), "%s \r| \y%d bucati", ChestName[i],Chestp[id][i]);
			menu_additem(sMenu, Line, strnumar);
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}	
	else if(MenuMod[id] == 3)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "MENUTOMARKET", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		new String[32], All;
		if(!inMarket[id])
		{
			for(new i = 1; i < AllWeapon; i++)
			{
				new der = i+500
				if(i == WeaponinMarket[id] && uWeapon[i][id] > 0)
				{
					formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MARKETPLACES", WeaponNames[i], MarketPoints[id]);
					All++;
				}
				else if(der == WeaponinMarket[id] && uWeapon[i][id] > 0)
				{
					formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "MARKETPLACES", WeaponNames[i], MarketPoints[id]);
					All++;
				}
			}
			
			if(103 <= WeaponinMarket[id] && 113 >= WeaponinMarket[id])
			{
				formatex(Line, charsmax(Line), "\rItem:\d %s^n\yPret:\d %d", ChestName[WeaponinMarket[id]-103],MarketPoints[id]);
				All++;
			}
			if(102 == WeaponinMarket[id] && pKey[id] > 0)
			{
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MARKETPLACEK", MarketPoints[id]);
				All++;
			}
			
			if(All == 0)
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "MARKETPLACECH");
			menu_additem(sMenu, Line, "-1");
		}
		
		if(!inMarket[id])
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "TOMARKETM");
		else
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "BACKMARKET");
		menu_additem(sMenu, Line, "0");
		
		new Name[32];
		for(new x; x < 32; x++)
		{
			if(!is_user_connected(x)||!Loged[x])
				continue;

			if(inMarket[x] && MarketPoints[x] > 0)
			{
				num_to_str(x, String, 31);
				get_user_name(x, Name, 31);
				if(103 <= WeaponinMarket[x] && 113 >= WeaponinMarket[x])
				{
					formatex(Line, charsmax(Line), "\r%s \d|\y %s \d| \rCost:\y %d", Name, ChestName[WeaponinMarket[x]-103], MarketPoints[x]);
					menu_additem(sMenu, Line, String);
				}
				else if(102 == WeaponinMarket[x])
				{
					formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SELLERK", Name, MarketPoints[x]);
					menu_additem(sMenu, Line, String);
				}
				else
				{
					for(new i = 1; i < AllWeapon; i++)
					{
						new der = i+500
						if(i == WeaponinMarket[x])
						{
							formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SELLERS", Name, WeaponNames[WeaponinMarket[x]], MarketPoints[x]);
							menu_additem(sMenu, Line, String);
						}
						else if(der == WeaponinMarket[x])
						{
							WeaponinMarket[x] = i
							formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "SELLERS", Name, WeaponNames[WeaponinMarket[x]], MarketPoints[x]);
							menu_additem(sMenu, Line, String);
							WeaponinMarket[x] = der
						}
					}

				}
			}
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == 4)
	{
		trade(id);
		return 1;
	}
	else if(MenuMod[id] == 5)
	{
		formatex(Line, charsmax(Line), "%s\r %L %L",
		Prefix, LANG_SERVER, "MENUTOGIFT", LANG_SERVER, "YPOINT", Points[id]);
		sMenu = menu_create(Line, "MenuHandler");
		new All, Name[32], String[32];
		get_user_name(aTarget[id], Name, 31);
		
		if(aTarget[id] > 0 && is_user_connected(aTarget[id]))
		{
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "GIFTT", Name);
			menu_additem(sMenu, Line, "-1");
			for(new i = 1; i < AllWeapon; i++)
			{
				new der = i+500
				if(i == aThing[id] && uWeapon[i][id] > 0)
				{
					formatex(Line, charsmax(Line), "%L", LANG_SERVER, "GIFTS", WeaponNames[i]);
					menu_additem(sMenu, Line, "-2");
					All++;
				}
				else if(der == aThing[id] && uWeapon[i][id] > 0)
				{
					formatex(Line, charsmax(Line), "%L\w(\yStatTrack\w)", LANG_SERVER, "GIFTS", WeaponNames[i]);
					All++;
				}
			}
			
			if(aThing[id] == 0 && All == 0)
			{
				formatex(Line, charsmax(Line), "%L", LANG_SERVER, "GIFTCH");
				menu_additem(sMenu, Line, "-2");
			}
			else if(aThing[id] > 100)
			{
				if(103 <= aThing[id] && 113 >= aThing[id])
				{
					formatex(Line, charsmax(Line), "\rCadou:\d %s",ChestName[aThing[id]-103]);
				}
				if(102 == aThing[id])
				{
					formatex(Line, charsmax(Line), "%L", LANG_SERVER, "GIFTK");
				}
				menu_additem(sMenu, Line, "-2");
			}
			
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "GIFTPOINTS", aPoints[id]);
			menu_additem(sMenu, Line, "-4");
			formatex(Line, charsmax(Line), "%L", LANG_SERVER, "SENDGIFT");
			menu_additem(sMenu, Line, "-3");
		}
		else
		{
			for(new i; i < 32; i++)
			{
				if(is_user_connected(i) && i != id && Loged[i])
				{
					get_user_name(i, Name, 31);
					num_to_str(i, String, 31);
					menu_additem(sMenu, Name, String);
				}
			}
		}
		menu_setprop(sMenu, MPROP_EXIT, MEXIT_ALL)  
		menu_display(id, sMenu, 0);
	}
	else if(MenuMod[id] == 6)
	{
		if(!ruleta)
		{
			if(!is_user_alive(id))
				ruletta(id)
			else
				print_color(id, "!g%s!t Nu poti accesa !gruleta !tcand esti !gVIU!",Prefix);
		}

		return 1;
	}
	else if(MenuMod[id] == 7)
	{
		if(!jackpot)
		{
			if(!is_user_alive(id))
				jackkpot(id)
			else
				print_color(id, "!g%s!t Nu poti accesa !gjackpot-ul!t cand esti !gVIU!",Prefix);
		}

		return 1;
	}
	else if(MenuMod[id] == 8)
	{
		bet(id)

		return 1;
	}
	else if(MenuMod[id] == 9)
	{
		contract(id)

		return 1;
	}
	else if(MenuMod[id] == 10)
	{
		sterge(id)

		return 1;
	}
	else if(MenuMod[id] == 11)
	{
		if(!is_user_alive(id))
		{
			crashi[id] = 1
		}
		else
			print_color(id, "!g%s!t Nu poti accesa !gcrash-ul !tcand esti !gVIU!",Prefix);
	}
	else if(MenuMod[id] == 12)
	{
		if(!is_user_alive(id))
		{
			coinflip(id)
		}
		else
			print_color(id, "!g%s!t Nu poti accesa !gcoinflip-ul !tcand esti !gVIU!",Prefix);
	}
	else if(MenuMod[id] == 13)
	{
		if(!PromoUse[id])
		{
			client_cmd(id, "messagemode PromoCode");
		}
		else
			print_color(id, "!g%s!t Ai folosit deja un promocode!",Prefix);
	}
	return PLUGIN_CONTINUE
}
public MenuHandler(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT)
	{
		menu_destroy(gMenu);
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[6][32], sKey[32], Name[32], mName[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	
	if(MenuMod[id] == -2)
	{
		aThing[id] = Key;
		MenuMod[id] = 5;
		Menu(id);
		return PLUGIN_HANDLED;
	}
	else if(MenuMod[id] == -1)
	{
		WeaponinMarket[id] = Key;
		client_cmd(id, "messagemode Cost");
		MenuMod[id] = 3;
		Menu(id);
		return PLUGIN_HANDLED;
	}
	else if(MenuMod[id] == 0)
	{
		if(Key == 4)
		{
			trade(id)
			return PLUGIN_HANDLED;
		}
		MenuMod[id] = Key;
		Menu(id);
	}
	else if(MenuMod[id] == 1)
	{
		parse(Data[0], Data[2], 31, Data[3], 31);
		
		if(str_to_num(Data[3]) == FAMAS)
			UsingWeapon[0][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == USP)
			UsingWeapon[1][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == GLOCK18)
			UsingWeapon[2][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == AWP)
			UsingWeapon[3][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == MP5NAVY)
			UsingWeapon[4][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == M3)
			UsingWeapon[5][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == M4A1)
			UsingWeapon[6][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == DEAGLE)
			UsingWeapon[7][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == AK47)
			UsingWeapon[8][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == KNIFE)
			UsingWeapon[9][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == P90)
			UsingWeapon[10][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == SCOUT)
			UsingWeapon[11][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == AUG)
			UsingWeapon[12][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == UMP45)
			UsingWeapon[13][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == XM1014)
			UsingWeapon[14][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == SG550)
			UsingWeapon[15][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == SG552)
			UsingWeapon[16][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == G3SG1)
			UsingWeapon[17][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == P228)
			UsingWeapon[18][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == GALIL)
			UsingWeapon[19][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == M249)
			UsingWeapon[20][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == FIVESEVEN)
			UsingWeapon[21][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == ELITE)
			UsingWeapon[22][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == TMP)
			UsingWeapon[23][id] = str_to_num(Data[2]);
		else if(str_to_num(Data[3]) == MAC10)
			UsingWeapon[24][id] = str_to_num(Data[2]);


		Save(id);
	}
	else if(MenuMod[id] == 2)
	{
		if(Chestp[id][Key] > 0 && pKey[id] > 0)
		{
			ChestOpen(id,Key);
			Menu(id);
		}
	}
	else if(MenuMod[id] == 3)
	{
		if(Key == -1)
		{
			WeaponinMarket[id] = 0;
			MarketPoints[id] = 0
			MenuMod[id] = -1;
			Menu(id);
		}
		else if(Key == 0)
		{
			if(inMarket[id] && !round[id])
			{
				inMarket[id] = false;
				WeaponinMarket[id] = 0
				MarketPoints[id] = 0
				MenuMod[id] = 3
				Menu(id)
				return PLUGIN_HANDLED;
			}
			else if(round[id] && inMarket[id])
				print_color(id, "!g%s!t Iti poti lua item-ul abia runda viitoare!",Prefix);

			else if(MarketPoints[id] > 0)
			{
				if(103 <= WeaponinMarket[id] && 113 >= WeaponinMarket[id])
				{
					get_user_name(id, Name, 31);
					print_color(0, "!g%s!t %s!y vinde !g%s!t pentru !g%d !tEURO!",Prefix, Name, ChestName[WeaponinMarket[id]-103], MarketPoints[id]);
					inMarket[id] = true;
				}
				else if(WeaponinMarket[id] == 102)
				{
					get_user_name(id, Name, 31);
					print_color(0, "!g%s!t %s!y vinde o !gcheie !tpentru !g%d !tEURO!",Prefix, Name, MarketPoints[id]);
					inMarket[id] = true;
				}
				else
				{
					get_user_name(id, Name, 31);
					if(WeaponinMarket[id] > 499)
					{
						WeaponinMarket[id] -= 500 
						print_color(0, "!g%s%L!y-!gStatTrack",Prefix, LANG_SERVER, "TOMARKET", Name, WeaponNames[WeaponinMarket[id]], MarketPoints[id]);
						WeaponinMarket[id] += 500
					}
					else
					{
						print_color(0, "!g%s%L",Prefix, LANG_SERVER, "TOMARKET", Name, WeaponNames[WeaponinMarket[id]], MarketPoints[id]);
					}
					inMarket[id] = true;
					for(new a = 0; a < WEAPONSKIN; a++)
					{
						if(WeaponinMarket[id] == UsingWeapon[a][id])
						{
							UsingWeapon[a][id] = 0
						}
					}
				}
				MenuMod[id] = 3
				Menu(id)
				round[id] = 1
			}
		}
		else if(inMarket[Key] && Points[id] >= MarketPoints[Key])
		{
			if(Key == id)
			{
				print_color(id, "!g%s!t Nu poti sa-ti cumperi item-ul tau!",Prefix);
				return PLUGIN_HANDLED;
			}
			get_user_name(Key, Name, 31);
			get_user_name(id, mName, 31);
			if(103 <= WeaponinMarket[Key] && 113 >= WeaponinMarket[Key])
			{
				print_color(0, "!g%s!t %s!y a cumparat!t %s!y cu !g%d EURO !yde la !t%s!",Prefix,mName, ChestName[WeaponinMarket[Key]-103], MarketPoints[Key], Name);
				Chestp[id][WeaponinMarket[Key]-103]++;
				Chestp[Key][WeaponinMarket[Key]-103]--;
			}
			else if(WeaponinMarket[Key] == 102)
			{
				print_color(0, "!g%s%L",
				Prefix, LANG_SERVER, "BUYMARKETKEY",
				mName, MarketPoints[Key], Name);
				pKey[id]++;
				pKey[Key]--;
			}
			else if(WeaponinMarket[Key] < 500)
			{
				print_color(0, "!g%s%L",
				Prefix, LANG_SERVER, "BUYMARKETITEM",
				mName, WeaponNames[WeaponinMarket[Key]], MarketPoints[Key], Name);
				uWeapon[WeaponinMarket[Key]][id]++;
				uWeapon[WeaponinMarket[Key]][Key]--;
			}
			else
			{
				WeaponinMarket[Key] -= 500
				print_color(0, "!g%s%L!y-!gStatTrack",
				Prefix, LANG_SERVER, "BUYMARKETITEM",
				mName, WeaponNames[WeaponinMarket[Key]], MarketPoints[Key], Name);
				uWeapon[WeaponinMarket[Key]][id]++;
				uWeapon[WeaponinMarket[Key]][Key]--;
				stattrack[WeaponinMarket[Key]][id]++
				stattrack[WeaponinMarket[Key]][Key]--
				kill[WeaponinMarket[Key]][Key] = 0
				new szWeek[3]
				get_time("%w", szWeek, sizeof(szWeek))
				coldown[WeaponinMarket[Key]][id] = str_to_num(szWeek)
			}
			Points[Key] += MarketPoints[Key];
			Points[id] -= MarketPoints[Key];
			Save(Key);
			Save(id);
			inMarket[Key] = false;
			MarketPoints[Key] = 0;
			WeaponinMarket[Key] = 0;
			MenuMod[id] = 0;
		}
	}
	else if(MenuMod[id] == 4)
	{
		trade(id)
	}
	else if(MenuMod[id] == 5)
	{
		if(Key == -1) 
		{
			aTarget[id] = 0;
		}
		if(Key == -2)
		{
			MenuMod[id] = -2;
		}
		if(Key == -3)
		{
			if(aThing[id] != WeaponinMarket[id] && 103 <= aThing[id] && 113 >= aThing[id])
			{
				Points[aTarget[id]] += aPoints[id];
				Points[id] -= aPoints[id];
				Chestp[id][aThing[id]-103]--;
				Chestp[aTarget[id]][aThing[id]-103]++;
				Save(aTarget[id]);
				Save(id);
				new Name2[32];
				get_user_name(aTarget[id], Name2, 31);
				get_user_name(id, Name, 31);
				print_color(id, "!g%s%L", Prefix, LANG_SERVER, "GIFTSUCCESS");
				print_color(aTarget[id], "!g%s!t %s!y ti-a facut cadou !g%s !ysi !g%d EURO !t%s!",Prefix, Name, ChestName[aThing[id]-103],aPoints[id], Name2);
				log_to_file( "addons/amxmodx/logs/gift.log", "%s Jucatorul: <%s>  a facut cadou %s si %d EURO lui %s", Prefix, Name, ChestName[aThing[id]-103], aPoints[id], Name2);
				MenuMod[id] = 0;
				aThing[id] = 0;
				aTarget[id] = 0;
				aPoints[id] = 0;
			}
			else if(aThing[id] == 102 && 102 != WeaponinMarket[id])
			{
				Points[aTarget[id]] += aPoints[id];
				Points[id] -= aPoints[id];
				pKey[id]--;
				pKey[aTarget[id]]++;
				Save(aTarget[id]);
				Save(id);
				new Name2[32];
				get_user_name(id, Name, 31);
				get_user_name(aTarget[id], Name2, 31);
				print_color(id, "!g%s%L", Prefix, LANG_SERVER, "GIFTSUCCESS");
				print_color(aTarget[id], "!g%s!t %s!y ti-a facut cadou o !gcheie !ysi !g%d EURO !t%s!",Prefix, Name, aPoints[id], Name2);
				log_to_file( "addons/amxmodx/logs/gift.log", "%s Jucatorul: <%s>  a facut cadou o cheie si %d EURO lui %s", Prefix, Name, aPoints[id], Name2);
				MenuMod[id] = 0;
				aThing[id] = 0;
				aTarget[id] = 0;
				aPoints[id] = 0;
			}
			else if(aThing[id] > 0)
			{
				if(aThing[id] < 500)
				{
					if(uWeapon[aThing[id]][id] > 0 && aThing[id] != WeaponinMarket[id])
					{
						uWeapon[aThing[id]][aTarget[id]]++;
						uWeapon[aThing[id]][id]--;
						for(new a = 0; a < WEAPONSKIN; a++)
						{
							if(aThing[id] == UsingWeapon[a][id])
							{
								UsingWeapon[a][id] = 0
							}
						}
						Points[aTarget[id]] += aPoints[id];
						Points[id] -= aPoints[id];
						Save(aTarget[id]);
						Save(id);
						new Name2[32];
						get_user_name(id, Name, 31);
						get_user_name(aTarget[id], Name2, 31);
						print_color(id, "!g%s%L", Prefix, LANG_SERVER, "GIFTSUCCESS");
						print_color(aTarget[id], "!g%s!t %s!y a facut un cadou ce contine !g%s !ysi !g%d EURO !t%s!",Prefix, Name, WeaponNames[aThing[id]], aPoints[id], Name2);
						log_to_file( "addons/amxmodx/logs/gift.log", "%s Jucatorul: <%s>  a facut cadou %s si %d EURO lui %s", Prefix, Name, WeaponNames[aThing[id]], aPoints[id], Name2);
						MenuMod[id] = 0;
						aThing[id] = 0;
						aTarget[id] = 0;
						aPoints[id] = 0;
					}
				}
				else if(aThing[id] > 500)
				{
					new as = aThing[id]
					aThing[id] -= 500
					if(uWeapon[aThing[id]][id] > 0 && (aThing[id] != WeaponinMarket[id]||as != WeaponinMarket[id]))
					{
						uWeapon[aThing[id]][aTarget[id]]++;
						uWeapon[aThing[id]][id]--;
						stattrack[aThing[id]][aTarget[id]]++
						stattrack[aThing[id]][id]--
						kill[aThing[id]][id] = 0
						for(new a = 0; a < WEAPONSKIN; a++)
						{
							if(aThing[id] == UsingWeapon[a][id])
							{
								UsingWeapon[a][id] = 0
							}
						}
						Points[aTarget[id]] += aPoints[id];
						Points[id] -= aPoints[id];
						Save(aTarget[id]);
						Save(id);
						new Name2[32];
						get_user_name(id, Name, 31);
						get_user_name(aTarget[id], Name2, 31);
						print_color(id, "!g%s%L", Prefix, LANG_SERVER, "GIFTSUCCESS");
						print_color(aTarget[id], "!g%s!t %s!y a facut un cadou ce contine !g%s!y(!gStatTrack!y) !ysi !g%d EURO !t%s!",Prefix, Name, WeaponNames[aThing[id]], aPoints[id], Name2);
						log_to_file( "addons/amxmodx/logs/gift.log", "%s Jucatorul: <%s>  a facut cadou %s(StatTrack) si %d EURO lui %s", Prefix, Name, WeaponNames[aThing[id]], aPoints[id], Name2);
						MenuMod[id] = 0;
						aThing[id] = 0;
						aTarget[id] = 0;
						aPoints[id] = 0;
					}
				}
			}
			else
			{
				Points[aTarget[id]] += aPoints[id];
				Points[id] -= aPoints[id];
				Save(aTarget[id]);
				Save(id);
				new Name2[32];
				get_user_name(id, Name, 31);
				get_user_name(aTarget[id], Name2, 31);
				print_color(id, "!g%s%L", Prefix, LANG_SERVER, "GIFTSUCCESS");
				print_color(aTarget[id], "!g%s!t %s!y ti-a facut cadou !g%d EURO !t%s!",Prefix, Name, aPoints[id], Name2);
				log_to_file( "addons/amxmodx/logs/gift.log", "%s Jucatorul: <%s>  a facut cadou %d EURO lui %s", Prefix, Name, aPoints[id], Name2);
				MenuMod[id] = 0;
				aThing[id] = 0;
				aTarget[id] = 0;
				aPoints[id] = 0;
			}
			
		}
		if(Key == -4)
		{
			client_cmd(id, "messagemode Gift");
		}
		if(Key > 0)
			aTarget[id] = Key;

		Menu(id);
	}
	else if(MenuMod[id] == 6)
	{
		if(!ruleta)
		{
			if(!is_user_alive(id))
				ruletta(id)
			else
				print_color(id, "!g%s!t Nu poti accesa !gruleta !tcand esti !gVIU!",Prefix);
		}
	}
	else if(MenuMod[id] == 7)
	{
		if(!jackpot)
		{
			if(!is_user_alive(id))
				jackkpot(id)
			else
				print_color(id, "!g%s!t Nu poti accesa !gjackpot-ul !tcand esti !gVIU!",Prefix);
		}
	}
	else if(MenuMod[id] == 8)
	{
		bet(id)
	}
	else if(MenuMod[id] == 9)
	{
		contract(id)
	}
	else if(MenuMod[id] == 10)
	{
		sterge(id)
	}
	else if(MenuMod[id] == 11)
	{
		if(!is_user_alive(id))
		{
			crashi[id] = 1
		}
		else
			print_color(id, "!g%s!t Nu poti accesa !gcrash-ul !tcand esti !gVIU!",Prefix);
	}
	else if(MenuMod[id] == 12)
	{
		if(!is_user_alive(id))
		{
			coinflip(id)
		}
		else
			print_color(id, "!g%s!t Nu poti accesa !gcoinflip-ul !tcand esti !gVIU!",Prefix);
	}
	else if(MenuMod[id] == 13)
	{
		if(!PromoUse[id])
		{
			client_cmd(id, "messagemode PromoCode");
		}
		else
			print_color(id, "!g%s!t Ai folosit deja un promocode!",Prefix);
	}
	return PLUGIN_CONTINUE;
}
//---------------------------------------Coinflip------------------------//
public coinflip(id)
{

	new Line[120];

	formatex(Line,119, "\rCoinflip^n");

	new cMenu = menu_create(Line, "CoinHandle");

	if(coinflippoint[id] == 0 && coinflipstar[id] == -1)
	{
		formatex(Line,119, "Add bet");
		menu_additem(cMenu, Line, "1");
	}
	else
	{
		formatex(Line,119, "\dAdd bet");
		menu_additem(cMenu, Line, "0");
	}
	if(coinflippoint[id] > 0 && coinflipstar[id] == -1)
	{
		formatex(Line,119, "Remove bet");
		menu_additem(cMenu, Line, "2");
	}
	else
	{
		formatex(Line,119, "\dRemove bet");
		menu_additem(cMenu, Line, "0");
	}
	formatex(Line,119, "List bet");
	menu_additem(cMenu, Line, "3");

	menu_display(id, cMenu, 0);
}
public CoinHandle(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT)
	{
		menu_destroy ( gMenu );
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(Key == 1)
	{
		if(coinflippoint[id] == 0 && coinflipstar[id] == -1)
		{
			client_cmd(id, "messagemode Coinflip");
		}
	}
	else if(Key == 2)
	{
		if(coinflippoint[id] > 0 && coinflipstar[id] == -1)
		{
			Points[id] += coinflippoint[id]
			Save(id)
			coinflippoint[id] = 0
			coinflip(id)
		}	
	}	
	else if(Key == 3)
	{
		coinflipi[id] = 1
	}
	return PLUGIN_CONTINUE;
}
public coinflipss(id,player)
{
	if(is_user_connected(player))
	{
		static Line[120],name[33],Float:time;
		if(time == 0.0)
			time = get_gametime()

		if(coinflipstar[id] > 0)
		{
			coinflipstart[id]++
			if(coinflipstart[id] == 10)
			{
				coinflipstart[id] = 0
				coinflipstar[id]--
			}

			formatex(Line,119, "\rCoinflip^n\wIncepe in %d secunde",coinflipstar[id]);
		}
		else
		{
			formatex(Line,119, "\rCoinflip");
			if(coinflipwiner[id] > 0)
				coinflipwiner[id]--
		}

		new cMenu = menu_create(Line, "CoinHandless");

		get_user_name(id,name,32)
		if(coinflipwin[id] == id)
		{
			formatex(Line,119, "\r[\y%s\r]",name);
			menu_additem(cMenu, Line, "1");
		}
		else
		{
			formatex(Line,119, "%s",name);
			menu_additem(cMenu, Line, "1");
		}
		get_user_name(player,name,32)
		if(coinflipwin[id] == player)
		{
			formatex(Line,119, "\r[\y%s\r]",name);
			menu_additem(cMenu, Line, "1");
		}
		else
		{
			formatex(Line,119, "%s",name);
			menu_additem(cMenu, Line, "1");
		}
		if(time !=get_gametime() && coinflipstar[id] == 0)
		{
			time = get_gametime()
			if(coinflipwin[id] == id && coinflipwiner[id] > 0)
			{
				coinflipwin[id] = player
				coinflipwin[player] = player
			}
			else if(coinflipwin[id] == player && coinflipwiner[id] > 0)
			{
				coinflipwin[id] = id
				coinflipwin[player] = id
			}
			else if(coinflipwiner[id] == 0)
			{
				if(!task_exists(coinflipp[id]+13331) && !task_exists(id+13331))
					set_task(1.0,"winer",id+13331)

				new name[33]
				get_user_name(coinflipwin[id],name,32)
				client_cmd(coinflipwin[id], "stopsound")
				client_cmd(coinflipwin[id], "mp3 stop")
				client_cmd(coinflipwin[id], "spk %s",Sunete[2])

				client_cmd((coinflipwin[id] == id ? player : id), "stopsound")
				client_cmd((coinflipwin[id] == id ? player : id), "mp3 stop")
				client_cmd((coinflipwin[id] == id ? player : id), "spk %s",Sunete[1])
				print_color(id, "!g%s!t Castigatorul este !g%s",Prefix,name);
				print_color(coinflipp[id], "!g%s!t Castigatorul este !g%s",Prefix,name);
			}
		}

		menu_display(id, cMenu, 0);
	}
}
public winer(id)
{
	id -= 13331
	Points[coinflipwin[id]] += coinflippoint[id]*2
	Save(id)
	Save(coinflipp[id])
	coinflippoint[coinflipp[id]] = 0
	coinflippoint[id] = 0
	coinflipwiner[id] = 0
	coinflipwiner[coinflipp[id]] = 0
	coinflipwin[id] = 0
	coinflipwin[coinflipp[id]] = 0
	coinflipi[id] = 0
	coinflipi[coinflipp[id]] = 0
	coinflipstart[id] = -1
	coinflipstart[coinflipp[id]] = -1
	coinflipstar[id] = -1
	coinflipstar[coinflipp[id]] = -1
	coinflipp[coinflipp[id]] = 0
	coinflipp[id] = 0
}
public CoinHandless(id, gMenu, Key)	return PLUGIN_CONTINUE;
public coinflips(id)
{
	static Line[120],i,All,name[33],String[8];
	All = 0

	formatex(Line,119, "\rCoinflip^n");

	new cMenu = menu_create(Line, "CoinHandles");

	formatex(Line,119, "Exit");
	menu_additem(cMenu, Line, "0");

	for(i=0;i<32;i++)
	{
		if(is_user_connected(i))
		{
			if(coinflippoint[i] > 0 && coinflipstar[i] == -1 && i == id)
			{
				get_user_name(i,name,32)
				formatex(Line,119, "%d\r[\y%s\r]",coinflippoint[i],name);
				menu_additem(cMenu, Line, "-1");
				All++
			}
			else if(coinflippoint[i] > 0 && coinflipstar[i] == -1)
			{
				num_to_str(i, String, 8);
				get_user_name(i,name,32)
				formatex(Line,119, "%d\r[\y%s\r]",coinflippoint[i],name);
				menu_additem(cMenu, Line, String);
				All++
			}
		}
	}
	if(All == 0)
	{
		formatex(Line,119, "Momentan nu a pariat nimeni la coinflip");
		menu_additem(cMenu, Line, "-1");
	}
	menu_display(id, cMenu, 0);
}
public CoinHandles(id, gMenu, Key)
{	
	hide(mure)
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(Key == 0)
	{
		if(coinflipstar[id] == -1)
		{
			coinflipi[id] = 0
		}
	}
	else if(Key > 0)
	{
		if(Points[id] >= coinflippoint[Key] && coinflipstar[id] == -1 && coinflipstar[Key] == -1 && coinflippoint[id] == 0)
		{
			Points[id] -= coinflippoint[Key]
			Save(id)
			coinflippoint[id] = coinflippoint[Key]
			coinflipstar[id] = 10
			coinflipstar[Key] = 10
			coinflipp[id] = Key
			coinflipp[Key] = id
			new a = random_num(50,70)
			coinflipwiner[id] = a
			coinflipwiner[Key] = a
			coinflipwin[id] = Key
			coinflipwin[Key] = Key
			coinflipi[id] = 2
			coinflipi[Key] = 2
		}	
	}	
	return PLUGIN_CONTINUE;
}
//---------------------------------------Crash---------------------------//
public Coinflipbet(id)
{
	hide(mure)
	if(coinflippoint[id] != 0||coinflipstar[id] != -1)
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost > Points[id] || Cost < 500)
	{
		client_cmd(id, "messagemode Coinflip");
		return PLUGIN_HANDLED;
	}
	else
	{
		coinflippoint[id] = Cost;
		Points[id] -= Cost
		Save(id)
		coinflipstar[id] = -1
		coinflip(id)
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public Crashbet(id)
{
	hide(mure)
	if(crashpoint[id] > 0||crashstart == 1)
		return PLUGIN_HANDLED;
		
	new Data[32], Cost;
	read_args(Data, 31);
	remove_quotes(Data);
	
	Cost = str_to_num(Data);
	
	if(Cost > Points[id] || Cost < 100)
	{
		client_cmd(id, "messagemode Crash");
		return PLUGIN_HANDLED;
	}
	else
	{
		crashpoint[id] = Cost;
		Points[id] -= Cost
		Save(id)
		if(crashstart == 0)
		{
			print_color(id, "!g%s!t Crash-ul !ya inceput!Pariaza rapid!!!!",Prefix);
			crashstart = 15
		}
		
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public AutoCrashbet(id)
{
	hide(mure)
	if(crashpoint[id] > 0||crashstart == 1)
		return PLUGIN_HANDLED;
		
	new Data[32]
	read_args(Data, 31);
	remove_quotes(Data);
	
	new a
	for(new i;i<strlen(Data);i++)
	{
		if(a == 1)
		{
			Data[i+1] = '^0'
			break
		}
		if(Data[i] == '.')
			a = 1

	}
	if(equal(Data,"1")||equal(Data,"1.0"))
	{
		formatex(crashauto[id],8,"1.0")
		return 1;
	}
	new Float:Cost = str_to_float(Data)
	Cost+=0.000001
	if(Cost < 1.1)
	{
		client_cmd(id, "messagemode AutoCrash");
		return PLUGIN_HANDLED;
	}
	else
	{
		formatex(crashauto[id],8,Data)
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}
public crashhh()
{
	static i,a,b,c,d,e,f,g,h,j,k[8],z,w
	a = 0
	b = 0
	z = 0
	float_to_str(crashtime,k,7)
	for(w = 0;w<strlen(k);w++)
	{
		if(z == 1)
		{
			k[w+1] = '^0'
			break
		}
		if(k[w] == '.')
			z = 1

	}
	for(i=0;i<32;i++)
	{
		if(is_user_connected(i))
		{
			if(crashstart == 0)
			{
				crashpoint[i] = 0
			}
			else if(crashpoint[i] > 0)
			{
				a+=crashpoint[i]
				b++
				if(equal(crashauto[i],k) && crashtime > 1.0)
				{
					new Float:z = float(crashpoint[i])*crashtime
					Points[i] += floatround(z)
					crashwin[i] = floatround(z)
					crashpoint[i] = -1
					Save(i)
				}
			}
		}
	}
	for(i=0;i<32;i++)
	{
		if(is_user_connected(i))
		{
			if(coinflipi[i] == 1)
			{
				coinflips(i)
			}
			else if(coinflipi[i] == 2)
			{
				coinflipss(i,coinflipp[i])
			}
			if(crashi[i] == 1)
			{
				crashh(i,a,b)
			}
		}
	}
	if(crashstart > 1)
	{
		c++
		if(c == 10)
		{
			crashstart--
			c = 0
			if(crashstart == 1)
			{
				f = random_num(2,5)
				h = random_num(8,10)
			}
		}
	}
	else if(crashstart == 1)
	{
		j++
		g++
		if(g <= f)
		{
			if(random_float(0.0,20.0) >= 20.0-crashtime)
			{
				crashstart = -1
				e = 0
				g = 0
				j = 0
			}
		}
		if(e == h && crashstart != -1)
		{
			crashtime+=0.1
			if(crashtime == 1.2)
				h = random_num(8,9)
			else if(crashtime == 1.5)
				h = random_num(6,7)
			else if(crashtime == 2.0)
				h = random_num(4,5)
			else if(crashtime > 2.5)
				h = random_num(2,3)

			e = 0
		}
		else if(crashstart != -1)
			e++

		if(j == 10)
		{
			j = 0
			g = 0
		}
	}
	else if(crashstart == -1)
	{
		d++
		if(d == 50)
		{
			crashstart = 0
			crashtime = 1.0
			d = 0
		}
	}
}
public crashh(id,a,b)
{
	static Line[508],String[100];
	formatex(Line,507,"")
	formatex(String, 99, "\rCrash \w- Pot de \r%d EURO^n",a);
	add(Line, 507, String);
	formatex(String, 99, "\yParticipanti %d^n",b);
	add(Line, 507, String);
	if(crashstart == 1)
		formatex(String, 99, "X\y%0.1f^n",crashtime);
	else if(crashstart > 1)
		formatex(String, 99, "\yIncepe in %d secunde^n",crashstart);
	else if(crashstart == -1)
		formatex(String, 99, "\yCrash la %0.1f^n",crashtime);
	else
		formatex(String, 99, "Pentru a incepe trebuie sa participe minim 1^n");

	add(Line, 507, String)

	formatex(String, 99, "%s Auto-Cashout \r",(!equal(crashauto[id],"1.0") ? "ON" : "OFF"));
	add(Line, 507, String)
	formatex(String, 99, "x%s^n\wPentru a opri Auto-Cashout seteaza valoarea 1^n",crashauto[id]);
	add(Line, 507, String)
	if(crashpoint[id] > 0 && crashstart == 1)
	{
		formatex(String, 99, "\yProfit %d^n",floatround(float(crashpoint[id])*crashtime));
		add(Line, 507, String)
	}
	else if(crashpoint[id] == -1)
	{
		formatex(String, 99, "\yAi scos %d^n",crashwin[id]);
		add(Line, 507, String)
	}
	else if(crashstart == -1 && crashpoint[id] > 0)
	{
		formatex(String, 99, "\yAi pierdut %d, felicitari :)))^n",floatround(float(crashpoint[id])*crashtime));
		add(Line, 507, String)
	}


	new cMenu = menu_create(Line, "CrashHandle");

	if(crashpoint[id] == 0 && (crashstart > 1||crashstart == 0))
	{
		formatex(Line, 507, "Add bet");
		menu_additem(cMenu, Line, "1");
	}
	else
	{
		formatex(Line, 507, "\dAdd bet");
		menu_additem(cMenu, Line, "0");
	}
	if(crashpoint[id] > 0 && crashstart == 1)
	{
		formatex(Line, 507, "Cashout");
		menu_additem(cMenu, Line, "2");
	}
	else
	{
		formatex(Line, 507, "\dCashout");
		menu_additem(cMenu, Line, "0");
	}
	if(crashpoint[id] == 0 && (crashstart > 1||crashstart == 0))
	{
		formatex(Line, 507, "Auto-Cashout");
		menu_additem(cMenu, Line, "3");
	}
	else
	{
		formatex(Line, 507, "\dAuto-Cashout");
		menu_additem(cMenu, Line, "0");
	}

	formatex(Line, 507, "Exit");
	menu_additem(cMenu, Line, "4");
	menu_setprop( cMenu, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( cMenu, MPROP_NEXTNAME, "")
	menu_setprop( cMenu, MPROP_BACKNAME, "")
	menu_setprop( cMenu, MPROP_EXITNAME, "")
	menu_display(id, cMenu, 0);
}
public CrashHandle(id, gMenu, Key)
{	
	hide(mure)
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(Key == 1)
	{
		if(crashpoint[id] == 0 && (crashstart > 1||crashstart == 0))
			client_cmd(id, "messagemode Crash");
	}

	else if(Key == 2)
	{
		if(crashpoint[id] > 0 && crashstart == 1)
		{
			Points[id] += floatround(float(crashpoint[id])*crashtime)
			crashwin[id] = floatround(float(crashpoint[id])*crashtime)
			crashpoint[id] = -1
			Save(id)
		}
	}

	else if(Key == 3)
	{
		if(crashpoint[id] == 0 && (crashstart > 1||crashstart == 0))
			client_cmd(id, "messagemode AutoCrash");	
	}	
	else if(Key == 4)
	{
		menu_destroy(gMenu);
		crashi[id] = 0
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
//---------------------------------------Sterge--------------------------//
public sterge(id)
{
	hide(mure)
	new zMenu = menu_create("Selecteaza itemul", "stergem");
	new String[32], All, Line[128];
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
			continue;

		if(stattrack[i][id])
		{
			new bda
			bda = i+500
			formatex(String, 31, "%d", bda);
			formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
			menu_additem(zMenu, Line, String);
		}
		if(uWeapon[i][id] > stattrack[i][id])
		{
			new dsa = uWeapon[i][id]-stattrack[i][id]
			num_to_str(i, String, 31);
			formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
			menu_additem(zMenu, Line, String);
		}
		All++;
	}
	menu_setprop(zMenu, MPROP_EXIT, MEXIT_ALL)  
	menu_display(id, zMenu, 0);
}
public stergem(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT)
	{
		menu_destroy ( gMenu );
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
			continue;

		if(Key == i)
		{
			uWeapon[i][id]--
			print_color(id, "!g%s!t Ai sters skinul !g%s!t!",Prefix, WeaponNames[i]);
		}

		else if(Key == i+500)
		{
			uWeapon[i][id]--
			stattrack[i][id]--
			print_color(id, "!g%s!t Ai sters skinul !g%s(StatTrack)!t!",Prefix, WeaponNames[i]);
		}
		Save(id)
	}
			

	return PLUGIN_CONTINUE;
}
//--------------------------------------Contract-----------------------------------//
public contract(id)
{
	hide(mure)
	new All, Alls, String[32],Line[128];
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1|| WeaponDrop[i] <= 10)
			continue;

		All += uWeapon[i][id]-stattrack[i][id];
		Alls += stattrack[i][id];
	}
	if(tradeup[id] > 0)
		All += tradeup[id]

	if(All < 10 && Alls < 10)
	{
		if(Alls > 0)
			print_color(id, "!g%s!t Ai nevoie de 10 skinuri iar tu ai %d si %d stattrack!",Prefix,All,Alls);
		else
			print_color(id, "!g%s!t Ai nevoie de 10 skinuri iar tu ai %d!",Prefix,All);
		MenuMod[id] = 0
		Menu(id)
		return 1;
	}
	All = 0
	new fol[MAX+1]
	new fol2[MAX+1]
	if(tradeup[id] > 0)
		formatex(Line, 127, "Trade Up Contract [%d/10]^nPress 0 for cancel contract",tradeup[id]);
	else if(tradeups[id] >0)
		formatex(Line, 127, "Trade Up Contract [%d/10]^nPress 0 for cancel contract",tradeups[id]);

	else
		formatex(Line, 127, "Trade Up Contract [0/10]^nPress 0 for cancel contract");
	new Menu = menu_create(Line, "tradeupm");
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1|| WeaponDrop[i] <= 10)
			continue;

		if(tradeup[id] != 0)
		{
			for(new a = 0; a < tradeup[id]; a++)
			{
				new dsaa = uWeapon[i][id]-stattrack[i][id]
				if(dsaa && fol[i] == 0)
				{
					num_to_str(i, String, 31);
					formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsaa);
					menu_additem(Menu, Line, String);
					fol[i] = 1
				}
			}
		}
		else if(tradeups[id] != 0)
		{
			for(new a = 0; a < tradeups[id]; a++)
			{
				new dre = i+500 
				if(stattrack[i][id] && fol2[i] == 0)
				{
					formatex(String, 31, "%d", dre);
					formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
					menu_additem(Menu, Line, String);
					fol2[i] = 1
				}
			}
		}
		else
		{
			if(stattrack[i][id])
			{
				new bda
				bda = i+500
				formatex(String, 31, "%d", bda);
				formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(Menu, Line, String);
			}
			if(uWeapon[i][id] > stattrack[i][id])
			{
				new dsa = uWeapon[i][id]-stattrack[i][id]
				num_to_str(i, String, 31);
				formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
				menu_additem(Menu, Line, String);
			}
		}
	} 
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)  
	menu_display(id, Menu, 0);
	return 0;
}
public tradeupm(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT)
	{
		menu_destroy ( gMenu );
		if(tradeup[id] != 0 && !task_exists(id+54354))
		{
			for(new i = 1; i < AllWeapon; i++)
			{
				for(new a = 0; a < tradeup[id]; a++)
				{
					if(contr[a][id] == i)
					{
						uWeapon[i][id]++
					}
					if(contr[a][id] == i+500)
					{
						uWeapon[i][id]++
						stattrack[i][id]++
					}
				}
			}
		}
		MenuMod[id] = 0
		Menu(id)
		tradeup[id] = 0
		tradeups[id] = 0
		Save(id)
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(tradeup[id] < 10)
	{
		if(Key < 500)
		{
			contr[tradeup[id]][id] = Key
			uWeapon[Key][id]--
			tradeup[id]++;
			contract(id);
		}
		else
		{
			contr[tradeup[id]][id] = Key
			new a = Key-500
			uWeapon[a][id]--
			stattrack[a][id]--
			tradeups[id]++;
			contract(id);
		}
		if(tradeup[id] == 10||tradeups[id] == 10)
			gocontract(id)

		Save(id)

	}
	else
		contract(id);

	Save(id);

	return PLUGIN_CONTINUE;
}
public gocontract(id)
{
	hide(mure)
	client_print(id, print_center, "Trade Up Contract procesare ...")
	set_task(3.0, "pickup", id+54354)
}
public pickup(id)
{
	hide(mure)
	id -= 54354
	new b,c,e,All
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0)
			continue;

		for(new a = 0; a < tradeup[id]; a++)
		{
			if(contr[a][id] == i||contr[a][id] == i+500)
			{
				b += WeaponDrop[i]
			}
		}
	}
	c = random_num(1, 8)
	new dasd = random_num(0,1)

	if(c == 4)
	{
		if(dasd)
			c++
		else
			c--
	}
	else if(c == 6)
	{
		if(dasd)
			c++
		else
			c--
	}

	for(new i = 1; i < AllWeapon; i++)
	{
		if(All)
			continue;

		e = WeaponDrop[i]
		if(c == e)
		{
			new name[32]
			get_user_name(id, name, 31)
			if(tradeups[id] > 0)
			{
				uWeapon[i][id]++
				stattrack[i][id]++
				print_color(0, "!g[CSGO DEADLY] !tPlayerul !g%s !ta facut un contract si a obtinut %s(StatTrack)", name, WeaponNames[i]);
			}
			else
			{
				uWeapon[i][id]++
				print_color(0, "!g[CSGO DEADLY] !tPlayerul !g%s !ta facut un contract si a obtinut %s", name, WeaponNames[i]);
			}
			All++
			client_cmd(id, "stopsound")
			client_cmd(id, "mp3 stop")
			client_cmd(id, "spk %s",Sunete[3])
		}
	}
	for(new a = 0; a < tradeup[id]; a++)
	{
		contr[a][id] = 0
	}
	Save(id);
	tradeup[id] = 0
	tradeups[id] = 0
	MenuMod[id] = 0
	Menu(id)
}
//-----------------------------------------Bet----------------------------------//
public bet(id)
{
	hide(mure)
	if(pbet[id])
	{
		print_color(id, "!g%s!t Ai pariat deja pe echipa %s!",Prefix,TeamNames[pbet[id]]);
		MenuMod[id] = 0
		Menu(id)
		return 1;
	}
	if(bround > 4)
	{
		print_color(id, "!g%s!t Nu mai poti paria pe echipe!",Prefix);
		MenuMod[id] = 0
		Menu(id)
		return 1;
	}
	new Menu = menu_create("Bet Team", "betm");
	menu_additem(Menu, "Terrorist", "0");
	menu_additem(Menu, "Counter-Terrorist", "1");
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)  
	menu_display(id, Menu, 0);
	return 0;
}
public betm(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT || bround > 4) 
	{
		menu_destroy ( menu );
		MenuMod[id] = 0
		Menu(id)
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	switch(Key)
	{ 
		case 0:
		{
			print_color(id, "!g%s!t Scrie suma pe care pariezi!",Prefix);
			client_cmd(id, "messagemode T");
		}
		case 1:
		{
			print_color(id, "!g%s!t Scrie suma pe care pariezi!",Prefix);
			client_cmd(id, "messagemode CT");
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
//------------------------------------JackPot-------------------------------------------//
public jackkpot(id)
{
	hide(mure)
	new Line[128]
	if(inJack[id])
	{
		if(playj >= 2 && secs >= 10)
			formatex(Line, 127, "Jackpot[\dSansa ta de castig: \y10%%\w]^nJackpot-ul porneste in %d secunde", secs);
		else
			formatex(Line, 127, "Jackpot[\dSansa ta de castig: \y10%%\w]^n^nAsteptam decizia...");
	}
	else
	{
		if(playj >= 2 && secs >= 10)
			formatex(Line, 127, "Jackpot[\dSansa ta de castig: \y0\w]^nJackpot-ul porneste in %d secunde", secs);
		else
			formatex(Line, 127, "Jackpot[\dSansa ta de castig: \y0\w]^nAsteptam decizia...");
	}
	new Menu = menu_create(Line, "JackpotHandlers");

	if(!inMarket[id] && !WeaponinMarket[id] && !inJack[id])
	{
		formatex(Line, 127, "Add item");
		menu_additem(Menu, Line, "0");
	}
	else
	{
		formatex(Line, 127, "Add item%L", LANG_SERVER, "INMARKET");
		menu_additem(Menu, Line, "-2");
	}
	formatex(Line, 127, "Refresh");
	menu_additem(Menu, Line, "-1");
	new Name[32], String[32];
	for(new x; x < 32; x++)
	{
		if(!is_user_connected(x))
			continue;
			
		if(inJack[x])
		{
			num_to_str(x, String, 31);
			get_user_name(x, Name, 31);
			if(103 <= jack[x] && 113 >= jack[x])
			{
				formatex(Line, 127, "%s\y[%s]", ChestName[jack[x]-103],Name);
				menu_additem(Menu, Line, String);
			}
			else if(102 == jack[x])
			{
				formatex(Line, 127, "Key\y[%s]", Name);
				menu_additem(Menu, Line, String);
			}
			else if(jack[x] > 0)
			{
				if(jack[x] < 500)
				{
					formatex(Line, 127, "%s\r\B[%s]", WeaponNames[jack[x]], Name);
					menu_additem(Menu, Line, String);
				}
				else if(jack[x] > 500)
				{
					formatex(Line, 127, "%s\w-\rStatTrack\r\B[%s]", WeaponNames[jack[x]-500], Name);
					menu_additem(Menu, Line, String);
				}
			}
		}
	}
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
	viewj[id] = 1
}
public JackpotHandlers(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT || jackpot) 
	{
		menu_destroy ( menu );
		MenuMod[id] = 0
		Menu(id)
		viewj[id] = 0
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	switch(Key)
	{ 
		case -1:
		{
			jackkpot(id);
		}
		case 0:
		{
			if(jack[id] == 0)
				addjack(id);
			else
				jackkpot(id);
		}
		default:
		{
			jackkpot(id)
		}
	}
	return PLUGIN_HANDLED;
}
public addjack(id)
{
	hide(mure)
	new Line[128]
	formatex(Line, 127, "%s\r Alege un item pentru jackpot",Prefix);
	new Menu = menu_create(Line, "AddHandlert");
	new All, String[32];
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
			continue;

		if(stattrack[i][id])
		{
			new bda
			bda = i+500
			formatex(String, 31, "%d", bda);
			formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
			menu_additem(Menu, Line, String);
		}
		if(uWeapon[i][id] > stattrack[i][id])
		{
			new dsa = uWeapon[i][id]-stattrack[i][id]
			num_to_str(i, String, 31);
			formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
			menu_additem(Menu, Line, String);
		}
		All++;
	}
	for(new i;i<chestcount;i++)
	{
		if(Chestp[id][i] > 0)
		{
			formatex(Line, charsmax(Line), "\r%s", ChestName[i]);
			new calcul = -2-i
			new numars[16]
			num_to_str(calcul,numars,15)
			menu_additem(Menu, Line, numars);
			All++;
		}
	}
	if(pKey[id] > 0)
	{
		formatex(Line, 127, "Cheie");
		menu_additem(Menu, Line, "-1");
		All++;
	}
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
	if(All == 0)
	{
		print_color(id, "!g%s!y Nu ai nici un obiect!",Prefix);
		jackkpot(id);
	}
}
public AddHandlert(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT||playj == 10)
	{
		menu_destroy ( gMenu );
		jackkpot(id);
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(Key <= -2)
	{
		Key+= 2
		Key*= -1
		jack[id] = 103+Key
		jackkpot(id);
	}
	else if(Key == -1)
	{
		jack[id] = 102
		jackkpot(id);
	}
	else
	{
		if(Key < 500)
		{
			jack[id] = Key
			for(new a = 0; a < WEAPONSKIN; a++)
			{
				if(jack[id] == UsingWeapon[a][id])
				{
					UsingWeapon[a][id] = 0
				}
			}
		}
		else
		{
			jack[id] = Key-500
			for(new a = 0; a < WEAPONSKIN; a++)
			{
				if(jack[id] == UsingWeapon[a][id])
				{
					UsingWeapon[a][id] = 0
				}
			}
			jack[id] += 500
		}
		jackkpot(id);
	}	
	inJack[id] = 1
	itemj[playj] = id
	playj++
	if(playj >= 2 && secs == 60)
		playjack()

	return PLUGIN_CONTINUE;
}
public playjack()
{
	hide(mure)
	secs = 60
	print_color(0, "!g%s!t Jackpot-ul a pornit!",Prefix);
	set_task(1.0, "CnTT", 1534555, _, _, "b");
}
public CnTT()
{
	hide(mure)
	if(secs != 0)
	{
		secs--
	}
	else
	{
		remove_task(1534555)
		new id = fnGetRandom()
		if(!is_user_connected(id))
			id = fnGetj()

		playj = 0
		new Name[32]
		get_user_name(id, Name, 31)
		print_color(0, "!g%s!t Castigatorul !gjackpot-ului !teste %s!",Prefix, Name);
		print_color(0, "!g%s!t Jackpot-ul este !gblocat !tpentru 5 minute!",Prefix);
		client_cmd(id, "stopsound")
		client_cmd(id, "mp3 stop")
		client_cmd(id, "spk %s",Sunete[4])
		jackpot = 1
		set_task(300.0, "unplayj", 132311)

		for(new x; x < 32; x++)
		{
			if(!is_user_connected(x))
				continue;
			
			if(inJack[x])
			{
				if(103 <= jack[x] && 113 >= jack[x])
				{
					Chestp[x][jack[x]-103]--
					Chestp[id][jack[x]-103]++
				}
				else if(102 == jack[x])
				{
					pKey[x]--
					pKey[id]++
				}
				else if(jack[x] < 500)
				{
					uWeapon[jack[x]][x]--
					uWeapon[jack[x]][id]++
				}
				else if(jack[x] > 500)
				{
					jack[x] -= 500
					uWeapon[jack[x]][x]--
					uWeapon[jack[x]][id]++
					stattrack[jack[x]][x]--
					stattrack[jack[x]][id]++
					kill[jack[x]][x] = 0
				}
				inJack[x] = 0
				jack[x] = 0
				MenuMod[x] = 0
				Menu(id)
				Save(x)
				Save(id)
			}
		}
		for(new a = 0; a <= playj; a++)
		{
			if(itemj[a] != 0)
			{
				itemj[a] = 0
			}
		}
		inJack[id] = 0
		jack[id] = 0
		Save(id)
	}
}
public unplayj()
{
	hide(mure)
	jackpot = 0
	secs = 60
	print_color(0, "!g%s!g Jackpot-ul !teste deschis acum!",Prefix);
}
//----------------------------------------------------------Ruleta-------------------------------------------------//
public playruleta()
{
	hide(mure)
	sec = 60
	print_color(0, "!g%s!t Ruleta a pornit!",Prefix);
	set_task(1.0, "CnT", 1534554, _, _, "b");
}
public CnT()
{
	hide(mure)
	if(sec != 0)
	{
		sec--
		if(sec == 1)
		{
			client_cmd(0, "stopsound")
			client_cmd(0, "mp3 stop")
			client_cmd(0, "spk %s",Sunete[5])
		}
	}
	else
	{
		new a = random_num(0,14)
		if(a < 8 && a > 0)
		{
			formatex(nr[6], 7, "%s", nr[5]);
			formatex(nr[5], 7, "%s", nr[4]);
			formatex(nr[4], 7, "%s", nr[3]);
			formatex(nr[3], 7, "%s", nr[2]);
			formatex(nr[2], 7, "%s", nr[1]);
			formatex(nr[1], 7, "%s", nr[0]);
			formatex(nr[0], 7, "\r%d",a);
			for(new i; i < 32; i++)
			{
				if(is_user_connected(i))
				{
					Rosu[i] *= 2
					Galben[i] = 0
					Gri[i] = 0
					Points[i] += Rosu[i]+Galben[i]+Gri[i]
					Rosu[i] = 0
					Save(i)
				}
			}
			print_color(0, "!g%s!t Numarul primit de la ruleta este: !g%d!t Rosu!y!",Prefix, a);
		}
		else if(a > 7 && a < 15)
		{
			formatex(nr[6], 7, "%s", nr[5]);
			formatex(nr[5], 7, "%s", nr[4]);
			formatex(nr[4], 7, "%s", nr[3]);
			formatex(nr[3], 7, "%s", nr[2]);
			formatex(nr[2], 7, "%s", nr[1]);
			formatex(nr[1], 7, "%s", nr[0]);
			formatex(nr[0], 7, "\d%d",a);
			for(new i; i < 32; i++)
			{
				if(is_user_connected(i))
				{
					Rosu[i] = 0
					Galben[i] = 0
					Gri[i] *= 2
					Points[i] += Rosu[i]+Galben[i]+Gri[i]
					Gri[i] = 0
					Save(i)
				}
			}
			print_color(0, "!g%s!t Numarul primit de la ruleta este: !g%d!t Gri!y!",Prefix, a);
		}
		else if(a == 0)
		{
			formatex(nr[6], 7, "%s", nr[5]);
			formatex(nr[5], 7, "%s", nr[4]);
			formatex(nr[4], 7, "%s", nr[3]);
			formatex(nr[3], 7, "%s", nr[2]);
			formatex(nr[2], 7, "%s", nr[1]);
			formatex(nr[1], 7, "%s", nr[0]);
			formatex(nr[0], 7, "\y%d",a);
			for(new i; i < 32; i++)
			{
				if(is_user_connected(i))
				{
					Rosu[i] = 0
					Galben[i] *= 14
					Gri[i] = 0
					Points[i] += Rosu[i]+Galben[i]+Gri[i]
					Galben[i] = 0
					Save(i)
				}
			}
			print_color(0, "!g%s!t Numarul de la ruleta este: !g%d!t Galben!y!",Prefix, a);
		}
		playr = 0
		print_color(0, "!g%s!g Ruleta !teste !ginchisa !tpentru 5 minute!",Prefix);
		remove_task(1534554)
		ruleta = 1
		set_task(300.0, "unplay", 13231)
	}
}
public unplay()
{
	hide(mure)
	ruleta = 0
	sec = 60
	print_color(0, "!g%s!g Ruleta !teste !gdeschisa !tacum!",Prefix);
}
public ruletta(id)
{
	hide(mure)
	new Line[128]
	if(!Rosu[id] && !Gri[id] && !Galben[id])
	{
		if(playr >= 2 && sec >= 10)
			formatex(Line, 127, "Ruleta[\dEURO tau: \y%i\w]^nUltimele numere: %s %s %s %s %s %s %s^n\wRuleta porneste in %i secunde", Points[id], nr[0], nr[1], nr[2], nr[3], nr[4], nr[5], nr[6], sec);
		else
			formatex(Line, 127, "Ruleta[\dEURO tau: \y%i\w]^nUltimele numere: %s %s %s %s %s %s %s^n\wAsteptam decizia...", Points[id], nr[0], nr[1], nr[2], nr[3], nr[4], nr[5], nr[6]);
	}
	else
	{
		if(playr >= 2 && sec >= 10)
			formatex(Line, 127, "Ruleta[\dEURO tau: \y%i\w]^nUltimele numere: %s %s %s %s %s %s %s^n\wRosu %d - Galben %d - Gri %d^nRuleta porneste in %i secunde", Points[id], nr[0], nr[1], nr[2], nr[3], nr[4], nr[5], nr[6], Rosu[id], Galben[id], Gri[id], sec);
		else
			formatex(Line, 127, "Ruleta[\dEURO tau: \y%i\w]^nUltimele numere: %s %s %s %s %s %s %s^n\wRosu %d - Galben %d - Gri %d^nAsteptam decizia...", Points[id], nr[0], nr[1], nr[2], nr[3], nr[4], nr[5], nr[6], Rosu[id], Galben[id], Gri[id]);
	}
	new Menu = menu_create(Line, "RuletaHandlers");

	new a,b,c
	for(new i; i < 32; i++)
	{
		if(is_user_connected(i))
		{
			a += Rosu[i]
			b += Galben[i]
			c += Gri[i]
		}
	}

	if(sec >= 10)
	{
		formatex(Line, 127, "\rRosu \w2x\d(1,2,3,4,5,6,7) \w- %d", a);
		menu_additem(Menu, Line, "1");

		formatex(Line, 127, "\yGalben \w7x\d(0) \w- %d", b);
		menu_additem(Menu, Line, "2");

		formatex(Line, 127, "\dGri \w2x\d(7,8,9,10,11,12,13,14) \w- %d", c);
		menu_additem(Menu, Line, "3");
	}
	else
	{
		formatex(Line, 127, "\dRosu 2x(1,2,3,4,5,6,7) - %d", a);
		menu_additem(Menu, Line, "0");

		formatex(Line, 127, "\dGalben 7x(0) - %d", b);
		menu_additem(Menu, Line, "0");

		formatex(Line, 127, "\dGri 2x(7,8,9,10,11,12,13,14) - %d", c);
		menu_additem(Menu, Line, "0");
	}

	menu_additem(Menu, "Refresh", "4");
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public RuletaHandlers(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT ) 
	{
		menu_destroy ( menu );
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	switch(Key)
	{ 
		case 0:
		{
			print_color(id, "!g%s!t Nu ai EURO pentru ruleta!",Prefix);
		}
		case 1:
		{
			client_cmd(id, "messagemode Rosu");
		}
		case 2:
		{
			client_cmd(id, "messagemode Galben");
		}
		case 3:
		{
			client_cmd(id, "messagemode Gri");
		}
		case 4:
		{
			ruletta(id)
		}
	}
	return PLUGIN_HANDLED;
}
//----------------------------------------------------------Trade--------------------------------------------------//
public acctrade(id)
{
	hide(mure)
	if(!tTarget[id])
		return 1;

	if(!Loged[id]||!(!inMarket[id] && !WeaponinMarket[id] && !inJack[id]))
	{
		return 1;
	}

	go[id] = 1
	go[tTarget[id]] = 1
	remove_task(tTarget[id]);
	new Name[32], Name2[32];
	get_user_name(id, Name, charsmax(Name));
	get_user_name(tTarget[id], Name2, charsmax(Name2));
	print_color(id, "!g%s!y Ai acceptat invitatia lui !t%s!y !",Prefix, Name2);
	print_color(tTarget[id], "!g%s!t %s !ya acceptat invitatia ta pentru !gschimburi de iteme!y !",Prefix, Name);
	menu_cancel(id)
	menu_cancel(tTarget[id])
	totrade(id);
	totrade(tTarget[id]);
	return 1;
}
public reftrade(id)
{
	hide(mure)
	if(!tTarget[id])
		return 1;

	if(!Loged[id]||!(!inMarket[id] && !WeaponinMarket[id] && !inJack[id]))
	{
		return 1;
	}

	go[id] = 0
	go[tTarget[id]] = 0
	remove_task(tTarget[id]);
	invitat[id] = 0;
	nosend[tTarget[id]] = true;
	new Name[32], Name2[32];
	get_user_name(id, Name, charsmax(Name));
	get_user_name(tTarget[id], Name2, charsmax(Name2));
	print_color(id, "!g%s!y Ai refuzat invitatia lui !t%s!y!",Prefix, Name2);
	print_color(tTarget[id], "!g%s!t %s !ya refuzat sa faca !gschimb de iteme!y cu tine!",Prefix, Name);
	tTarget[tTarget[id]] = 0;
	tTarget[id] = 0;
	return 1;
}
public trade(id)
{
	hide(mure)
	new Name[32], String[8]
	if(invitat[id] && go[id] == 0)
	{
		new Menu = menu_create("Schimb de iteme", "TradeHandlers");
		menu_additem(Menu, "Accepta", "1");
		menu_additem(Menu, "Refuza", "2");
		menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, Menu, 0);
	}
	else if(tTarget[id] == 0)
	{
		new Menu = menu_create("Alege jucator", "TradeHandler");
		for(new i; i < 32; i++)
		{
			if(is_user_connected(i) && i != id && Loged[i])
			{
				get_user_name(i, Name, 31);
				num_to_str(i, String, 31);
				menu_additem(Menu, Name, String);
			}
		}
		menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, Menu, 0);
	}
}
public TradeHandler(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT ) 
	{
		menu_destroy ( menu ); 
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	tTarget[id] = Key;
	tTarget[tTarget[id]] = id;
	invitat[tTarget[id]] = 1;
	nosend[id] = false;
	new Names[32], Name2[32];
	get_user_name(id, Names, 31);
	get_user_name(tTarget[id], Name2, 31);
	print_color(id, "!g%s!y Asteapta raspunsul lui !t%s!y!",Prefix, Name2);
	print_color(tTarget[id], "!g%s!t %s !yte-a invitat sa faceti !gschimb de iteme!y, scrie in chat: !g/accept !tsau !g/refuz !t!",Prefix, Names);
	set_task(15.0, "fararaspuns", id);
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public TradeHandlers(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT ) 
	{
		menu_destroy ( menu );
		remove_task(tTarget[id]);
		invitat[id] = 0;
		nosend[tTarget[id]] = true;
		new Name[32], Name2[32];
		get_user_name(id, Name, 31);
		get_user_name(tTarget[id], Name2, 31);
		print_color(id, "!g%s!y Ai refuzat invitatia lui !t%s!y!",Prefix, Name2);
		print_color(tTarget[id], "!g%s!t %s !ya refuzat invitatia ta de !ga schimba iteme!y!",Prefix, Name);
		tTarget[id] = 0;
		tTarget[tTarget[id]] = 0;
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	switch(Key)
	{ 
		case 1:
		{
			go[id] = 1
			go[tTarget[id]] = 1
			remove_task(tTarget[id]);
			new Name[32], Name2[32];
			get_user_name(id, Name, 31);
			get_user_name(tTarget[id], Name2, 31);
			print_color(id, "!g%s!y Ai acceptat invitatia lui !t%s!y !",Prefix, Name2);
			print_color(tTarget[id], "!g%s!t %s !ya acceptat invitatia ta de !ga schimba iteme!y !",Prefix, Name);
			totrade(id);
			totrade(tTarget[id]);
		}
		case 2:
		{
			remove_task(tTarget[id]);
			invitat[id] = 0;
			nosend[tTarget[id]] = true;
			new Name[32], Name2[32];
			get_user_name(id, Name, 31);
			get_user_name(tTarget[id], Name2, 31);
			print_color(id, "!g%s!y Ai refuzat invitatia lui !t%s!y!",Prefix, Name2);
			print_color(tTarget[id], "!g%s!t %s !ya refuzat invitatia ta de !ga schimba iteme!y!",Prefix, Name);
			tTarget[tTarget[id]] = 0;
			tTarget[id] = 0;
		}
	}
	return PLUGIN_HANDLED;
}
public totrade(id)
{
	hide(mure)
	new Line[128]
	new cutiute
	new a = selectate[id]+selectates[id]+selectatek[id]
	for(new i;i<11;i++)
		a+=selectatec[id][i]

	formatex(Line, 127, "%s\r Schimb de iteme[%d/5]^nApasa tasta 0 cand esti gata",Prefix,a);
	tMenu = menu_create(Line, "MenuHandlert");
	new All, String[32], fol[MAX+1], fol2[MAX+1];
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
			continue;

		if(selectate[id] != 0)
		{
			new dsa = uWeapon[i][id]-stattrack[i][id]
			for(new a = 0; a < selectate[id]; a++)
			{
				if(select[a][id] == i)
				{
					formatex(Line, 127, "\d%L\r[Selectat]", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
					menu_additem(tMenu, Line, "-1");
				}
				else
				{
					fol[i]++
				}
			}
			if(fol[i] == selectate[id] && dsa)
			{
				new dsa = uWeapon[i][id]-stattrack[i][id]
				num_to_str(i, String, 31);
				formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
				menu_additem(tMenu, Line, String);
			}
		}
		else
		{
			if(uWeapon[i][id] > stattrack[i][id])
			{
				new dsa = uWeapon[i][id]-stattrack[i][id]
				num_to_str(i, String, 31);
				formatex(Line, 127, "%L", LANG_SERVER, "SKINPIECE", WeaponNames[i], dsa);
				menu_additem(tMenu, Line, String);
			}
		}
		if(selectates[id] != 0)
		{
			new dre = i+500 
			for(new a = 0; a < selectates[id]; a++)
			{
				if(selects[a][id] == dre && stattrack[i][id])
				{
					formatex(Line, 127, "\d%L\w(\yStatTrack\w)\r[Selectat]", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
					menu_additem(tMenu, Line, "-1");
				}
				else
				{
					fol2[i]++
				}
			}
			if(fol2[i] == selectates[id] && stattrack[i][id])
			{
				formatex(String, 31, "%d", dre);
				formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(tMenu, Line, String);
			}
		}
		else
		{
			if(stattrack[i][id])
			{
				new bda
				bda = i+500
				formatex(String, 31, "%d", bda);
				formatex(Line, 127, "%L\w(\yStatTrack\w)", LANG_SERVER, "SKINPIECE", WeaponNames[i], stattrack[i][id]);
				menu_additem(tMenu, Line, String);
			}
		}
		All++;
	} 
	for(new i;i<chestcount;i++)
	{
		if(Chestp[id][i] > 0)
		{
			if(selectatec[id][i] != 0)
				formatex(Line, 127, "%s\r[Ai selectat %d]",ChestName[i],selectatec[id][i]);
			else
				formatex(Line, 127, "%s",ChestName[i]);

			new calcul = 103+i
			new numars[16]
			num_to_str(calcul,numars,15)
			menu_additem(tMenu, Line, numars);
			cutiute++
		}
	}
	if(pKey[id] > 0)
	{
		if(selectatek[id] != 0)
		{
			formatex(Line, 127, "Cheie\r[Ai selectat %d]",selectatek[id]);
			menu_additem(tMenu, Line, "-3"); 
		}
		else
		{
			formatex(Line, 127, "Cheie");
			menu_additem(tMenu, Line, "-3"); 
		}
	}
	if(All == 0 && pKey[id] == 0 && cutiute == 0)
	{
		new Name[32], Name2[32];
		get_user_name(id, Name, 31);
		get_user_name(tTarget[id], Name2, 31);
		print_color(id, "!g%s!y Nu ai iteme!",Prefix);
		print_color(tTarget[id], "!g%s!t %s !ynu are iteme!",Prefix, Name);
		return 1;
	}
	menu_setprop(tMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, tMenu, 0);
	return 0;
}
public MenuHandlert(id, gMenu, Key)
{	
	hide(mure)
	new a = selectate[id]+selectates[id]+selectatek[id]
	for(new i;i<11;i++)
		a+=selectatec[id][i]

	if(Key == MENU_EXIT)
	{
		menu_destroy ( gMenu );
		if(a == 0)
		{
			totrade(id);
			print_color(id, "!g%s!y Minim 1 item!y!",Prefix);
		}
		else
		{
			goready(id)
		}
		return PLUGIN_HANDLED;
	}
	new aMenu[2], Data[4][32], sKey[32];
	menu_item_getinfo(gMenu, Key, aMenu[0], Data[0], 31, Data[1], 31, aMenu[1]);
	
	parse(Data[0], sKey, 31);
	Key = str_to_num(sKey);
	if(103 <= Key && 113 >= Key)
	{
		if(a < 5)
		{
			if(Chestp[id][Key-103] > selectatec[id][Key-103])
			{
				selectatec[id][Key-103]++;
			}
			totrade(id);
		}
		else
		{
			goready(id)
		}
		return PLUGIN_HANDLED;
	}
	else if(Key == -3)
	{
		if(a < 5)
		{
			if(pKey[id] > selectatek[id])
			{
				selectatek[id]++;
			}
			totrade(id);
		}
		else
		{
			goready(id)
		}
		return PLUGIN_HANDLED;
	}
	else if(Key == -1)
	{
		print_color(id, "!g%s!y Nu poti deselecta iteme!y!",Prefix);
		totrade(id);
		return PLUGIN_HANDLED;
	}
	else
	{
		if(a < 5)
		{
			if(Key < 500)
			{
				select[selectate[id]][id] = Key
				selectate[id]++;
				totrade(id);
			}
			else
			{
				selects[selectates[id]][id] = Key
				selectates[id]++;
				totrade(id);
			}
		}
		else
		{
			goready(id)
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
public goready(id)
{
	hide(mure)
	new a = selectate[id]+selectates[id]+selectatek[id]
	new b = selectate[tTarget[id]]+selectates[tTarget[id]]+selectatek[tTarget[id]]
	for(new i;i<11;i++)
	{
		a+=selectatec[id][i]
		b+=selectatec[tTarget[id]][i]
	}
	new Name[32], Name2[32], Line[128];
	get_user_name(tTarget[id], Name2, 31);
	get_user_name(id, Name, 31);
	formatex(Line, 127, "%s\r Schimb de iteme^n\wYou \y[\r%d\w/\r5\y]\d - \w%s \y[\r%d\w/\r5\y]^n\wApasa tasta 0 daca vrei sa accepti/refuzi oferta",Prefix,a,Name2,b);
	new Menu = menu_create(Line, "MenuHandlerr");
	menu_additem(Menu, "Refresh", "-1");
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][id] == 0 || coldown[i][id] != -1)
			continue;

		for(new a = 0; a < selectate[id]; a++)
		{

			if(select[a][id] == i)
			{
				formatex(Line, 127, "\r%s\y[%s]", WeaponNames[i], Name);
				menu_additem(Menu, Line, "0");
			}
		}
		for(new a = 0; a < selectates[id]; a++)
		{
			new der = i+500
			if(selects[a][id] == der)
			{
				formatex(Line, 127, "\r%s\y[%s\w-\yStatTrack]", WeaponNames[i], Name);
				menu_additem(Menu, Line, "0");
			}
		}
	}
	for(new i;i<11;i++)
	{
		if(selectatec[id][i] > 0)
		{
			formatex(Line, 127, "\r%d %s\y[%s]", selectatec[id][i], ChestName[i],Name);
			menu_additem(Menu, Line, "0");
		}
	}
	if(selectatek[id] > 0)
	{
		formatex(Line, 127, "\r%d Cheie\y[%s]", selectatek[id], Name);
		menu_additem(Menu, Line, "0");
	}
	for(new i = 1; i < AllWeapon; i++)
	{
		if(uWeapon[i][tTarget[id]] == 0)
			continue;

		for(new a = 0; a < selectate[tTarget[id]]; a++)
		{
			if(select[a][tTarget[id]] == i)
			{
				formatex(Line, 127, "\r%s\y[%s]", WeaponNames[i], Name2);
				menu_additem(Menu, Line, "0");
			}
		}
		for(new a = 0; a < selectates[tTarget[id]]; a++)
		{
			new der = i+500
			if(selects[a][tTarget[id]] == der)
			{
				formatex(Line, 127, "\r%s\y[%s\w-\yStatTrack]", WeaponNames[i], Name2);
				menu_additem(Menu, Line, "0");
			}
		}
	}
	for(new i;i<11;i++)
	{
		if(selectatec[tTarget[id]][i] > 0)
		{
			formatex(Line, 127, "\r%d %s\y[%s]", selectatec[tTarget[id]][i], ChestName[i],Name2);
			menu_additem(Menu, Line, "0");
		}
	}
	if(selectatek[tTarget[id]] > 0)
	{
		formatex(Line, 127, "\r%d Cheie\y[%s]", selectatek[tTarget[id]], Name2);
		menu_additem(Menu, Line, "0");
	}
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public MenuHandlerr(id, gMenu, Key)
{	
	hide(mure)
	if(Key == MENU_EXIT)
	{
		menu_destroy ( gMenu );
		vote(id)
		return PLUGIN_HANDLED;
	}
	else
	{
		goready(id)
	}
	return PLUGIN_CONTINUE;
}
public vote(id)
{
	hide(mure)
	new Menu = menu_create("Schimb de iteme^nApasa tasta 0 ca sa raspunzi", "voteHandlers");
	menu_additem(Menu, "Accept", "1");
	menu_additem(Menu, "Refuz", "2");
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public voteHandlers(id, menu, item) 
{ 
	hide(mure)
	if( item == MENU_EXIT ) 
	{
		menu_destroy ( menu );
		goready(id)
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	switch(Key)
	{ 
		case 1:
		{
			acc[id] = 1
			if(acc[tTarget[id]])
			{
				new n[32], nn[32]
				get_user_name(id, n, 31)
				get_user_name(tTarget[id], nn, 31)
				log_to_file( "addons/amxmodx/logs/trade.log", "Incepe un trade intre %s si %s", n, nn);
				new der
				for(new i = 1; i < AllWeapon; i++)
				{
					if(uWeapon[i][id] == 0)
						continue;

					der = i+500
					for(new r = 0; r < selectate[id]; r++)
					{
						if(select[r][id] == i)
						{
							select[r][id] = 0
							uWeapon[i][tTarget[id]]++
							uWeapon[i][id]--
							log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s lui %s", Prefix, n, WeaponNames[i], nn);
							for(new a = 0; a < WEAPONSKIN; a++)
							{
								if(i == UsingWeapon[a][id])
								{
									UsingWeapon[a][id] = 0
								}
							}
						}
					}
					for(new r = 0; r < selectates[id]; r++)
					{
						if(selects[r][id] == der)
						{
							selects[r][id] = 0
							uWeapon[i][tTarget[id]]++
							uWeapon[i][id]--
							stattrack[i][tTarget[id]]++
							stattrack[i][id]--
							kill[i][id] = 0
							log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s-StatTrack lui %s", Prefix, n, WeaponNames[i], nn);
							for(new a = 0; a < WEAPONSKIN; a++)
							{
								if(i == UsingWeapon[a][id])
								{
									UsingWeapon[a][id] = 0
								}
							}
						}
					}
				}
				for(new i = 1; i < AllWeapon; i++)
				{
					if(uWeapon[i][tTarget[id]] == 0)
						continue;

					der = i+500
					for(new z = 0; z < selectate[tTarget[id]]; z++)
					{
						if(select[z][tTarget[id]] == i)
						{
							select[z][tTarget[id]] = 0
							uWeapon[i][id]++
							uWeapon[i][tTarget[id]]--
							log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s lui %s", Prefix, nn, WeaponNames[i], n);
							for(new a = 0; a < WEAPONSKIN; a++)
							{
								if(i == UsingWeapon[a][tTarget[id]])
								{
									UsingWeapon[a][tTarget[id]] = 0
								}
							}
						}
					}
					for(new z = 0; z < selectates[tTarget[id]]; z++)
					{
						if(selects[z][tTarget[id]] == der)
						{
							selects[z][tTarget[id]] = 0
							uWeapon[i][id]++
							uWeapon[i][tTarget[id]]--
							stattrack[i][tTarget[id]]--
							stattrack[i][id]++
							kill[i][tTarget[id]] = 0
							log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s-StatTrack lui %s", Prefix, nn, WeaponNames[i], n);
							for(new a = 0; a < WEAPONSKIN; a++)
							{
								if(i == UsingWeapon[a][tTarget[id]])
								{
									UsingWeapon[a][tTarget[id]] = 0
								}
							}
						}
					}
				}
				for(new i;i<11;i++)
				{
					if(selectatec[id][i] > 0)
					{
						Chestp[id][i] -= selectatec[id][i]
						Chestp[tTarget[id]][i] += selectatec[id][i]
						log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s lui %s", Prefix, n, ChestName[i],nn);
					}
					if(selectatec[tTarget[id]][i] > 0)
					{
						Chestp[id][i] += selectatec[tTarget[id]][i]
						Chestp[tTarget[id]][i] -= selectatec[tTarget[id]][i]
						log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat %s lui %s", Prefix, nn, ChestName[i], n);
					}
				}
				if(selectatek[id] > 0)
				{
					pKey[id] -= selectatek[id]
					pKey[tTarget[id]] += selectatek[id]
					log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat o cheie lui %s", Prefix, n, nn);
				}
				if(selectatek[tTarget[id]] > 0)
				{
					pKey[id] += selectatek[tTarget[id]]
					pKey[tTarget[id]] -= selectatek[tTarget[id]]
					log_to_file("addons/amxmodx/logs/trade.log", "%s Jucatorul: <%s>  a dat o cheie lui %s", Prefix, nn, n);
				}
				selectatek[id] = 0
				for(new i;i<11;i++)
				{
					selectatec[id][i] = 0
					selectatec[tTarget[id]][i] = 0
				}
				selectatek[tTarget[id]] = 0
				print_color(id, "!g%s!y Schimbul de iteme a fost realizat cu !gsucces!",Prefix);
				print_color(tTarget[id], "!g%s!y Schimbul de iteme a fost realizat cu !gsucces!",Prefix);
				acc[id] = 0
				acc[tTarget[id]] = 0
				selectate[id] = 0
				selectate[tTarget[id]] = 0
				selectates[id] = 0
				selectates[tTarget[id]] = 0
				invitat[id] = 0;
				nosend[tTarget[id]] = true;
				go[id] = 0
				go[tTarget[id]] = 0
				Save(id)
				Save(tTarget[id])
				tTarget[tTarget[id]] = 0;
				tTarget[id] = 0;
				log_to_file("addons/amxmodx/logs/trade.log", "Trade incheiat");
			}
			else
			{
				new Name[32], Name2[32];
				get_user_name(id, Name, 31);
				get_user_name(tTarget[id], Name2, 31);
				print_color(id, "!g%s!y Ai acceptat invitatia lui !t%s!y!",Prefix, Name2);
				print_color(tTarget[id], "!g%s!t %s !ya acceptat !goferta ta!y si te asteapta si pe tine sa o accepti pe a lui!",Prefix, Name);
			}
		}	
		case 2:
		{
			nosend[tTarget[id]] = true;
			nosend[id] = true;
			new Name[32], Name2[32];
			get_user_name(id, Name, 31);
			get_user_name(tTarget[id], Name2, 31);
			print_color(id, "!g%s!y Ai refuzat invitatia lui !t%s!y!",Prefix, Name2);
			print_color(tTarget[id], "!g%s!t %s !ya refuzat invitatia ta de !ga schimba iteme!y!",Prefix, Name);
			acc[id] = 0
			acc[tTarget[id]] = 0
			invitat[id] = 0;
			nosend[tTarget[id]] = true;
			tTarget[tTarget[id]] = 0;
			tTarget[id] = 0;
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public fararaspuns(id)
{
	hide(mure)
	new Name2[32];
	get_user_name(tTarget[id], Name2, 31);
	print_color(id, "!g%s!t %s!y nu ti-a raspuns la timp!",Prefix, Name2);
	tTarget[id] = 0;
}
//------------------------------------------------------------Intrare pe sv--------------------------------------------------------//
public client_putinserver(id)
{
	hide(mure)
	g_restart_attempt[id] = false
	g_HideGiveClips[id] = false
	g_FirstSpawn[id] = true
	g_LastMessage[id] = 0
	g_LastWeapPickup[id] = 0
	g_Spawned[id] = false
	g_BoughtWeapon[id] = 0
	for(new i; i < 11; i++)
		Chestp[id][i] = 0

	set_task(1.0, "hudus", id+33333, _, _, "b")
	new name[33]
	get_user_name(id,name,32)
	formatex(PreNume[id],32,"")

	for(new i;i<precount;i++)
		if(equal(PreName[i],name))
			formatex(PreNume[id],32,"^4[^3%s^4]",PreNameP[i])

	Kills[id] = 0, Rang[id] = 0, Points[id] = 0, Choosen[id] = 0, pKey[id] = 0, crashpoint[id] = 0, crashi[id] = 0;
	coinflipi[id] = 0, coinflipstar[id] = -1, coinflipstart[id] = 0, coinflippoint[id] = 0, coinflipp[id] = 0, coinflipwiner[id] = 0, coinflipwin[id] = 0, PromoUse[id] = 0

	formatex(crashauto[id],8,"1.0")
	for(new i = 1; i < AllWeapon; i++)
	{
		kill[i][id] = 0
		stattrack[i][id] = 0
		uWeapon[i][id] = 0;
		coldown[i][id] = -1
	}
	for(new a = 0; a < WEAPONSKIN; a++)
	{
		UsingWeapon[a][id] = 0
	}

	for(new z = 0; z < selectate[id]; z++)
	{
		select[z][id] = 0
	}
	selectate[id] = 0
	acc[id] = 0
	selectatek[id] = 0
	selectatek[tTarget[id]] = 0
	for(new i;i<11;i++)
	{
		selectatec[id][i] = 0
		selectatec[tTarget[id]][i] = 0
	}
	selectates[id] = 0
	selectates[tTarget[id]] = 0
	acc[tTarget[id]] = 0
	invitat[id] = 0;
	nosend[tTarget[id]] = true;
	go[id] = 0
	task[id] = 0
	go[tTarget[id]] = 0
	tTarget[tTarget[id]] = 0;
	tTarget[id] = 0;
	WeaponinMarket[id] = 0
	inMarket[id] = false
	Password[id] = "";
	SavedPassword[id] = "";
	Loged[id] = false;
	Load(id);
	remove_task(id+134444)
	remove_task(id)
}

//---------------------------------------------------------------Salvare si load--------------------------------------------//
public Load(id)
{
	hide(mure)
	if(!is_user_connected(id))
	{
		return PLUGIN_HANDLED;
	}
	
	new tData[5][8], Data[MAX+1][8];

	if(nvault_get(svault, g_szName[id], rLine, sizeof(rLine) - 1))
	{
		formatex(arg1, charsmax(arg1), "")
		formatex(arg1, charsmax(arg2), "")
		strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

		parse(arg1, tData[0], 7, tData[1], 7, tData[2], 7, tData[3], 7, tData[4], 7, Data[1], 7, Data[2],
		7, Data[3], 7, Data[4], 7, Data[5], 7, Data[6], 7, Data[7], 7, Data[8], 7, Data[9], 7, Data[10], 7, Data[11], 7, Data[12],
		7, Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7, Data[20], 7, Data[21],
		7, Data[22], 7, Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7, Data[27], 7, Data[28], 7, Data[29], 7, Data[30],
		7, Data[31], 7, Data[32], 7, Data[33], 7, Data[34], 7, Data[35], 7, Data[36], 7, Data[37], 7, Data[38], 7, Data[39],
		7, Data[40], 7, Data[41], 7, Data[42], 7, Data[43], 7, Data[44], 7, Data[45], 7, Data[46], 7, Data[47], 7, Data[48],
		7, Data[49], 7, Data[50], 7, Data[51], 7, Data[52], 7, Data[53], 7, Data[54], 7, Data[55], 7, Data[56], 7);

		parse(arg2, Data[57], 7, Data[58], 7, Data[59], 7, Data[60], 7, Data[61], 7, Data[62], 7, Data[63], 7, Data[64],
		7, Data[65], 7, Data[66], 7, Data[67], 7, Data[68], 7, Data[69], 7, Data[70], 7, Data[71], 7, Data[72], 7, Data[73],
		7, Data[74], 7, Data[75], 7, Data[76], 7, Data[77], 7, Data[78], 7, Data[79], 7, Data[80], 7, Data[81], 7, Data[82],
		7, Data[83], 7, Data[84], 7, Data[85], 7, Data[86], 7, Data[87], 7, Data[88], 7, Data[89], 7, Data[90], 7, Data[91],
		7, Data[92], 7, Data[93], 7, Data[94], 7, Data[95], 7, Data[96], 7, Data[97], 7, Data[98], 7, Data[99], 7, Data[100], 7);

		Kills[id] = str_to_num(tData[0]);
		Points[id] = str_to_num(tData[1]);
		pKey[id] = str_to_num(tData[2]);
		PromoUse[id] = str_to_num(tData[3]);
		Rang[id] = str_to_num(tData[4]);

		for(new i = 1; i < AllWeapon; i++)
		{
			uWeapon[i][id] = str_to_num(Data[i]);
		}
	}

	new zData[WEAPONSKIN][8];
	if(nvault_get(ssvault, g_szName[id], rLine, sizeof(rLine) - 1)) 
	{ 
		parse(rLine, zData[0], 7, zData[1], 7, zData[2], 7, zData[3], 7, zData[4], 7, zData[5], 7, zData[6], 7, zData[7], 7, zData[8],
		7, zData[9], 7, zData[10], 7, zData[11], 7, zData[12], 7, zData[13], 7, zData[14], 7, zData[15], 7, zData[16], 7, zData[17], 7, zData[18], 7, zData[19], 7, zData[20], 7);

		for(new i; i < WEAPONSKIN; i++)
			UsingWeapon[i][id] = str_to_num(zData[i]);
	}
	new cData[11][8];
	if(nvault_get(chestvault, g_szName[id], rLine, sizeof(rLine) - 1)) 
	{ 
		parse(rLine, cData[0], 7, cData[1], 7, cData[2], 7, cData[3], 7, cData[4], 7, cData[5], 7, cData[6], 7, cData[7], 7, cData[8],
		7, cData[9], 7, cData[10], 7);

		for(new i; i < 11; i++)
			Chestp[id][i] = str_to_num(cData[i]);
	}
	new rData[MAX+1][8]
	new dData[3][8]

	if(nvault_get(trackvault, g_szName[id], rLine, sizeof(rLine) - 1)) 
	{ 
		formatex(arg1, charsmax(arg1), "")
		formatex(arg1, charsmax(arg2), "")
		strtok(rLine, arg1, charsmax(arg1), arg2, charsmax(arg2), '*');

		parse(arg1, rData[1], 7, rData[2], 7, rData[3], 7, rData[4], 7, rData[5], 7, rData[6], 7, rData[7], 7, rData[8],7, rData[9], 7, rData[10], 7, rData[11], 7,
		rData[12],  7, rData[13], 7, rData[14], 7, rData[15], 7, rData[16], 7, rData[17], 7, rData[18], 7, rData[19], 7, rData[20], 7, rData[21], 7, rData[22], 7,
		rData[23], 7, rData[24], 7, rData[25], 7, rData[26], 7, rData[27], 7, rData[28], 7, rData[29], 7, rData[30], 7, rData[31], 7, rData[32], 7, rData[33], 7,
		rData[34], 7, rData[35], 7, rData[36], 7, rData[37], 7, rData[38], 7, rData[39], 7, rData[40], 7, rData[41], 7, rData[42], 7, rData[43], 7, rData[44], 7,
		rData[45], 7, rData[46], 7, rData[47], 7, rData[48], 7, rData[49], 7, rData[50], 7, rData[51], 7, rData[52], 7, rData[53], 7, rData[54], 7, rData[55], 7, rData[56], 7)

		parse(arg2, rData[57], 7, rData[58], 7, rData[59], 7, rData[60], 7, rData[61], 7, rData[62], 7, rData[63], 7, rData[64],
		7, rData[65], 7, rData[66], 7, rData[67], 7, rData[68], 7, rData[69], 7, rData[70], 7, rData[71], 7, rData[72], 7, rData[73],
		7, rData[74], 7, rData[75], 7, rData[76], 7, rData[77], 7, rData[78], 7, rData[79], 7, rData[80], 7, rData[81], 7, rData[82],
		7, rData[83], 7, rData[84], 7, rData[85], 7, rData[86], 7, rData[87], 7, rData[88], 7, rData[89], 7, rData[90], 7, rData[91],
		7, rData[92], 7, rData[93], 7, rData[94], 7, rData[95], 7, rData[96], 7, rData[97], 7, rData[98], 7, rData[99], 7, rData[100], 7);

		new szWeek[3]
		get_time("%w", szWeek, sizeof(szWeek))
		new iDate = str_to_num(szWeek)

		for(new i = 1; i < AllWeapon; i++)
		{
			parse(rData[i], dData[0], 7, dData[1], 7, dData[2], 7)
			stattrack[i][id] = str_to_num(dData[0]);
			uWeapon[i][id] += str_to_num(dData[0])
			kill[i][id] = str_to_num(dData[1]);
			new p = str_to_num(dData[2])
			new fo[10],fo2[10]
			formatex(fo, 9, "0%d", p)
			formatex(fo2, 9, "0%d", iDate)
			if(!equal(fo,fo2))
			{
				coldown[i][id] = -1
			}
			else
			{
				coldown[i][id] = str_to_num(dData[2])
			}
		}
	}
	else
	{
		for(new i = 1; i < AllWeapon; i++)
		{
			coldown[i][id] = -1
		}
	}
	return PLUGIN_CONTINUE;
}
public Save(id)
{
	hide(mure)
	if(!is_user_connected(id))
	{
		return PLUGIN_HANDLED;
	}

	formatex(rLine, charsmax(rLine), "")
	new String[8];
	
	format(String, 7, "^"%i^" ", Kills[id]);
	add(rLine, charsmax(rLine), String);
			
	format(String, 7, "^"%i^" ", Points[id]);
	add(rLine, charsmax(rLine), String);
			
	format(String, 7, "^"%i^" ", pKey[id]);
	add(rLine, charsmax(rLine), String);

	format(String, 7, "^"%i^" ", PromoUse[id]);
	add(rLine, charsmax(rLine), String);
			
	format(String, 7, "^"%i^" ", Rang[id]);
	add(rLine, charsmax(rLine), String);
	new ass
	for(new i = 1; i < MAX+1; i++)
	{
		if(uWeapon[i][id] < 0)
			uWeapon[i][id] = 0

		ass = uWeapon[i][id]-stattrack[i][id]
		if(i == 56)
		{
			if(stattrack[i][id])
			{
				format(String, 7, "^"%i^"*", ass);
				add(rLine, charsmax(rLine), String);
			}
			else
			{
				format(String, 7, "^"%i^"*", uWeapon[i][id]);
				add(rLine, charsmax(rLine), String);
			}
		}
		else
		{
			if(stattrack[i][id])
			{
				format(String, 7, "^"%i^" ", ass);
				add(rLine, charsmax(rLine), String);
			}
			else
			{
				format(String, 7, "^"%i^" ", uWeapon[i][id]);
				add(rLine, charsmax(rLine), String);
			}
		}
	}
	
	nvault_set(svault, g_szName[id], rLine)

	formatex(rLine, charsmax(rLine), "")
	new Stringz[8];

	for(new i = 0; i < WEAPONSKIN; i++)
	{
		format(Stringz, 7, "^"%i^" ", UsingWeapon[i][id]);
		add(rLine, charsmax(rLine), Stringz);
	}
				
	nvault_set(ssvault, g_szName[id], rLine)

	formatex(rLine, charsmax(rLine), "")
	new Stringchest[8];

	for(new i = 0; i < 11; i++)
	{
		format(Stringchest, 7, "^"%i^" ", Chestp[id][i]);
		add(rLine, charsmax(rLine), Stringchest);
	}
				
	nvault_set(chestvault, g_szName[id], rLine)

	formatex(rLine, charsmax(rLine), "")

	new rString[16];
	for(new i = 1; i < MAX+1; i++)
	{
		if(i > MAX)
			break;

		if(stattrack[i][id] < 0)
			stattrack[i][id] = 0

		if(i == 56)
		{
			format(rString, 15, "^"%i %i %i^"*", stattrack[i][id], kill[i][id], coldown[i][id]);
			add(rLine, charsmax(rLine), rString);
		}
		else
		{
			format(rString, 15, "^"%i %i %i^" ", stattrack[i][id], kill[i][id], coldown[i][id]);
			add(rLine, charsmax(rLine), rString);
		}

	}
	nvault_set(trackvault, g_szName[id], rLine)
	formatex(rLine, charsmax(rLine), "")

	return PLUGIN_CONTINUE;
}
//----------------------------------------------------------Login--------------------------------------------------------//
public RegMenu(id)
{
	hide(mure)
	new String[128], Name[32];
	format(String, 127, "%s %L", Prefix, LANG_SERVER, "RMMAIN");
	new rMenu = menu_create(String, "rMenuHandler");
	get_user_name(id, Name, 31);
	
	format(String, 127, "%L", LANG_SERVER, "RMACCOUNT", Name);
	menu_additem(rMenu, String, "0");
	
	if(Registered(id) == false)
	{
		format(String, 127, "%L", LANG_SERVER, "RMP", Password[id]);
		menu_additem(rMenu, String, "1");
		
		if(strlen(Password[id]) > 4)
		{
			format(String, 127, "%L", LANG_SERVER, "RMR");
			menu_additem(rMenu, String, "2");
		}
		else
		{
			format(String, 127, "\d%L", LANG_SERVER, "RMR");
			menu_additem(rMenu, String, "0");
		}
	}
	else
	{
		if(!Loged[id])
		{
			format(String, 127, "%L", LANG_SERVER, "RMP", Password[id]);
			menu_additem(rMenu, String, "1");
			
			if(equal(SavedPassword[id], Password[id]))
			{
				format(String, 127, "%L", LANG_SERVER, "RMLOGIN");
				menu_additem(rMenu, String, "3");
			}
			else
			{
				format(String, 127, "\d%L", LANG_SERVER, "RMLOGIN");
				menu_additem(rMenu, String, "0");
			}
		}
		else
		{
			format(String, 127, "%L", LANG_SERVER, "RMLOGOUT");
			menu_additem(rMenu, String, "-1");
		}
	}
	
	menu_display(id, rMenu);
}
public rMenuHandler(id, gMenu, item)
{	
	hide(mure)
	if(item == MENU_EXIT)
	{
		menu_destroy(gMenu);
		return;
	}
	new data[9], name[64], Key;
	new access, callback;
	menu_item_getinfo(gMenu, item, access, data, charsmax(data), name, charsmax(name), callback);
 
	Key = str_to_num(data);
	
	if(Key == -1)
		ToLogout(id);

	if(Key == 0)
		RegMenu(id);

	if(Key == 1)
	{
		client_cmd(id, "messagemode UserPassword");
		RegMenu(id);
	}
	if(Key == 2)
	{
		print_color(id, "!g%s%L", Prefix, LANG_SERVER, "REGISTERSUCCESS", Password[id]);
		Register(id, Password[id]);
		copy(SavedPassword[id], 31, Password[id]);
		Loged[id] = true;
		Menu(id);
	}
	if(Key == 3)
	{
		if(equal(SavedPassword[id], Password[id])) {
			Loged[id] = true;
			remove_task(id+134444)
			print_color(id, "!g%s%L", Prefix, LANG_SERVER, "REGISTERLOGIN");
			Menu(id);
		}
	}
}
public ToLogout(id)
{
	hide(mure)
	if(Loged[id])
	{
		Loged[id] = false;
		Password[id] = "";
		print_color(id, "!g%s%L", Prefix, LANG_SERVER, "REGISTERLOGOUT");
	}
}
public PlayerPassword(id)
{
	hide(mure)
	new Data[32];
	read_args(Data, 31);
	remove_quotes(Data);
	
	if(strlen(Data) < 5)
	{
		print_color(id, "!g%s%L", Prefix, LANG_SERVER, "REGISTERSHORT");
		client_cmd(id, "messagemode UserPassword");
		return PLUGIN_HANDLED;
	}
	
	if(Loged[id])
	{
		return PLUGIN_HANDLED;
	}
	
	copy(Password[id], 31, Data);
	RegMenu(id);
	return PLUGIN_CONTINUE;
}
public NameChange(id) 
{
	hide(mure)
	if(!is_user_connected(id)||g_NameChange[id])
		return FMRES_IGNORED;
		
	new OldName[32], NewName[32], Name[32];
	get_user_name(id, Name, 31);
	pev(id, pev_netname, OldName, charsmax(OldName));
	if(OldName[0])
	{
		get_user_info(id, "name", NewName, charsmax(NewName));
		if(!equal(OldName, NewName))
		{
			set_user_info(id, "name", OldName);
			print_color(id, "!g%s%L", Prefix, LANG_SERVER, "REGISTERNAMECHANGE");
			return FMRES_HANDLED;
		}
	}
	return FMRES_IGNORED;
}
public freeak(id)
{
	hide(mure)
	new list[MAX]
	new wpnz = 1

	for(new i = 1;i<AllWeapon;i++)
	{
		if(Weapons[i] == 28)
		{
			list[wpnz] = i
			wpnz++
		}
	}
	new rWeapon = random_num(1,wpnz-1)
	new rNum = random_num(1, 100);
	
	if(WeaponDrop[list[rWeapon]] >= rNum)
	{
		if(equal(WeaponNames[list[rWeapon]], ""))
			freeak(id);
		else
		{
			new Name[32];
			get_user_name(id, Name, 31);
			print_color(id, "!g[CSGO DEADLY] !yProcesare incheiata, ai primit un !g%s!y-!gStatTrack!y!", WeaponNames[list[rWeapon]]);
			uWeapon[list[rWeapon]][id]++;
			stattrack[list[rWeapon]][id]++;
			Save(id);
		}
	}
	else
	{
		freeak(id);
	}
}
// --------------------------Native-------------------------------------------//
public randomcsgo(id)
{
	hide(mure)
	new a = random_num(1,3)
	new Name[32]
	get_user_name(id, Name, charsmax(Name));

	if(a == 1)
	{
		new pPont;
		pPont = random_num(25, 50);
		Points[id] += pPont;
		print_color(id, "!g%s!t %s!y a obtinut !g%i!y EURO!", Prefix, Name, pPont);
	}
	else if(a == 2)
	{
		pKey[id]++;
		print_color(id, "!g%s%L", Prefix, LANG_SERVER, "FOUNDKEY", Name);
	}
	else
	{
		a = random_num(0,chestcount)
		Chestp[id][a]++;
		print_color(id, "!g%s!t %s!y a obtinut !g%s!y!", Prefix, Name, ChestName[a]);
	}
	Save(id);
}
public native_get_pct(id)
{
	hide(mure)
	if(is_user_connected(id))
	{
		return Points[id]
	}
	return -1
}
public native_set_pct(id,a)
{
	hide(mure)
	if(is_user_connected(id))
	{
		Points[id] = a
		Save(id)
	}
}
public native_get_key(id)
{
	hide(mure)
	if(is_user_connected(id))
	{
		return pKey[id]
	}
	return -1
}
public native_set_key(id,a)
{
	hide(mure)
	if(is_user_connected(id))
	{
		pKey[id] = a
		Save(id)
	}
}
public native_get_chest(id,value)
{
	hide(mure)
	if(is_user_connected(id))
	{
		return Chestp[id][value]
	}
	return -1
}
public native_set_chest(id,a,value)
{
	hide(mure)
	if(is_user_connected(id))
	{
		Chestp[id][value] = a
		Save(id)
	}
}
public native_set_chests(id,a)
{
	hide(mure)
	if(is_user_connected(id))
	{
		for(new i;i<a;i++)
			GiveChest(id)

		Save(id)
	}
}
public native_key(id)
{
	hide(mure)
	if(is_user_connected(id))
	{
		pKey[id]++;
		Save(id);
	}
}
public native_chest(id)
{
	hide(mure)
	if(is_user_connected(id))
	{
		for(new i;i<11;i++)
			Chestp[id][i]++;

		Save(id);
	}
}
public native_bet(id)
{
	hide(mure)
	if(is_user_connected(id))
	{
		new a = betp[id]*2
		Points[id] += a
		print_color(id, "!g%s!t Ai castigat %d EURO!", Prefix, a);
	}
}
public native_bett(id)
{
	hide(mure)
	if(is_user_connected(id) && pbet[id] == 1)
		return true;

	return false;
}
public native_betct(id)
{
	hide(mure)
	if(is_user_connected(id) && pbet[id] == 2)
		return true;

	return false;
}
// -----------------------------------------------------Stockuri-----------------------------------------//
stock GiveChest(id)
{
	hide(mure)
	new rWeapon = random_num(0, chestcount);
	new rNum = random_num(1, 100);
	
	if(ChestDrop[rWeapon] >= rNum)
	{
		if(equal(ChestName[rWeapon], ""))
			GiveChest(id);
		else
		{
			Chestp[id][rWeapon]++
			new Name[32];
			get_user_name(id, Name, 31);
			print_color(id, "!g[CSGO DEADLY] !t%s !ya gasit chestul !g%s",Name,ChestName[rWeapon]);
			Save(id);
		}
	}
	else
		GiveChest(id);
}
stock bool:ValidMdl(Mdl[])
{
	hide(mure)
	if(containi(Mdl, ".mdl") != -1)
	{
		return true;
	}
	return false;
}
stock bool:Registered(id)
{
	hide(mure)
	new Data[32];
	if(TrieGetString(g_NameName, g_szName[id], Data, 31))
	{
		server_print("am gasit %s in trie",Data)
		copy(SavedPassword[id], 31, Data);
		return true;
	}
	else
	{
		if(nvault_get(rvault, g_szName[id], Data, sizeof(Data) - 1)) 
		{ 
			copy(SavedPassword[id], 31, Data);
			TrieSetString(g_NameName,g_szName[id],Data)
			server_print("am gasit %s in nvault",Data)
			return true;
		}
	}
	return false;
}
stock Register(id, const rSavedPassword[])
{
	hide(mure)
	new Name[32], Line[64];
	get_user_name(id, Name, 31);
	format(Line, 63, "%s", rSavedPassword);
	
	nvault_set(rvault, g_szName[id], Line)
	print_color(id, "!gMultumim pentru inregistrare!")
}
stock print_color(const id, const input[], any:...)
{
	hide(mure)
	new Count = 1, Players[32];
	static Msg[191];
	vformat(Msg, 190, input, 3);
	
	replace_all(Msg, 190, "!g", "^4");
	replace_all(Msg, 190, "!y", "^1");
	replace_all(Msg, 190, "!t", "^3");

	if(id) Players[0] = id; else get_players(Players, Count, "ch");

	for (new i = 0; i < Count; i++)
	{
		if (is_user_connected(Players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, SayText, _, Players[i]);
			write_byte(Players[i]);
			write_string(Msg);
			message_end();
		}
	}
	return PLUGIN_HANDLED;
}
stock fnGetRandom()
{
	hide(mure)
	new a = random_num(1,playj)
	for (new r = 1; r <= 32; r++)
		if (is_user_connected(r) && inJack[r] && itemj[a] == r)
			return r
	
	return -1;
}
stock fnGetj()
{
	hide(mure)
	for (new id = 1; id <= 32; id++)
		if (is_user_connected(id) && inJack[id])
			return id

	return -1
}

Remove_Icon(id)
{
	message_begin(MSG_ALL, SVC_TEMPENTITY);
	write_byte(TE_KILLPLAYERATTACHMENTS);
	write_byte(id);
	message_end();
}
public clcmd_fullupdate()
{
	return PLUGIN_HANDLED
}

public event_restart_attempt()
{
	new players[32], num_players
	get_players(players, num_players, "a")
	for (new i; i < num_players; ++i)
		g_restart_attempt[players[i]] = true
}

public event_hud_reset(id)
{
	if (g_restart_attempt[id]) {
		g_restart_attempt[id] = false
		return
	}
	event_player_spawn(id)
}

public event_player_spawn(id)
{
	if (get_pcvar_num(pv_fa_enable) == 1) {
		g_HideGiveClips[id] = true
		g_Spawned[id] = true
	}
}

public do_player_spawn(id)
{
	new weap_ids[32], num_weaps
	get_user_weapons(id, weap_ids, num_weaps)
	for (new i = 0; i < num_weaps; i++) {
		new weap_id = weap_ids[i]
		if (fill_weapon(id, weap_id)) {
			if (g_FirstSpawn[id]) {
				if (get_pcvar_num(pv_fa_altclips) != 1)
					cs_set_user_bpammo(id, weap_id, 0)
				fill_bpammo_show(id, weap_id)
			}
			else
				fill_bpammo(id, weap_id)
		}
	}
	g_FirstSpawn[id] = false
}

public event_new_round()
{
	if (get_pcvar_num(pv_fa_enable) == 1) {
		new players[32], num_players
		get_players(players, num_players, "a")
		for (new j = 0; j < num_players; j++) {
			new id = players[j]
			new weap_ids[32], num_weaps
			get_user_weapons(id, weap_ids, num_weaps)
			for (new i = 0; i < num_weaps; i++)
				if (fill_weapon(id, weap_ids[i]))
					fill_bpammo(id, weap_ids[i])
		}
	}
}

public message_ammo_pickup(msg_id, id, ent)
{
	if (get_pcvar_num(pv_fa_enable) == 1) {
		if (g_HideGiveClips[id]) {
			g_HideGiveClips[id] = false
			return PLUGIN_HANDLED
		}
	}
	return PLUGIN_CONTINUE
}

public forward_message_begin(msg_dest, msg_type, const Float:ORIGIN[3], const ED)
{
	if (ED < 1 || ED > 32)
		return
	new id = ED
	if (msg_type == g_MoneyMsg && g_LastMessage[id] == g_WeapPickupMsg)
		event_weapon_buy(id, g_LastWeapPickup[id])
	g_LastMessageID = id
	g_LastMessageType = msg_type
	g_LastMessage[id] = msg_type
}

public forward_write_byte(value)
{
	if (g_LastMessageType == g_WeapPickupMsg)
		g_LastWeapPickup[g_LastMessageID] = value
}

public event_weapon_buy(id, weap_id)
{
	g_BoughtWeapon[id] = weap_id
}

public do_weapon_buy(id, weap_id)
{
	if (fill_weapon(id, weap_id))
		fill_bpammo_show(id, weap_id)
}

public client_PreThink(id)
{
	if (get_pcvar_num(pv_fa_enable) == 1) {
		if (g_Spawned[id]) {
			g_Spawned[id] = false
			do_player_spawn(id)
		}
		if (g_BoughtWeapon[id] != 0) {
			new weap_id = g_BoughtWeapon[id]
			g_BoughtWeapon[id] = 0
			do_weapon_buy(id, weap_id)
		}
	}
	return PLUGIN_CONTINUE
}

public bool:weapon_has_ammo(weap_id)
{
	return g_AmmoName[g_AmmoType[weap_id]][0] != 0
}

public bool:fill_bpammo(id, weap_id)
{
	if (get_pcvar_num(pv_fa_altclips) == 1) {
		new ammo_clips = g_MaxClips[weap_id]
		if (weapon_has_ammo(weap_id)) {
			for (new i = 1; i <= ammo_clips; i++) {
				g_HideGiveClips[id] = true
				give_item(id, g_AmmoName[g_AmmoType[weap_id]])
			}
			g_HideGiveClips[id] = false
			return true
		}
	}
	else {
		new ammo = g_MaxBPAmmo[weap_id]
		if (weapon_has_ammo(weap_id)) {
			cs_set_user_bpammo(id, weap_id, ammo)
			g_HideGiveClips[id] = false
			return true
		}
	}
	return false
}

public bool:fill_weapon(id, weap_id)
{
	new clip_size = g_ClipSize[weap_id]
	if (clip_size != 0) {
		new weap_name[41]
		get_weaponname(weap_id, weap_name, 40)
		new wpn = find_ent_by_owner(-1, weap_name, id)
		if (wpn != 0) {
			cs_set_weapon_ammo(wpn, clip_size)
			return true
		}
	}
	return false
}

public show_given_bpammo(id, weap_id, ammount)
{
	g_HideGiveClips[id] = false
	if (ammount <= 0)
		return
	message_begin(MSG_ONE, get_user_msgid("AmmoPickup"), {0,0,0}, id)
	write_byte(g_AmmoType[weap_id])
	write_byte(ammount)
	message_end()
}

public bool:fill_bpammo_show(id, weap_id)
{
	new given_ammo = g_MaxBPAmmo[weap_id]
	if (get_pcvar_num(pv_fa_altclips) != 1 && weapon_has_ammo(weap_id))
		given_ammo -= cs_get_user_bpammo(id, weap_id)
	if (fill_bpammo(id, weap_id)) {
		show_given_bpammo(id, weap_id, given_ammo)
		return true
	}
	return false
}
AlexandruODT 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 08:05.


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