MyBB, XenForo, vBulletin rakibi DiyoBB çok yakında beta süreci ile webailesi.com adresinde! Tıkla ve detayları görüntüle

eklentide yasaklı kod mevcut.

Konu

#1
bu eklentide yasaklı kod mevcut csdurağı yasaklı kod testi yaptım _pw adlı şeyler yasak kodlu olarak gosterılıyor fakat duzenleyemedım.
.sma clansystem.sma (Dosya Boyutu: 47,39 KB | İndirme Sayısı: 7)
#2
Önerim :
https://www.webailesi.com/konu-reapi-klan-sistemi-21468

Yasaklı kodları kontrol edemiyorum, fakat dediğiniz gibi _pw yasaklı kod. _pw olan yerleri _psw olarak değiştirip deneyin.
(- Ücretli Eklenti Yaptırmak İsteyen -)
#3
(15-01-2022, 19:05)suriyelikene Adlı Kullanıcıdan Alıntı: Önerim :
https://www.webailesi.com/konu-reapi-klan-sistemi-21468

Yasaklı kodları kontrol edemiyorum, fakat dediğiniz gibi _pw yasaklı kod. _pw olan yerleri _psw olarak değiştirip deneyin.

siz degistirip atabilirmisiniz.
Son Düzenleme: 15-01-2022, 19:56, Düzenleyen: JukeLord12.
#4
(15-01-2022, 19:55)JukeLord12 Adlı Kullanıcıdan Alıntı:
(15-01-2022, 19:05)suriyelikene Adlı Kullanıcıdan Alıntı: Önerim :
https://www.webailesi.com/konu-reapi-klan-sistemi-21468

Yasaklı kodları kontrol edemiyorum, fakat dediğiniz gibi _pw yasaklı kod. _pw olan yerleri _psw olarak değiştirip deneyin.

siz degistirip atabilirmisiniz.
Kod:
    /* Includes */
        
        #include < amxmodx >
        #include < amxmisc >
        #include < sqlvault_ex >
        #include < cstrike >
        #include < hamsandwich >
        #include < fun >
        
    /* Defines */
    
        #define ADMIN_CREATE    ADMIN_LEVEL_B
        #define FLAG ADMIN_RESERVATION
        #define cm(%0)    ( sizeof(%0) - 1 )    
        

    /* Constants */
    
        new const g_szVersion[ ] = "1.1.7";

        enum _:GangInfo
        {
            Trie:GangMembers,
            GangName[ 64 ],
            GangHP,
            GangStealing,
            GangGravity,
            GangDamage,
            GangStamina,
            GangWeaponDrop,
            GangKills,
            NumMembers
        };
            
        enum
        {
            VALUE_HP,
            VALUE_STEALING,
            VALUE_GRAVITY,
            VALUE_DAMAGE,
            VALUE_STAMINA,
            VALUE_WEAPONDROP,
            VALUE_KILLS
        }

        enum
        {
            STATUS_NONE,
            STATUS_MEMBER,
            STATUS_ADMIN,
            STATUS_LEADER
        };

        new const g_szGangValues[ ][ ] =
        {
            "HP",
            "Stealing",
            "Gravity",
            "Damage",
            "Stamina",
            "WeaponDrop",
            "Kills"
        };

        new const g_szPrefix[ ] = "^04[Clan System]^01";

    /* Tries */
    
        new Trie:g_tGangNames;
        new Trie:g_tGangValues;

    /* Vault */
    
        new SQLVault:g_hVault;
        new SQLVault:g_hPointsVault;

    /* Arrays */
    
        new Array:g_aGangs;

    /* Pcvars */
    
        new g_pCreateCost;
        new COLCHAR[3][2] = { "^x03", "^x04", "^x01" }
        new p_namecol
        new alv_sndr, alv_str2[26], alv_str4[101]
        new msg[200]

        new g_pHealthCost;
        new g_pStealingCost;
        new g_pGravityCost;
        new g_pDamageCost;
        new g_pStaminaCost;
        new g_psweaponDropCost;

        new g_pHealthMax;
        new g_pStealingMax;
        new g_pGravityMax;
        new g_pDamageMax;
        new g_pStaminaMax;
        new g_psweaponDropMax;

        new g_pHealthPerLevel;
        new g_pStealingPerLevel;
        new g_pGravityPerLevel;
        new g_pDamagePerLevel;
        new g_pStaminaPerLevel;
        new g_psweaponDropPerLevel;

        new g_pPointsPerKill;
        new g_pHeadshotBonus;

        new g_pMaxMembers;
        new g_pAdminCreate;


    /* Integers */
    
        new g_iGang[ 33 ];
        new g_iPoints[ 33 ];
        

    public plugin_init()
    {
        register_plugin( "Klan Sistemi", g_szVersion, "Pazee" );
        
        g_aGangs                 = ArrayCreate( GangInfo );

        g_tGangValues             = TrieCreate();
        g_tGangNames             = TrieCreate();
        
        g_hVault                 = sqlv_open_local( "jb_gangs", false );
        sqlv_init_ex( g_hVault );

        g_hPointsVault            = sqlv_open_local( "jb_points", true );
        
        g_pCreateCost            = register_cvar( "jb_gang_cost",         "0" );
        g_pHealthCost            = register_cvar( "jb_health_cost",         "20" );
        g_pStealingCost         = register_cvar( "jb_stealing_cost",     "20" );
        g_pGravityCost            = register_cvar( "jb_gravity_cost",     "20" );
        g_pDamageCost            = register_cvar( "jb_damage_cost",         "20" );
        g_pStaminaCost            = register_cvar( "jb_stamina_cost",     "20" );
        g_psweaponDropCost        = register_cvar( "jb_weapondrop_cost",     "20" );

        g_pHealthMax            = register_cvar( "jb_health_max",         "10" );
        g_pStealingMax            = register_cvar( "jb_stealing_max",     "10" );
        g_pGravityMax            = register_cvar( "jb_gravity_max",         "10" );
        g_pDamageMax            = register_cvar( "jb_damage_max",         "10" );
        g_pStaminaMax            = register_cvar( "jb_stamina_max",         "10" );
        g_psweaponDropMax        = register_cvar( "jb_weapondrop_max",     "10" );

        g_pHealthPerLevel        = register_cvar( "jb_health_per",         "10"     );
        g_pStealingPerLevel        = register_cvar( "jb_stealing_per",     "0.05"     );
        g_pGravityPerLevel        = register_cvar( "jb_gravity_per",         "50"     );
        g_pDamagePerLevel        = register_cvar( "jb_damage_per",         "3"     );
        g_pStaminaPerLevel        = register_cvar( "jb_stamina_per",         "3"     );
        g_psweaponDropPerLevel     = register_cvar( "jb_weapondrop_per",     "1"     );

        g_pPointsPerKill        = register_cvar( "jb_points_per_kill",    "3" );
        g_pHeadshotBonus        = register_cvar( "jb_headshot_bonus",    "2" );
        p_namecol = register_cvar( "csm_namecolor", "0" )
        
        register_message( get_user_msgid("SayText"), "col_changer" )
        
        g_pMaxMembers            = register_cvar( "jb_max_members",        "10" );
        g_pAdminCreate            = register_cvar( "jb_admin_create",     "0" );
        
        register_menu( "Gang Menu", 1023, "GangMenu_Handler" );
        register_menu( "Skills Menu", 1023, "SkillsMenu_Handler" );
        
        for( new i = 0; i < sizeof g_szGangValues; i++ )
        {
            TrieSetCell( g_tGangValues, g_szGangValues[ i ], i );
        }

        RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn_Post", 1 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Pre", 0 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Post", 1 );
        RegisterHam( Ham_Item_PreFrame, "player", "Ham_PlayerResetSpeedPost", 1);
        
        register_event( "DeathMsg", "Event_DeathMsg", "a" );
                
        register_clcmd( "say /klan", "Cmd_Gang" );
        register_clcmd( "say /kaydet", "kaydet" );
        register_clcmd( "gang_name", "Cmd_CreateGang" );
        
        
        register_logevent( "elsonu", 2, "1=Round_End" );
        register_logevent( "elbasi", 2, "1=Round_Start" );
        
        LoadGangs();
    }
    public elsonu()
    {
    }
    public elbasi()
    {
    SaveGangs();
    glkaydet();
    }

    public client_disconnected( id )
    {
        g_iGang[ id ] = -1;
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
    }
    public glkaydet()
    {
        new players[32],inum,id
        get_players(players,inum)
        for(new i;i<inum;i++)
        {
            id = players[i]
            kaydet(id)
        }
    }
    public col_changer( msg_id, msg_dest, rcvr )
    {
        new str2[26]
        get_msg_arg_string( 2, str2, 25 )
        if( equal( str2, "#Cstrike_Chat", 13 ) )
        {
            new str3[22]
            get_msg_arg_string( 3, str3, 21 )
        
            if( !strlen( str3 ) )
            {
                new str4[101]
                get_msg_arg_string( 4, str4, 100 )
                new sndr = get_msg_arg_int( 1 )
            
                new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
            
                new sndr_team = get_user_team( sndr )
                new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
            
                new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
            
                new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
            
                if( !same_as_last )
                {
                
                
                    if( !( is_team_msg && ( is_sndr_spec || is_team_msg) ) )
                    {
                        new flags[5], team[10]
                        if( is_user_alive( sndr ) ) flags = "bc"
                        else flags = "ac"
                    
                        if( is_team_msg )
                        {
                            add( flags[strlen( flags )], 4, "e" )
                            if( sndr_team == 1 ) team = "TERRORIST"
                            else team = "CT"
                        }
                    
                        new players[32], num
                        get_players( players, num, flags, team )
                        if( get_user_flags( sndr ) & FLAG)
                            buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )
                        else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, str4 )
                    
                        for( new i=0; i < num; i++ )
                        {
                            if(is_user_alive(players[i]) && get_user_flags( players[i] ) & FLAG || !is_user_alive(players[i])){
                                message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
                                write_byte( sndr )
                                write_string( msg )
                                message_end()
                            }
                        }
                    
                    }
    
                    alv_sndr = sndr
                    alv_str2 = str2
                    alv_str4 = str4
                    if( task_exists( 411 ) ) remove_task( 411 )
                    set_task( 0.1, "task_clear_antiloop_vars", 411 )
                
                }
            
                if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )

                set_msg_arg_string( 2, msg )
                set_msg_arg_string( 4, "" )
            
            }
        }
        return PLUGIN_CONTINUE
    }

    public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4[ ] )
    {
        new sndr_name[33]
        get_user_name( sndr, sndr_name, 32 )
    
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ sndr ], aData );
    
        new prefix[30] = "^x01"
    
        if(is_user_admin(sndr)){
            if(!(get_user_flags(sndr) == FLAG)){
                if(is_user_steam(sndr)){
                }
                else if(!is_user_steam(sndr)){
                }
            }
            else{
                if(is_user_steam(sndr)){    
                }
                else if(!is_user_steam(sndr)){
                }
            }
        }
        else {
            if(is_user_steam(sndr)){
                if( g_iGang[ sndr ] == -1 )
                {
                return HAM_IGNORED;
                }
            }
            else{
                prefix = "^x01"
            }
        }
        if( is_sndr_spec ) add( prefix[strlen(prefix)-1], 29, "*Spec*" )
        else if( !is_user_alive( sndr ) ) add( prefix[strlen(prefix)-1], 29, "*Olu*" )
    
    
        if( is_team_msg )
        {
            if( is_sndr_spec ) prefix = "^x01(Spec) "
            else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "*(TE)*" )
            else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "*(CT)*" )
        }
        if(get_user_flags(sndr) & ADMIN_RESERVATION)
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x04%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x04%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }        
    
        }
        else
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x01%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x01%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }
        }
        return PLUGIN_HANDLED
    }

    public task_clear_antiloop_vars( )
    {
        alv_sndr = 0
        alv_str2 = ""
        alv_str4 = ""
        return PLUGIN_HANDLED
    }
    public kaydet(id)
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
        
    }
    public client_putinserver( id )
    {
        g_iGang[ id ] = get_user_gang( id );
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
    }
    public plugin_end()
    {
        SaveGangs();
        glkaydet();
        sqlv_close( g_hVault );
    }
    public Ham_PlayerSpawn_Post( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
                
            
        if( g_iGang[ id ] == -1 )
        {
            return HAM_IGNORED;
        }
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        kaydet(id)
        
        new iHealth = 100 + aData[ GangHP ] * get_pcvar_num( g_pHealthPerLevel );
        set_user_health( id, iHealth );
        
        new iGravity = 800 - ( get_pcvar_num( g_pGravityPerLevel ) * aData[ GangGravity ] );
        set_user_gravity( id, float( iGravity ) / 800.0 );
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
            
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Pre( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || cs_get_user_team( iAttacker ) != CS_TEAM_T )
            return HAM_IGNORED;
            
        if( g_iGang[ iAttacker ] == -1 )
            return HAM_IGNORED;
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        SetHamParamFloat( 4, flDamage + ( get_pcvar_num( g_pDamagePerLevel ) * ( aData[ GangDamage ] ) ) );
        
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Post( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || g_iGang[ iAttacker ] == -1 || get_user_weapon( iAttacker ) != CSW_KNIFE || cs_get_user_team( iAttacker ) != CS_TEAM_T  )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        new iChance = aData[ GangWeaponDrop ] * get_pcvar_num( g_psweaponDropPerLevel );
        
        if( iChance == 0 )
            return HAM_IGNORED;
        
        new bool:bDrop = ( random_num( 1, 100 ) <= iChance );
        
        if( bDrop )
            client_cmd( iVictim, "drop" );
        
        return HAM_IGNORED;
    }

    public Ham_PlayerResetSpeedPost( id )
    {
        if( g_iGang[ id ] == -1 || !is_user_alive( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        if( aData[ GangStamina ] > 0 && get_user_maxspeed( id ) > 1.0 )
            set_user_maxspeed( id, 250.0 + ( aData[ GangStamina ] * get_pcvar_num( g_pStaminaPerLevel ) ) );
            
        return HAM_IGNORED;
    }

    public Event_DeathMsg()
    {
        new iKiller = read_data( 1 );
        new iVictim = read_data( 2 );
        
        if( !is_user_alive( iKiller ) || cs_get_user_team( iVictim ) != CS_TEAM_CT || cs_get_user_team( iKiller ) != CS_TEAM_T )
            return PLUGIN_CONTINUE;
        
        new iTotal = get_pcvar_num( g_pPointsPerKill ) + ( bool:read_data( 3 ) ? get_pcvar_num( g_pHeadshotBonus ) : 0 );
        
        if( g_iGang[ iKiller ] > -1 )
        {
            new aData[ GangInfo ];
            ArrayGetArray( g_aGangs, g_iGang[ iKiller ], aData );
            aData[ GangKills ]++;
            ArraySetArray( g_aGangs, g_iGang[ iKiller ], aData );
            
            iTotal += iTotal * ( aData[ GangStealing ] * get_pcvar_num( g_pStealingPerLevel ) );
        }
        
        g_iPoints[ iKiller ] += iTotal;
        
        return PLUGIN_CONTINUE;
    }

    public Cmd_Gang( id )
    {    
        if( !is_user_connected( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSadece Mahkumlar Bu Menuye Girebilir Dostum",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        static szMenu[ 512 ], iLen, aData[ GangInfo ], iKeys, iStatus;
        
        iKeys = MENU_KEY_0 | MENU_KEY_4;
        
        iStatus = getStatus( id, g_iGang[ id ] );
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\y %s^n", aData[ GangName ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \dKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
        }
        
        else
        {
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\r None^n" );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \wKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
            
            iKeys |= MENU_KEY_1;
        }
        
        
        if( iStatus > STATUS_MEMBER && g_iGang[ id ] > -1 && get_pcvar_num( g_pMaxMembers ) > aData[ NumMembers ] )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \wKlana Birini Davet Et^n" );
            iKeys |= MENU_KEY_2;
        }
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \dKlana Birini Davet Et^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \wOzellikler^n" );
            iKeys |= MENU_KEY_3;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \dOzellikler^n" );
            
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r4. \wTop-10 Klan^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \wKlandan Ayril^n" );
            iKeys |= MENU_KEY_5;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \dKlandan Ayril^n" );
        
        
        if( iStatus > STATUS_MEMBER )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \wKlan Yetkili Menusu^n" );
            iKeys |= MENU_KEY_6;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \dKlan Lider Menusu^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \wOnline Uyeler^n" );
            iKeys |= MENU_KEY_7;
        }
            
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \dOnline Uyeler^n" );
        
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Gang Menu" );
        
        return PLUGIN_CONTINUE;
    }

    public GangMenu_Handler( id, iKey )
    {
        switch( ( iKey + 1 ) % 10 )
        {
            case 0: return PLUGIN_HANDLED;
            
            case 1:
            {
                if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
                {
                    client_cmd( id, "messagemode gang_name" );
                }
                
                else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Varmi",g_szPrefix );
                    
                    return PLUGIN_HANDLED;
                }
                
                else
                    client_cmd( id, "messagemode gang_name" );
            }
            
            case 2:
            {
                ShowInviteMenu( id );
            }
            
            case 3:
            {
                ShowSkillsMenu( id );
            }
            
            case 4:
            {
                Cmd_Top10( id );
            }
            
            case 5:
            {
                ShowLeaveConfirmMenu( id );
            }
            
            case 6:
            {
                ShowLeaderMenu( id );
            }
            
            case 7:
            {
                ShowMembersMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public Cmd_CreateGang( id )
    {
        new bool:bAdmin = false;
        
        if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
        {
            bAdmin = true;
        }
        
        else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Yok!",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( g_iGang[ id ] > -1 )
        {
            renkli_yazi(id,"!n[!t%s!n] !gZaten Bir Klandasin",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gMahkumlar Klan Kurabilir",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        new szArgs[ 60 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        remove_quotes( szArgs );
        
        if( TrieKeyExists( g_tGangNames, szArgs ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gBoyle bir klan kayitlarda mevcut",g_szPrefix );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new aData[ GangInfo ];
        
        aData[ GangName ]         = szArgs;
        aData[ GangHP ]         = 0;
        aData[ GangStealing ]     = 0;
        aData[ GangGravity ]     = 0;
        aData[ GangStamina ]     = 0;
        aData[ GangWeaponDrop ] = 0;
        aData[ GangDamage ]     = 0;
        aData[ NumMembers ]     = 0;
        aData[ GangMembers ]     = _:TrieCreate();
        
        ArrayPushArray( g_aGangs, aData );
        
        if( !bAdmin )
            g_iPoints[ id ] -= get_pcvar_num( g_pCreateCost );
        
        set_user_gang( id, ArraySize( g_aGangs ) - 1, STATUS_LEADER );
        
        renkli_yazi(id,"!n[!t%s!n] !gKlani Kurdunuz Hadi Hayirli Olsun %s ", g_szPrefix, szArgs );
        
        return PLUGIN_HANDLED;
    }

    public ShowInviteMenu( id )
    {    
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new szInfo[ 6 ], hMenu;
        hMenu = menu_create( "Choose a Player to Invite:", "InviteMenu_Handler" );
        new szName[ 32 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            
            if( iPlayer == id || g_iGang[ iPlayer ] == g_iGang[ id ] || cs_get_user_team( iPlayer ) != CS_TEAM_T )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szInfo, charsmax( szInfo ) );
            
            menu_additem( hMenu, szName, szInfo );
        }
            
        menu_display( id, hMenu, 0 );
    }

    public InviteMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new szData[ 6 ], iAccess, hCallback, szName[ 32 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, 31, hCallback );
        
        new iPlayer = str_to_num( szData );

        if( !is_user_connected( iPlayer ) )
            return PLUGIN_HANDLED;
            
        ShowInviteConfirmMenu( id, iPlayer );

        renkli_yazi(id,"!n[!t%s!n] !g%s Adli Oyuncuyu Klanina Katilmasi Icin Davet Ettiniz ", g_szPrefix, szName );
        
        
        Cmd_Gang( id );
        return PLUGIN_HANDLED;
    }

    public ShowInviteConfirmMenu( id, iPlayer )
    {
        new szName[ 32 ];
        get_user_name( id, szName, charsmax( szName ) );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        new szMenuTitle[ 128 ];
        formatex( szMenuTitle, charsmax( szMenuTitle ), "%s Seni    %s Klanina Davet Etti", szName, aData[ GangName ] );
        new hMenu = menu_create( szMenuTitle, "InviteConfirmMenu_Handler" );
        
        new szInfo[ 6 ];
        num_to_str( g_iGang[ id ], szInfo, 5 );
        
        menu_additem( hMenu, "Klana Gir", szInfo );
        menu_additem( hMenu, "Klana Girme", "-1" );
        
        menu_display( iPlayer, hMenu, 0 );    
    }

    public InviteConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        new iGang = str_to_num( szData );
        
        if( iGang == -1 )
            return PLUGIN_HANDLED;
        
        if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
        {
            renkli_yazi(id,"!n[!t%s!n] !g Senin Zaten Bir Klanin Var!", g_szPrefix);
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( id, iGang );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        renkli_yazi(id,"!n[!t%s!n] !g Basarili bir bicimde Klana katildin ^%s.", g_szPrefix, aData[ GangName ] );
        
        return PLUGIN_HANDLED;
    }
        

    public ShowSkillsMenu( id )
    {    
        static szMenu[ 512 ], iLen, iKeys, aData[ GangInfo ];
        
        if( !iKeys )
        {
            iKeys = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_0;
        }
        
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        iLen    =    formatex( szMenu, charsmax( szMenu ), "\ySkill Menu^n^n" );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r1. \wCan Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pHealthCost ), aData[ GangHP ], get_pcvar_num( g_pHealthMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r2. \wCalma Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStealingCost ), aData[ GangStealing ], get_pcvar_num( g_pStealingMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r3. \wYerCekimi Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pGravityCost ), aData[ GangGravity ], get_pcvar_num( g_pGravityMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r4. \wHasar Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pDamageCost ), aData[ GangDamage ], get_pcvar_num( g_pDamageMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r5. \wSilah Dusurme Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_psweaponDropCost ), aData[ GangWeaponDrop ], get_pcvar_num( g_psweaponDropMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r6. \wHiz Gelistirme [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStaminaCost ), aData[ GangStamina ], get_pcvar_num( g_pStaminaMax ) );
        
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Skills Menu" );
    }

    public SkillsMenu_Handler( id, iKey )
    {
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        switch( ( iKey + 1 ) % 10 )
        {
            case 0:
            {
                Cmd_Gang( id );
                return PLUGIN_HANDLED;
            }
            
            case 1:
            {
                if( aData[ GangHP ] == get_pcvar_num( g_pHealthMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pHealthCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangHP ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 2:
            {
                if( aData[ GangStealing ] == get_pcvar_num( g_pStealingMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStealingCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStealing ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 3:
            {
                if( aData[ GangGravity ] == get_pcvar_num( g_pGravityMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pGravityCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangGravity ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 4:
            {
                if( aData[ GangDamage ] == get_pcvar_num( g_pDamageMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pDamageCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangDamage ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 5:
            {
                if( aData[ GangWeaponDrop ] == get_pcvar_num( g_psweaponDropMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_psweaponDropCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangWeaponDrop ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 6:
            {
                if( aData[ GangStamina ] == get_pcvar_num( g_pStaminaMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    renkli_yazi(id,"!n[!t%s!n] !gYeteri Kadar Puanin Yok!!?", g_szPrefix );
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStaminaCost );
                
                if( iRemaining < 0 )
                {
                    
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStamina ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
        }
        
        ArraySetArray( g_aGangs, g_iGang[ id ], aData );
        
        new iPlayers[ 32 ], iNum, iPlayer;
        new szName[ 32 ];
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( iPlayer == id || g_iGang[ iPlayer ] != g_iGang[ id ] )
                continue;
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Bir Ozellik Gelistirdi", g_szPrefix, szName )
        }

        renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir sekilde Klani gelistirdin", g_szPrefix )
        
        ShowSkillsMenu( id );
        
        return PLUGIN_HANDLED;
    }
            
        
    public Cmd_Top10( id )
    {
        new iSize = ArraySize( g_aGangs );
        
        new iOrder[ 100 ][ 2 ];
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < iSize; i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            iOrder[ i ][ 0 ] = i;
            iOrder[ i ][ 1 ] = aData[ GangKills ];
        }
        
        SortCustom2D( iOrder, iSize, "Top10_Sort" );
        
        new szMessage[ 2048 ];
        formatex( szMessage, charsmax( szMessage ), "<body bgcolor=#000000><font color=#FFB000><pre>" );
        format( szMessage, charsmax( szMessage ), "%s%2s %-22.22s %7s %4s %10s %9s %9s %11s %8s^n", szMessage, "#", "Klan", "Oldurme", "Can", "Hirsizlik",
            "YerCekimi", "Dayaniklilik", "SilahDusurme", "Hasar" );
            
        for( new i = 0; i < min( 10, iSize ); i++ )
        {
            ArrayGetArray( g_aGangs, iOrder[ i ][ 0 ], aData );
            
            format( szMessage, charsmax( szMessage ), "%s%-2d %22.22s %7d %4d %10d %9d %9d %11d %8d^n", szMessage, i + 1, aData[ GangName ],
            aData[ GangKills ], aData[ GangHP ], aData[ GangStealing ], aData[ GangGravity ], aData[ GangStamina], aData[ GangWeaponDrop ], aData[ GangDamage ] );
        }
        
        show_motd( id, szMessage, "Gang Top 10" );
    }

    public Top10_Sort( const iElement1[ ], const iElement2[ ], const iArray[ ], szData[], iSize )
    {
        if( iElement1[ 1 ] > iElement2[ 1 ] )
            return -1;
        
        else if( iElement1[ 1 ] < iElement2[ 1 ] )
            return 1;
        
        return 0;
    }

    public ShowLeaveConfirmMenu( id )
    {
        new hMenu = menu_create( "Cikmak Istedigine Eminmisin", "LeaveConfirmMenu_Handler" );
        menu_additem( hMenu, "Evet!, Simdi cik.", "0" );
        menu_additem( hMenu, "Hayir.! Cikmayacagim.", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public LeaveConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gLiderligi Devretmen Yada Klan Yetkili Yerinden Klani Sil.", g_szPrefix)
                    Cmd_Gang( id );
                    
                    return PLUGIN_HANDLED;
                }
                
                renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir Sekilde Bulundugun Klandan Ciktiniz", g_szPrefix);
                set_user_gang( id, -1 );
                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowLeaderMenu( id )
    {
        new hMenu = menu_create( "Klan Lider Menusu", "LeaderMenu_Handler" );
        
        new iStatus = getStatus( id, g_iGang[ id ] );
        
        if( iStatus == STATUS_LEADER )
        {
            menu_additem( hMenu, "Klani Kapat/Sil", "0" );
            menu_additem( hMenu, "Liderligi Devret", "1" );
            menu_additem( hMenu, "Yetkili Ekle", "4" );
            menu_additem( hMenu, "Yetkili Sil", "5" );
        }
        
        menu_additem( hMenu, "Birini Klandan At", "2" );
        menu_additem( hMenu, "Klan Ismini Degistir", "3" );
        
        
        menu_display( id, hMenu, 0 );
    }

    public LeaderMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                ShowDisbandConfirmMenu( id );
            }
            
            case 1:
            {
                ShowTransferMenu( id );
            }
            
            case 2:
            {
                ShowKickMenu( id );
            }
            
            case 3:
            {
                client_cmd( id, "messagemode New_Name" );
            }
            
            case 4:
            {
                ShowAddAdminMenu( id );
            }
            
            case 5:
            {
                ShowRemoveAdminMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowDisbandConfirmMenu( id )
    {
        new hMenu = menu_create( "Yoluna Bir Gururla Ciktigin Klanini Kapatacakmisin.", "DisbandConfirmMenu_Handler" );
        menu_additem( hMenu, "Ne Yazikki Kapatacagim", "0" );
        menu_additem( hMenu, "Hayir Yoluma Devam Edecegim!!", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public DisbandConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
        
                renkli_yazi(id,"!n[!t%s!n] !gBunu Yasadigin Icin Uzgunuz Klanini Kapattin.", g_szPrefix)
                
                new iPlayers[ 32 ], iNum;
                
                get_players( iPlayers, iNum );
                
                new iPlayer;
                
                for( new i = 0; i < iNum; i++ )
                {
                    iPlayer = iPlayers[ i ];
                    
                    if( iPlayer == id )
                        continue;
                    
                    if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                        continue;

                    renkli_yazi(id,"!n[!t%s!n] !gLiderin Az Once Klani Kapatti.!", g_szPrefix)
                    set_user_gang( iPlayer, -1 );
                }
                
                new iGang = g_iGang[ id ];
                
                set_user_gang( id, -1 );
                
                ArrayDeleteItem( g_aGangs, iGang );

                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowTransferMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum, "e", "TERRORIST" );
        
        new hMenu = menu_create( "Liderligini Buna Devret :", "TransferMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public TransferMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSectigin Oyuncu Oyunda Degil!", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, g_iGang[ id ], STATUS_LEADER );
        set_user_gang( id, g_iGang[ id ], STATUS_ADMIN );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );

        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer )
            {
                renkli_yazi(id,"!n[!t%s!n] !gBulundugun Klanin Liderligi Sana Devredildi!", g_szPrefix)
                continue;
            }
            
            else if( g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;
            
            renkli_yazi(iTemp,"!n[!t%s!n] !g+_-_-%s-_-_+ Klanininizin Yeni Lideri Cok Yasa %s", g_szPrefix, szName);
        }
        
        return PLUGIN_HANDLED;
    }


    public ShowKickMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Kick Player From Gang:", "KickMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public KickMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gOyuncu Su Anda Oyunda Degil", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, -1 );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer || g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;

            renkli_yazi(iTemp,"!n[!t%s!n] !g%s Bulundugun Klandan Atildi Elveda %s", g_szPrefix, szName);
        }
    
        renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Klandan Atildin/Kovuldun ", g_szPrefix, szName );
        
        return PLUGIN_HANDLED;
    }

    public ChangeName_Handler( id )
    {
        if( g_iGang[ id ] == -1 || getStatus( id, g_iGang[ id ] ) == STATUS_MEMBER )
        {
            return;
        }
        
        new iGang = g_iGang[ id ];
        
        new szArgs[ 64 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new bool:bInGang[ 33 ];
        new iStatus[ 33 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
        
            bInGang[ iPlayer ] = true;
            iStatus[ iPlayer ] = getStatus( id, iGang );
            
            set_user_gang( iPlayer, -1 );
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        aData[ GangName ] = szArgs;
        
        ArraySetArray( g_aGangs, iGang, aData );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( !bInGang[ iPlayer ] )
                continue;
            
            set_user_gang( iPlayer, iGang, iStatus[ id ] );
        }
    }
        
    public ShowAddAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Oyuncu Seciniz", "AddAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) > STATUS_MEMBER )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public AddAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_LEADER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Adminden Dusuruldu", g_szPrefix, szName );

        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !g Adminden Dusuruldunuz", g_szPrefix );
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }

    public ShowRemoveAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Choose a Player to Demote:", "RemoveAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) != STATUS_ADMIN )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public RemoveAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_MEMBER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(id,"!n[!t%s!n] !g%s Klan Yoneticiliginden Dusuruldu.", g_szPrefix, szName)
        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !gKlan Yoneticiliginden Dusuruldunuz.", g_szPrefix);
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }
        
    public ShowMembersMenu( id )
    {
        new szName[ 64 ], iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Online Members:", "MemberMenu_Handler" );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            switch( getStatus( iPlayer, g_iGang[ id ] ) )
            {
                case STATUS_MEMBER:
                {
                    add( szName, charsmax( szName ), " \r[Uye]" );
                }
                
                case STATUS_ADMIN:
                {
                    add( szName, charsmax( szName ), " \r[Yetkili]" );
                }
                
                case STATUS_LEADER:
                {
                    add( szName, charsmax( szName ), " \r[Lider]" );
                }
            }

            menu_additem( hMenu, szName );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public MemberMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        menu_destroy( hMenu );
        
        ShowMembersMenu( id )
        return PLUGIN_HANDLED;
    }

    // Credits to Tirant from zombie mod and xOR from xRedirect
    public LoadGangs()
    {
        new szConfigsDir[ 60 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        new iFile = fopen( szConfigsDir, "rt" );
        
        new aData[ GangInfo ];
        
        new szBuffer[ 512 ], szData[ 6 ], szValue[ 6 ], i, iCurGang;
        
        while( !feof( iFile ) )
        {
            fgets( iFile, szBuffer, charsmax( szBuffer ) );
            
            trim( szBuffer );
            remove_quotes( szBuffer );
            
            if( !szBuffer[ 0 ] || szBuffer[ 0 ] == ';' )
            {
                continue;
            }
            
            if( szBuffer[ 0 ] == '[' && szBuffer[ strlen( szBuffer ) - 1 ] == ']' )
            {
                copy( aData[ GangName ], strlen( szBuffer ) - 2, szBuffer[ 1 ] );
                aData[ GangHP ] = 0;
                aData[ GangStealing ] = 0;
                aData[ GangGravity ] = 0;
                aData[ GangStamina ] = 0;
                aData[ GangWeaponDrop ] = 0;
                aData[ GangDamage ] = 0;
                aData[ GangKills ] = 0;
                aData[ NumMembers ] = 0;
                aData[ GangMembers ] = _:TrieCreate();
                
                if( TrieKeyExists( g_tGangNames, aData[ GangName ] ) )
                {
                    new szError[ 256 ];
                    formatex( szError, charsmax( szError ), "[JB Gangs] Gang already exists: %s", aData[ GangName ] );
                    set_fail_state( szError );
                }
                
                ArrayPushArray( g_aGangs, aData );
                
                TrieSetCell( g_tGangNames, aData[ GangName ], iCurGang );

                log_amx( "Gang Created: %s", aData[ GangName ] );
                
                iCurGang++;
                
                continue;
            }
            
            strtok( szBuffer, szData, 31, szValue, 511, '=' );
            trim( szData );
            trim( szValue );
            
            if( TrieGetCell( g_tGangValues, szData, i ) )
            {
                ArrayGetArray( g_aGangs, iCurGang - 1, aData );
                
                switch( i )
                {                    
                    case VALUE_HP:
                        aData[ GangHP ] = str_to_num( szValue );
                    
                    case VALUE_STEALING:
                        aData[ GangStealing ] = str_to_num( szValue );
                    
                    case VALUE_GRAVITY:
                        aData[ GangGravity ] = str_to_num( szValue );
                    
                    case VALUE_STAMINA:
                        aData[ GangStamina ] = str_to_num( szValue );
                    
                    case VALUE_WEAPONDROP:
                        aData[ GangWeaponDrop ] = str_to_num( szValue );
                        
                    case VALUE_DAMAGE:
                        aData[ GangDamage ] = str_to_num( szValue );
                    
                    case VALUE_KILLS:
                        aData[ GangKills ] = str_to_num( szValue );
                }
                
                ArraySetArray( g_aGangs, iCurGang - 1, aData );
            }
        }
        
        new Array:aSQL;
        sqlv_read_all_ex( g_hVault, aSQL );
        
        new aVaultData[ SQLVaultEntryEx ];
        
        new iGang;
        
        for( i = 0; i < ArraySize( aSQL ); i++ )
        {
            ArrayGetArray( aSQL, i, aVaultData );
            
            if( TrieGetCell( g_tGangNames, aVaultData[ SQLVEx_Key2 ], iGang ) )
            {
                ArrayGetArray( g_aGangs, iGang, aData );
                
                TrieSetCell( aData[ GangMembers ], aVaultData[ SQLVEx_Key1 ], str_to_num( aVaultData[ SQLVEx_Data ] ) );
                
                aData[ NumMembers ]++;
                
                ArraySetArray( g_aGangs, iGang, aData );
            }
        }
        
        fclose( iFile );
    }

    public SaveGangs()
    {
        new szConfigsDir[ 64 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        if( file_exists( szConfigsDir ) )
            delete_file( szConfigsDir );
            
        new iFile = fopen( szConfigsDir, "wt" );
            
        new aData[ GangInfo ];
        
        new szBuffer[ 256 ];

        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            formatex( szBuffer, charsmax( szBuffer ), "[%s]^n", aData[ GangName ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Can=%i^n", aData[ GangHP ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hirsizlik=%i^n", aData[ GangStealing ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "YerCekimi=%i^n", aData[ GangGravity ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Dayaniklilik=%i^n", aData[ GangStamina ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "SilahDusurme=%i^n", aData[ GangWeaponDrop ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hasar=%i^n", aData[ GangDamage ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Oldurme=%i^n^n", aData[ GangKills ] );
            fputs( iFile, szBuffer );
        }
        
        fclose( iFile );
    }
        
        

    set_user_gang( id, iGang, iStatus=STATUS_MEMBER )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );

        new aData[ GangInfo ];
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            TrieDeleteKey( aData[ GangMembers ], szAuthID );
            aData[ NumMembers ]--;
            ArraySetArray( g_aGangs, g_iGang[ id ], aData );
            
            sqlv_remove_ex( g_hVault, szAuthID, aData[ GangName ] );
        }

        if( iGang > -1 )
        {
            ArrayGetArray( g_aGangs, iGang, aData );
            TrieSetCell( aData[ GangMembers ], szAuthID, iStatus );
            aData[ NumMembers ]++;
            ArraySetArray( g_aGangs, iGang, aData );
            
            sqlv_set_num_ex( g_hVault, szAuthID, aData[ GangName ], iStatus );        
        }

        g_iGang[ id ] = iGang;
        
        return 1;
    }
        
    get_user_gang( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            if( TrieKeyExists( aData[ GangMembers ], szAuthID ) )
                return i;
        }
        
        return -1;
    }
                
    getStatus( id, iGang )
    {
        if( !is_user_connected( id ) || iGang == -1 )
            return STATUS_NONE;
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new iStatus;
        TrieGetCell( aData[ GangMembers ], szAuthID, iStatus );
        
        return iStatus;
    }
    stock renkli_yazi(const id, const input[], any:...)
    {
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);

    replace_all(msg, 190, "!n", "^x01");
    replace_all(msg, 190, "!t", "^x03");
    replace_all(msg, 190, "!g", "^x04");

    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, get_user_msgid("SayText"), _, players[i]);
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
    
        }
    }
    }
    stock bool:is_user_steam(id)
    {
        static dp_pointer;
    
        if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
        {
            server_cmd("dp_clientinfo %d", id);
            server_exec();
            return (get_pcvar_num(dp_pointer) == 2) ? true : false;
        }
    
        new szAuthid[34];
        get_user_authid(id, szAuthid, charsmax(szAuthid));
    
        return (containi(szAuthid, "LAN") < 0);
    }

reCs:Go Rank Menu (%50)
#5
(15-01-2022, 20:15)bilalgecer47 Adlı Kullanıcıdan Alıntı:
(15-01-2022, 19:55)JukeLord12 Adlı Kullanıcıdan Alıntı: siz degistirip atabilirmisiniz.
Kod:
    /* Includes */
        
        #include < amxmodx >
        #include < amxmisc >
        #include < sqlvault_ex >
        #include < cstrike >
        #include < hamsandwich >
        #include < fun >
        
    /* Defines */
    
        #define ADMIN_CREATE    ADMIN_LEVEL_B
        #define FLAG ADMIN_RESERVATION
        #define cm(%0)    ( sizeof(%0) - 1 )    
        

    /* Constants */
    
        new const g_szVersion[ ] = "1.1.7";

        enum _:GangInfo
        {
            Trie:GangMembers,
            GangName[ 64 ],
            GangHP,
            GangStealing,
            GangGravity,
            GangDamage,
            GangStamina,
            GangWeaponDrop,
            GangKills,
            NumMembers
        };
            
        enum
        {
            VALUE_HP,
            VALUE_STEALING,
            VALUE_GRAVITY,
            VALUE_DAMAGE,
            VALUE_STAMINA,
            VALUE_WEAPONDROP,
            VALUE_KILLS
        }

        enum
        {
            STATUS_NONE,
            STATUS_MEMBER,
            STATUS_ADMIN,
            STATUS_LEADER
        };

        new const g_szGangValues[ ][ ] =
        {
            "HP",
            "Stealing",
            "Gravity",
            "Damage",
            "Stamina",
            "WeaponDrop",
            "Kills"
        };

        new const g_szPrefix[ ] = "^04[Clan System]^01";

    /* Tries */
    
        new Trie:g_tGangNames;
        new Trie:g_tGangValues;

    /* Vault */
    
        new SQLVault:g_hVault;
        new SQLVault:g_hPointsVault;

    /* Arrays */
    
        new Array:g_aGangs;

    /* Pcvars */
    
        new g_pCreateCost;
        new COLCHAR[3][2] = { "^x03", "^x04", "^x01" }
        new p_namecol
        new alv_sndr, alv_str2[26], alv_str4[101]
        new msg[200]

        new g_pHealthCost;
        new g_pStealingCost;
        new g_pGravityCost;
        new g_pDamageCost;
        new g_pStaminaCost;
        new g_psweaponDropCost;

        new g_pHealthMax;
        new g_pStealingMax;
        new g_pGravityMax;
        new g_pDamageMax;
        new g_pStaminaMax;
        new g_psweaponDropMax;

        new g_pHealthPerLevel;
        new g_pStealingPerLevel;
        new g_pGravityPerLevel;
        new g_pDamagePerLevel;
        new g_pStaminaPerLevel;
        new g_psweaponDropPerLevel;

        new g_pPointsPerKill;
        new g_pHeadshotBonus;

        new g_pMaxMembers;
        new g_pAdminCreate;


    /* Integers */
    
        new g_iGang[ 33 ];
        new g_iPoints[ 33 ];
        

    public plugin_init()
    {
        register_plugin( "Klan Sistemi", g_szVersion, "Pazee" );
        
        g_aGangs                 = ArrayCreate( GangInfo );

        g_tGangValues             = TrieCreate();
        g_tGangNames             = TrieCreate();
        
        g_hVault                 = sqlv_open_local( "jb_gangs", false );
        sqlv_init_ex( g_hVault );

        g_hPointsVault            = sqlv_open_local( "jb_points", true );
        
        g_pCreateCost            = register_cvar( "jb_gang_cost",         "0" );
        g_pHealthCost            = register_cvar( "jb_health_cost",         "20" );
        g_pStealingCost         = register_cvar( "jb_stealing_cost",     "20" );
        g_pGravityCost            = register_cvar( "jb_gravity_cost",     "20" );
        g_pDamageCost            = register_cvar( "jb_damage_cost",         "20" );
        g_pStaminaCost            = register_cvar( "jb_stamina_cost",     "20" );
        g_psweaponDropCost        = register_cvar( "jb_weapondrop_cost",     "20" );

        g_pHealthMax            = register_cvar( "jb_health_max",         "10" );
        g_pStealingMax            = register_cvar( "jb_stealing_max",     "10" );
        g_pGravityMax            = register_cvar( "jb_gravity_max",         "10" );
        g_pDamageMax            = register_cvar( "jb_damage_max",         "10" );
        g_pStaminaMax            = register_cvar( "jb_stamina_max",         "10" );
        g_psweaponDropMax        = register_cvar( "jb_weapondrop_max",     "10" );

        g_pHealthPerLevel        = register_cvar( "jb_health_per",         "10"     );
        g_pStealingPerLevel        = register_cvar( "jb_stealing_per",     "0.05"     );
        g_pGravityPerLevel        = register_cvar( "jb_gravity_per",         "50"     );
        g_pDamagePerLevel        = register_cvar( "jb_damage_per",         "3"     );
        g_pStaminaPerLevel        = register_cvar( "jb_stamina_per",         "3"     );
        g_psweaponDropPerLevel     = register_cvar( "jb_weapondrop_per",     "1"     );

        g_pPointsPerKill        = register_cvar( "jb_points_per_kill",    "3" );
        g_pHeadshotBonus        = register_cvar( "jb_headshot_bonus",    "2" );
        p_namecol = register_cvar( "csm_namecolor", "0" )
        
        register_message( get_user_msgid("SayText"), "col_changer" )
        
        g_pMaxMembers            = register_cvar( "jb_max_members",        "10" );
        g_pAdminCreate            = register_cvar( "jb_admin_create",     "0" );
        
        register_menu( "Gang Menu", 1023, "GangMenu_Handler" );
        register_menu( "Skills Menu", 1023, "SkillsMenu_Handler" );
        
        for( new i = 0; i < sizeof g_szGangValues; i++ )
        {
            TrieSetCell( g_tGangValues, g_szGangValues[ i ], i );
        }

        RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn_Post", 1 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Pre", 0 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Post", 1 );
        RegisterHam( Ham_Item_PreFrame, "player", "Ham_PlayerResetSpeedPost", 1);
        
        register_event( "DeathMsg", "Event_DeathMsg", "a" );
                
        register_clcmd( "say /klan", "Cmd_Gang" );
        register_clcmd( "say /kaydet", "kaydet" );
        register_clcmd( "gang_name", "Cmd_CreateGang" );
        
        
        register_logevent( "elsonu", 2, "1=Round_End" );
        register_logevent( "elbasi", 2, "1=Round_Start" );
        
        LoadGangs();
    }
    public elsonu()
    {
    }
    public elbasi()
    {
    SaveGangs();
    glkaydet();
    }

    public client_disconnected( id )
    {
        g_iGang[ id ] = -1;
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
    }
    public glkaydet()
    {
        new players[32],inum,id
        get_players(players,inum)
        for(new i;i<inum;i++)
        {
            id = players[i]
            kaydet(id)
        }
    }
    public col_changer( msg_id, msg_dest, rcvr )
    {
        new str2[26]
        get_msg_arg_string( 2, str2, 25 )
        if( equal( str2, "#Cstrike_Chat", 13 ) )
        {
            new str3[22]
            get_msg_arg_string( 3, str3, 21 )
        
            if( !strlen( str3 ) )
            {
                new str4[101]
                get_msg_arg_string( 4, str4, 100 )
                new sndr = get_msg_arg_int( 1 )
            
                new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
            
                new sndr_team = get_user_team( sndr )
                new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
            
                new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
            
                new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
            
                if( !same_as_last )
                {
                
                
                    if( !( is_team_msg && ( is_sndr_spec || is_team_msg) ) )
                    {
                        new flags[5], team[10]
                        if( is_user_alive( sndr ) ) flags = "bc"
                        else flags = "ac"
                    
                        if( is_team_msg )
                        {
                            add( flags[strlen( flags )], 4, "e" )
                            if( sndr_team == 1 ) team = "TERRORIST"
                            else team = "CT"
                        }
                    
                        new players[32], num
                        get_players( players, num, flags, team )
                        if( get_user_flags( sndr ) & FLAG)
                            buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )
                        else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, str4 )
                    
                        for( new i=0; i < num; i++ )
                        {
                            if(is_user_alive(players[i]) && get_user_flags( players[i] ) & FLAG || !is_user_alive(players[i])){
                                message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
                                write_byte( sndr )
                                write_string( msg )
                                message_end()
                            }
                        }
                    
                    }
    
                    alv_sndr = sndr
                    alv_str2 = str2
                    alv_str4 = str4
                    if( task_exists( 411 ) ) remove_task( 411 )
                    set_task( 0.1, "task_clear_antiloop_vars", 411 )
                
                }
            
                if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )

                set_msg_arg_string( 2, msg )
                set_msg_arg_string( 4, "" )
            
            }
        }
        return PLUGIN_CONTINUE
    }

    public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4[ ] )
    {
        new sndr_name[33]
        get_user_name( sndr, sndr_name, 32 )
    
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ sndr ], aData );
    
        new prefix[30] = "^x01"
    
        if(is_user_admin(sndr)){
            if(!(get_user_flags(sndr) == FLAG)){
                if(is_user_steam(sndr)){
                }
                else if(!is_user_steam(sndr)){
                }
            }
            else{
                if(is_user_steam(sndr)){    
                }
                else if(!is_user_steam(sndr)){
                }
            }
        }
        else {
            if(is_user_steam(sndr)){
                if( g_iGang[ sndr ] == -1 )
                {
                return HAM_IGNORED;
                }
            }
            else{
                prefix = "^x01"
            }
        }
        if( is_sndr_spec ) add( prefix[strlen(prefix)-1], 29, "*Spec*" )
        else if( !is_user_alive( sndr ) ) add( prefix[strlen(prefix)-1], 29, "*Olu*" )
    
    
        if( is_team_msg )
        {
            if( is_sndr_spec ) prefix = "^x01(Spec) "
            else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "*(TE)*" )
            else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "*(CT)*" )
        }
        if(get_user_flags(sndr) & ADMIN_RESERVATION)
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x04%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x04%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }        
    
        }
        else
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x01%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x01%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }
        }
        return PLUGIN_HANDLED
    }

    public task_clear_antiloop_vars( )
    {
        alv_sndr = 0
        alv_str2 = ""
        alv_str4 = ""
        return PLUGIN_HANDLED
    }
    public kaydet(id)
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
        
    }
    public client_putinserver( id )
    {
        g_iGang[ id ] = get_user_gang( id );
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
    }
    public plugin_end()
    {
        SaveGangs();
        glkaydet();
        sqlv_close( g_hVault );
    }
    public Ham_PlayerSpawn_Post( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
                
            
        if( g_iGang[ id ] == -1 )
        {
            return HAM_IGNORED;
        }
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        kaydet(id)
        
        new iHealth = 100 + aData[ GangHP ] * get_pcvar_num( g_pHealthPerLevel );
        set_user_health( id, iHealth );
        
        new iGravity = 800 - ( get_pcvar_num( g_pGravityPerLevel ) * aData[ GangGravity ] );
        set_user_gravity( id, float( iGravity ) / 800.0 );
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
            
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Pre( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || cs_get_user_team( iAttacker ) != CS_TEAM_T )
            return HAM_IGNORED;
            
        if( g_iGang[ iAttacker ] == -1 )
            return HAM_IGNORED;
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        SetHamParamFloat( 4, flDamage + ( get_pcvar_num( g_pDamagePerLevel ) * ( aData[ GangDamage ] ) ) );
        
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Post( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || g_iGang[ iAttacker ] == -1 || get_user_weapon( iAttacker ) != CSW_KNIFE || cs_get_user_team( iAttacker ) != CS_TEAM_T  )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        new iChance = aData[ GangWeaponDrop ] * get_pcvar_num( g_psweaponDropPerLevel );
        
        if( iChance == 0 )
            return HAM_IGNORED;
        
        new bool:bDrop = ( random_num( 1, 100 ) <= iChance );
        
        if( bDrop )
            client_cmd( iVictim, "drop" );
        
        return HAM_IGNORED;
    }

    public Ham_PlayerResetSpeedPost( id )
    {
        if( g_iGang[ id ] == -1 || !is_user_alive( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        if( aData[ GangStamina ] > 0 && get_user_maxspeed( id ) > 1.0 )
            set_user_maxspeed( id, 250.0 + ( aData[ GangStamina ] * get_pcvar_num( g_pStaminaPerLevel ) ) );
            
        return HAM_IGNORED;
    }

    public Event_DeathMsg()
    {
        new iKiller = read_data( 1 );
        new iVictim = read_data( 2 );
        
        if( !is_user_alive( iKiller ) || cs_get_user_team( iVictim ) != CS_TEAM_CT || cs_get_user_team( iKiller ) != CS_TEAM_T )
            return PLUGIN_CONTINUE;
        
        new iTotal = get_pcvar_num( g_pPointsPerKill ) + ( bool:read_data( 3 ) ? get_pcvar_num( g_pHeadshotBonus ) : 0 );
        
        if( g_iGang[ iKiller ] > -1 )
        {
            new aData[ GangInfo ];
            ArrayGetArray( g_aGangs, g_iGang[ iKiller ], aData );
            aData[ GangKills ]++;
            ArraySetArray( g_aGangs, g_iGang[ iKiller ], aData );
            
            iTotal += iTotal * ( aData[ GangStealing ] * get_pcvar_num( g_pStealingPerLevel ) );
        }
        
        g_iPoints[ iKiller ] += iTotal;
        
        return PLUGIN_CONTINUE;
    }

    public Cmd_Gang( id )
    {    
        if( !is_user_connected( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSadece Mahkumlar Bu Menuye Girebilir Dostum",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        static szMenu[ 512 ], iLen, aData[ GangInfo ], iKeys, iStatus;
        
        iKeys = MENU_KEY_0 | MENU_KEY_4;
        
        iStatus = getStatus( id, g_iGang[ id ] );
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\y %s^n", aData[ GangName ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \dKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
        }
        
        else
        {
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\r None^n" );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \wKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
            
            iKeys |= MENU_KEY_1;
        }
        
        
        if( iStatus > STATUS_MEMBER && g_iGang[ id ] > -1 && get_pcvar_num( g_pMaxMembers ) > aData[ NumMembers ] )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \wKlana Birini Davet Et^n" );
            iKeys |= MENU_KEY_2;
        }
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \dKlana Birini Davet Et^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \wOzellikler^n" );
            iKeys |= MENU_KEY_3;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \dOzellikler^n" );
            
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r4. \wTop-10 Klan^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \wKlandan Ayril^n" );
            iKeys |= MENU_KEY_5;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \dKlandan Ayril^n" );
        
        
        if( iStatus > STATUS_MEMBER )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \wKlan Yetkili Menusu^n" );
            iKeys |= MENU_KEY_6;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \dKlan Lider Menusu^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \wOnline Uyeler^n" );
            iKeys |= MENU_KEY_7;
        }
            
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \dOnline Uyeler^n" );
        
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Gang Menu" );
        
        return PLUGIN_CONTINUE;
    }

    public GangMenu_Handler( id, iKey )
    {
        switch( ( iKey + 1 ) % 10 )
        {
            case 0: return PLUGIN_HANDLED;
            
            case 1:
            {
                if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
                {
                    client_cmd( id, "messagemode gang_name" );
                }
                
                else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Varmi",g_szPrefix );
                    
                    return PLUGIN_HANDLED;
                }
                
                else
                    client_cmd( id, "messagemode gang_name" );
            }
            
            case 2:
            {
                ShowInviteMenu( id );
            }
            
            case 3:
            {
                ShowSkillsMenu( id );
            }
            
            case 4:
            {
                Cmd_Top10( id );
            }
            
            case 5:
            {
                ShowLeaveConfirmMenu( id );
            }
            
            case 6:
            {
                ShowLeaderMenu( id );
            }
            
            case 7:
            {
                ShowMembersMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public Cmd_CreateGang( id )
    {
        new bool:bAdmin = false;
        
        if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
        {
            bAdmin = true;
        }
        
        else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Yok!",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( g_iGang[ id ] > -1 )
        {
            renkli_yazi(id,"!n[!t%s!n] !gZaten Bir Klandasin",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gMahkumlar Klan Kurabilir",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        new szArgs[ 60 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        remove_quotes( szArgs );
        
        if( TrieKeyExists( g_tGangNames, szArgs ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gBoyle bir klan kayitlarda mevcut",g_szPrefix );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new aData[ GangInfo ];
        
        aData[ GangName ]         = szArgs;
        aData[ GangHP ]         = 0;
        aData[ GangStealing ]     = 0;
        aData[ GangGravity ]     = 0;
        aData[ GangStamina ]     = 0;
        aData[ GangWeaponDrop ] = 0;
        aData[ GangDamage ]     = 0;
        aData[ NumMembers ]     = 0;
        aData[ GangMembers ]     = _:TrieCreate();
        
        ArrayPushArray( g_aGangs, aData );
        
        if( !bAdmin )
            g_iPoints[ id ] -= get_pcvar_num( g_pCreateCost );
        
        set_user_gang( id, ArraySize( g_aGangs ) - 1, STATUS_LEADER );
        
        renkli_yazi(id,"!n[!t%s!n] !gKlani Kurdunuz Hadi Hayirli Olsun %s ", g_szPrefix, szArgs );
        
        return PLUGIN_HANDLED;
    }

    public ShowInviteMenu( id )
    {    
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new szInfo[ 6 ], hMenu;
        hMenu = menu_create( "Choose a Player to Invite:", "InviteMenu_Handler" );
        new szName[ 32 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            
            if( iPlayer == id || g_iGang[ iPlayer ] == g_iGang[ id ] || cs_get_user_team( iPlayer ) != CS_TEAM_T )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szInfo, charsmax( szInfo ) );
            
            menu_additem( hMenu, szName, szInfo );
        }
            
        menu_display( id, hMenu, 0 );
    }

    public InviteMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new szData[ 6 ], iAccess, hCallback, szName[ 32 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, 31, hCallback );
        
        new iPlayer = str_to_num( szData );

        if( !is_user_connected( iPlayer ) )
            return PLUGIN_HANDLED;
            
        ShowInviteConfirmMenu( id, iPlayer );

        renkli_yazi(id,"!n[!t%s!n] !g%s Adli Oyuncuyu Klanina Katilmasi Icin Davet Ettiniz ", g_szPrefix, szName );
        
        
        Cmd_Gang( id );
        return PLUGIN_HANDLED;
    }

    public ShowInviteConfirmMenu( id, iPlayer )
    {
        new szName[ 32 ];
        get_user_name( id, szName, charsmax( szName ) );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        new szMenuTitle[ 128 ];
        formatex( szMenuTitle, charsmax( szMenuTitle ), "%s Seni    %s Klanina Davet Etti", szName, aData[ GangName ] );
        new hMenu = menu_create( szMenuTitle, "InviteConfirmMenu_Handler" );
        
        new szInfo[ 6 ];
        num_to_str( g_iGang[ id ], szInfo, 5 );
        
        menu_additem( hMenu, "Klana Gir", szInfo );
        menu_additem( hMenu, "Klana Girme", "-1" );
        
        menu_display( iPlayer, hMenu, 0 );    
    }

    public InviteConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        new iGang = str_to_num( szData );
        
        if( iGang == -1 )
            return PLUGIN_HANDLED;
        
        if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
        {
            renkli_yazi(id,"!n[!t%s!n] !g Senin Zaten Bir Klanin Var!", g_szPrefix);
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( id, iGang );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        renkli_yazi(id,"!n[!t%s!n] !g Basarili bir bicimde Klana katildin ^%s.", g_szPrefix, aData[ GangName ] );
        
        return PLUGIN_HANDLED;
    }
        

    public ShowSkillsMenu( id )
    {    
        static szMenu[ 512 ], iLen, iKeys, aData[ GangInfo ];
        
        if( !iKeys )
        {
            iKeys = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_0;
        }
        
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        iLen    =    formatex( szMenu, charsmax( szMenu ), "\ySkill Menu^n^n" );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r1. \wCan Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pHealthCost ), aData[ GangHP ], get_pcvar_num( g_pHealthMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r2. \wCalma Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStealingCost ), aData[ GangStealing ], get_pcvar_num( g_pStealingMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r3. \wYerCekimi Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pGravityCost ), aData[ GangGravity ], get_pcvar_num( g_pGravityMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r4. \wHasar Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pDamageCost ), aData[ GangDamage ], get_pcvar_num( g_pDamageMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r5. \wSilah Dusurme Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_psweaponDropCost ), aData[ GangWeaponDrop ], get_pcvar_num( g_psweaponDropMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r6. \wHiz Gelistirme [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStaminaCost ), aData[ GangStamina ], get_pcvar_num( g_pStaminaMax ) );
        
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Skills Menu" );
    }

    public SkillsMenu_Handler( id, iKey )
    {
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        switch( ( iKey + 1 ) % 10 )
        {
            case 0:
            {
                Cmd_Gang( id );
                return PLUGIN_HANDLED;
            }
            
            case 1:
            {
                if( aData[ GangHP ] == get_pcvar_num( g_pHealthMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pHealthCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangHP ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 2:
            {
                if( aData[ GangStealing ] == get_pcvar_num( g_pStealingMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStealingCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStealing ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 3:
            {
                if( aData[ GangGravity ] == get_pcvar_num( g_pGravityMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pGravityCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangGravity ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 4:
            {
                if( aData[ GangDamage ] == get_pcvar_num( g_pDamageMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pDamageCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangDamage ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 5:
            {
                if( aData[ GangWeaponDrop ] == get_pcvar_num( g_psweaponDropMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_psweaponDropCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangWeaponDrop ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 6:
            {
                if( aData[ GangStamina ] == get_pcvar_num( g_pStaminaMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    renkli_yazi(id,"!n[!t%s!n] !gYeteri Kadar Puanin Yok!!?", g_szPrefix );
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStaminaCost );
                
                if( iRemaining < 0 )
                {
                    
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStamina ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
        }
        
        ArraySetArray( g_aGangs, g_iGang[ id ], aData );
        
        new iPlayers[ 32 ], iNum, iPlayer;
        new szName[ 32 ];
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( iPlayer == id || g_iGang[ iPlayer ] != g_iGang[ id ] )
                continue;
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Bir Ozellik Gelistirdi", g_szPrefix, szName )
        }

        renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir sekilde Klani gelistirdin", g_szPrefix )
        
        ShowSkillsMenu( id );
        
        return PLUGIN_HANDLED;
    }
            
        
    public Cmd_Top10( id )
    {
        new iSize = ArraySize( g_aGangs );
        
        new iOrder[ 100 ][ 2 ];
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < iSize; i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            iOrder[ i ][ 0 ] = i;
            iOrder[ i ][ 1 ] = aData[ GangKills ];
        }
        
        SortCustom2D( iOrder, iSize, "Top10_Sort" );
        
        new szMessage[ 2048 ];
        formatex( szMessage, charsmax( szMessage ), "<body bgcolor=#000000><font color=#FFB000><pre>" );
        format( szMessage, charsmax( szMessage ), "%s%2s %-22.22s %7s %4s %10s %9s %9s %11s %8s^n", szMessage, "#", "Klan", "Oldurme", "Can", "Hirsizlik",
            "YerCekimi", "Dayaniklilik", "SilahDusurme", "Hasar" );
            
        for( new i = 0; i < min( 10, iSize ); i++ )
        {
            ArrayGetArray( g_aGangs, iOrder[ i ][ 0 ], aData );
            
            format( szMessage, charsmax( szMessage ), "%s%-2d %22.22s %7d %4d %10d %9d %9d %11d %8d^n", szMessage, i + 1, aData[ GangName ],
            aData[ GangKills ], aData[ GangHP ], aData[ GangStealing ], aData[ GangGravity ], aData[ GangStamina], aData[ GangWeaponDrop ], aData[ GangDamage ] );
        }
        
        show_motd( id, szMessage, "Gang Top 10" );
    }

    public Top10_Sort( const iElement1[ ], const iElement2[ ], const iArray[ ], szData[], iSize )
    {
        if( iElement1[ 1 ] > iElement2[ 1 ] )
            return -1;
        
        else if( iElement1[ 1 ] < iElement2[ 1 ] )
            return 1;
        
        return 0;
    }

    public ShowLeaveConfirmMenu( id )
    {
        new hMenu = menu_create( "Cikmak Istedigine Eminmisin", "LeaveConfirmMenu_Handler" );
        menu_additem( hMenu, "Evet!, Simdi cik.", "0" );
        menu_additem( hMenu, "Hayir.! Cikmayacagim.", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public LeaveConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gLiderligi Devretmen Yada Klan Yetkili Yerinden Klani Sil.", g_szPrefix)
                    Cmd_Gang( id );
                    
                    return PLUGIN_HANDLED;
                }
                
                renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir Sekilde Bulundugun Klandan Ciktiniz", g_szPrefix);
                set_user_gang( id, -1 );
                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowLeaderMenu( id )
    {
        new hMenu = menu_create( "Klan Lider Menusu", "LeaderMenu_Handler" );
        
        new iStatus = getStatus( id, g_iGang[ id ] );
        
        if( iStatus == STATUS_LEADER )
        {
            menu_additem( hMenu, "Klani Kapat/Sil", "0" );
            menu_additem( hMenu, "Liderligi Devret", "1" );
            menu_additem( hMenu, "Yetkili Ekle", "4" );
            menu_additem( hMenu, "Yetkili Sil", "5" );
        }
        
        menu_additem( hMenu, "Birini Klandan At", "2" );
        menu_additem( hMenu, "Klan Ismini Degistir", "3" );
        
        
        menu_display( id, hMenu, 0 );
    }

    public LeaderMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                ShowDisbandConfirmMenu( id );
            }
            
            case 1:
            {
                ShowTransferMenu( id );
            }
            
            case 2:
            {
                ShowKickMenu( id );
            }
            
            case 3:
            {
                client_cmd( id, "messagemode New_Name" );
            }
            
            case 4:
            {
                ShowAddAdminMenu( id );
            }
            
            case 5:
            {
                ShowRemoveAdminMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowDisbandConfirmMenu( id )
    {
        new hMenu = menu_create( "Yoluna Bir Gururla Ciktigin Klanini Kapatacakmisin.", "DisbandConfirmMenu_Handler" );
        menu_additem( hMenu, "Ne Yazikki Kapatacagim", "0" );
        menu_additem( hMenu, "Hayir Yoluma Devam Edecegim!!", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public DisbandConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
        
                renkli_yazi(id,"!n[!t%s!n] !gBunu Yasadigin Icin Uzgunuz Klanini Kapattin.", g_szPrefix)
                
                new iPlayers[ 32 ], iNum;
                
                get_players( iPlayers, iNum );
                
                new iPlayer;
                
                for( new i = 0; i < iNum; i++ )
                {
                    iPlayer = iPlayers[ i ];
                    
                    if( iPlayer == id )
                        continue;
                    
                    if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                        continue;

                    renkli_yazi(id,"!n[!t%s!n] !gLiderin Az Once Klani Kapatti.!", g_szPrefix)
                    set_user_gang( iPlayer, -1 );
                }
                
                new iGang = g_iGang[ id ];
                
                set_user_gang( id, -1 );
                
                ArrayDeleteItem( g_aGangs, iGang );

                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowTransferMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum, "e", "TERRORIST" );
        
        new hMenu = menu_create( "Liderligini Buna Devret :", "TransferMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public TransferMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSectigin Oyuncu Oyunda Degil!", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, g_iGang[ id ], STATUS_LEADER );
        set_user_gang( id, g_iGang[ id ], STATUS_ADMIN );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );

        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer )
            {
                renkli_yazi(id,"!n[!t%s!n] !gBulundugun Klanin Liderligi Sana Devredildi!", g_szPrefix)
                continue;
            }
            
            else if( g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;
            
            renkli_yazi(iTemp,"!n[!t%s!n] !g+_-_-%s-_-_+ Klanininizin Yeni Lideri Cok Yasa %s", g_szPrefix, szName);
        }
        
        return PLUGIN_HANDLED;
    }


    public ShowKickMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Kick Player From Gang:", "KickMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public KickMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gOyuncu Su Anda Oyunda Degil", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, -1 );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer || g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;

            renkli_yazi(iTemp,"!n[!t%s!n] !g%s Bulundugun Klandan Atildi Elveda %s", g_szPrefix, szName);
        }
    
        renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Klandan Atildin/Kovuldun ", g_szPrefix, szName );
        
        return PLUGIN_HANDLED;
    }

    public ChangeName_Handler( id )
    {
        if( g_iGang[ id ] == -1 || getStatus( id, g_iGang[ id ] ) == STATUS_MEMBER )
        {
            return;
        }
        
        new iGang = g_iGang[ id ];
        
        new szArgs[ 64 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new bool:bInGang[ 33 ];
        new iStatus[ 33 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
        
            bInGang[ iPlayer ] = true;
            iStatus[ iPlayer ] = getStatus( id, iGang );
            
            set_user_gang( iPlayer, -1 );
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        aData[ GangName ] = szArgs;
        
        ArraySetArray( g_aGangs, iGang, aData );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( !bInGang[ iPlayer ] )
                continue;
            
            set_user_gang( iPlayer, iGang, iStatus[ id ] );
        }
    }
        
    public ShowAddAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Oyuncu Seciniz", "AddAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) > STATUS_MEMBER )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public AddAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_LEADER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Adminden Dusuruldu", g_szPrefix, szName );

        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !g Adminden Dusuruldunuz", g_szPrefix );
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }

    public ShowRemoveAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Choose a Player to Demote:", "RemoveAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) != STATUS_ADMIN )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public RemoveAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_MEMBER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(id,"!n[!t%s!n] !g%s Klan Yoneticiliginden Dusuruldu.", g_szPrefix, szName)
        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !gKlan Yoneticiliginden Dusuruldunuz.", g_szPrefix);
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }
        
    public ShowMembersMenu( id )
    {
        new szName[ 64 ], iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Online Members:", "MemberMenu_Handler" );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            switch( getStatus( iPlayer, g_iGang[ id ] ) )
            {
                case STATUS_MEMBER:
                {
                    add( szName, charsmax( szName ), " \r[Uye]" );
                }
                
                case STATUS_ADMIN:
                {
                    add( szName, charsmax( szName ), " \r[Yetkili]" );
                }
                
                case STATUS_LEADER:
                {
                    add( szName, charsmax( szName ), " \r[Lider]" );
                }
            }

            menu_additem( hMenu, szName );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public MemberMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        menu_destroy( hMenu );
        
        ShowMembersMenu( id )
        return PLUGIN_HANDLED;
    }

    // Credits to Tirant from zombie mod and xOR from xRedirect
    public LoadGangs()
    {
        new szConfigsDir[ 60 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        new iFile = fopen( szConfigsDir, "rt" );
        
        new aData[ GangInfo ];
        
        new szBuffer[ 512 ], szData[ 6 ], szValue[ 6 ], i, iCurGang;
        
        while( !feof( iFile ) )
        {
            fgets( iFile, szBuffer, charsmax( szBuffer ) );
            
            trim( szBuffer );
            remove_quotes( szBuffer );
            
            if( !szBuffer[ 0 ] || szBuffer[ 0 ] == ';' )
            {
                continue;
            }
            
            if( szBuffer[ 0 ] == '[' && szBuffer[ strlen( szBuffer ) - 1 ] == ']' )
            {
                copy( aData[ GangName ], strlen( szBuffer ) - 2, szBuffer[ 1 ] );
                aData[ GangHP ] = 0;
                aData[ GangStealing ] = 0;
                aData[ GangGravity ] = 0;
                aData[ GangStamina ] = 0;
                aData[ GangWeaponDrop ] = 0;
                aData[ GangDamage ] = 0;
                aData[ GangKills ] = 0;
                aData[ NumMembers ] = 0;
                aData[ GangMembers ] = _:TrieCreate();
                
                if( TrieKeyExists( g_tGangNames, aData[ GangName ] ) )
                {
                    new szError[ 256 ];
                    formatex( szError, charsmax( szError ), "[JB Gangs] Gang already exists: %s", aData[ GangName ] );
                    set_fail_state( szError );
                }
                
                ArrayPushArray( g_aGangs, aData );
                
                TrieSetCell( g_tGangNames, aData[ GangName ], iCurGang );

                log_amx( "Gang Created: %s", aData[ GangName ] );
                
                iCurGang++;
                
                continue;
            }
            
            strtok( szBuffer, szData, 31, szValue, 511, '=' );
            trim( szData );
            trim( szValue );
            
            if( TrieGetCell( g_tGangValues, szData, i ) )
            {
                ArrayGetArray( g_aGangs, iCurGang - 1, aData );
                
                switch( i )
                {                    
                    case VALUE_HP:
                        aData[ GangHP ] = str_to_num( szValue );
                    
                    case VALUE_STEALING:
                        aData[ GangStealing ] = str_to_num( szValue );
                    
                    case VALUE_GRAVITY:
                        aData[ GangGravity ] = str_to_num( szValue );
                    
                    case VALUE_STAMINA:
                        aData[ GangStamina ] = str_to_num( szValue );
                    
                    case VALUE_WEAPONDROP:
                        aData[ GangWeaponDrop ] = str_to_num( szValue );
                        
                    case VALUE_DAMAGE:
                        aData[ GangDamage ] = str_to_num( szValue );
                    
                    case VALUE_KILLS:
                        aData[ GangKills ] = str_to_num( szValue );
                }
                
                ArraySetArray( g_aGangs, iCurGang - 1, aData );
            }
        }
        
        new Array:aSQL;
        sqlv_read_all_ex( g_hVault, aSQL );
        
        new aVaultData[ SQLVaultEntryEx ];
        
        new iGang;
        
        for( i = 0; i < ArraySize( aSQL ); i++ )
        {
            ArrayGetArray( aSQL, i, aVaultData );
            
            if( TrieGetCell( g_tGangNames, aVaultData[ SQLVEx_Key2 ], iGang ) )
            {
                ArrayGetArray( g_aGangs, iGang, aData );
                
                TrieSetCell( aData[ GangMembers ], aVaultData[ SQLVEx_Key1 ], str_to_num( aVaultData[ SQLVEx_Data ] ) );
                
                aData[ NumMembers ]++;
                
                ArraySetArray( g_aGangs, iGang, aData );
            }
        }
        
        fclose( iFile );
    }

    public SaveGangs()
    {
        new szConfigsDir[ 64 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        if( file_exists( szConfigsDir ) )
            delete_file( szConfigsDir );
            
        new iFile = fopen( szConfigsDir, "wt" );
            
        new aData[ GangInfo ];
        
        new szBuffer[ 256 ];

        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            formatex( szBuffer, charsmax( szBuffer ), "[%s]^n", aData[ GangName ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Can=%i^n", aData[ GangHP ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hirsizlik=%i^n", aData[ GangStealing ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "YerCekimi=%i^n", aData[ GangGravity ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Dayaniklilik=%i^n", aData[ GangStamina ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "SilahDusurme=%i^n", aData[ GangWeaponDrop ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hasar=%i^n", aData[ GangDamage ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Oldurme=%i^n^n", aData[ GangKills ] );
            fputs( iFile, szBuffer );
        }
        
        fclose( iFile );
    }
        
        

    set_user_gang( id, iGang, iStatus=STATUS_MEMBER )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );

        new aData[ GangInfo ];
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            TrieDeleteKey( aData[ GangMembers ], szAuthID );
            aData[ NumMembers ]--;
            ArraySetArray( g_aGangs, g_iGang[ id ], aData );
            
            sqlv_remove_ex( g_hVault, szAuthID, aData[ GangName ] );
        }

        if( iGang > -1 )
        {
            ArrayGetArray( g_aGangs, iGang, aData );
            TrieSetCell( aData[ GangMembers ], szAuthID, iStatus );
            aData[ NumMembers ]++;
            ArraySetArray( g_aGangs, iGang, aData );
            
            sqlv_set_num_ex( g_hVault, szAuthID, aData[ GangName ], iStatus );        
        }

        g_iGang[ id ] = iGang;
        
        return 1;
    }
        
    get_user_gang( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            if( TrieKeyExists( aData[ GangMembers ], szAuthID ) )
                return i;
        }
        
        return -1;
    }
                
    getStatus( id, iGang )
    {
        if( !is_user_connected( id ) || iGang == -1 )
            return STATUS_NONE;
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new iStatus;
        TrieGetCell( aData[ GangMembers ], szAuthID, iStatus );
        
        return iStatus;
    }
    stock renkli_yazi(const id, const input[], any:...)
    {
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);

    replace_all(msg, 190, "!n", "^x01");
    replace_all(msg, 190, "!t", "^x03");
    replace_all(msg, 190, "!g", "^x04");

    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, get_user_msgid("SayText"), _, players[i]);
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
    
        }
    }
    }
    stock bool:is_user_steam(id)
    {
        static dp_pointer;
    
        if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
        {
            server_cmd("dp_clientinfo %d", id);
            server_exec();
            return (get_pcvar_num(dp_pointer) == 2) ? true : false;
        }
    
        new szAuthid[34];
        get_user_authid(id, szAuthid, charsmax(szAuthid));
    
        return (containi(szAuthid, "LAN") < 0);
    }


klan menude klan olusturuyoruz sonra kapatmak istedigimizde kapatıyoruz fakat top10 dan kalkmıyor ayrıyetten bitane daha hata var klan olusturdugumuzda bazen ismi degisiyor kendi kendine
#6
(15-01-2022, 20:31)JukeLord12 Adlı Kullanıcıdan Alıntı:
(15-01-2022, 20:15)bilalgecer47 Adlı Kullanıcıdan Alıntı:
Kod:
    /* Includes */
        
        #include < amxmodx >
        #include < amxmisc >
        #include < sqlvault_ex >
        #include < cstrike >
        #include < hamsandwich >
        #include < fun >
        
    /* Defines */
    
        #define ADMIN_CREATE    ADMIN_LEVEL_B
        #define FLAG ADMIN_RESERVATION
        #define cm(%0)    ( sizeof(%0) - 1 )    
        

    /* Constants */
    
        new const g_szVersion[ ] = "1.1.7";

        enum _:GangInfo
        {
            Trie:GangMembers,
            GangName[ 64 ],
            GangHP,
            GangStealing,
            GangGravity,
            GangDamage,
            GangStamina,
            GangWeaponDrop,
            GangKills,
            NumMembers
        };
            
        enum
        {
            VALUE_HP,
            VALUE_STEALING,
            VALUE_GRAVITY,
            VALUE_DAMAGE,
            VALUE_STAMINA,
            VALUE_WEAPONDROP,
            VALUE_KILLS
        }

        enum
        {
            STATUS_NONE,
            STATUS_MEMBER,
            STATUS_ADMIN,
            STATUS_LEADER
        };

        new const g_szGangValues[ ][ ] =
        {
            "HP",
            "Stealing",
            "Gravity",
            "Damage",
            "Stamina",
            "WeaponDrop",
            "Kills"
        };

        new const g_szPrefix[ ] = "^04[Clan System]^01";

    /* Tries */
    
        new Trie:g_tGangNames;
        new Trie:g_tGangValues;

    /* Vault */
    
        new SQLVault:g_hVault;
        new SQLVault:g_hPointsVault;

    /* Arrays */
    
        new Array:g_aGangs;

    /* Pcvars */
    
        new g_pCreateCost;
        new COLCHAR[3][2] = { "^x03", "^x04", "^x01" }
        new p_namecol
        new alv_sndr, alv_str2[26], alv_str4[101]
        new msg[200]

        new g_pHealthCost;
        new g_pStealingCost;
        new g_pGravityCost;
        new g_pDamageCost;
        new g_pStaminaCost;
        new g_psweaponDropCost;

        new g_pHealthMax;
        new g_pStealingMax;
        new g_pGravityMax;
        new g_pDamageMax;
        new g_pStaminaMax;
        new g_psweaponDropMax;

        new g_pHealthPerLevel;
        new g_pStealingPerLevel;
        new g_pGravityPerLevel;
        new g_pDamagePerLevel;
        new g_pStaminaPerLevel;
        new g_psweaponDropPerLevel;

        new g_pPointsPerKill;
        new g_pHeadshotBonus;

        new g_pMaxMembers;
        new g_pAdminCreate;


    /* Integers */
    
        new g_iGang[ 33 ];
        new g_iPoints[ 33 ];
        

    public plugin_init()
    {
        register_plugin( "Klan Sistemi", g_szVersion, "Pazee" );
        
        g_aGangs                 = ArrayCreate( GangInfo );

        g_tGangValues             = TrieCreate();
        g_tGangNames             = TrieCreate();
        
        g_hVault                 = sqlv_open_local( "jb_gangs", false );
        sqlv_init_ex( g_hVault );

        g_hPointsVault            = sqlv_open_local( "jb_points", true );
        
        g_pCreateCost            = register_cvar( "jb_gang_cost",         "0" );
        g_pHealthCost            = register_cvar( "jb_health_cost",         "20" );
        g_pStealingCost         = register_cvar( "jb_stealing_cost",     "20" );
        g_pGravityCost            = register_cvar( "jb_gravity_cost",     "20" );
        g_pDamageCost            = register_cvar( "jb_damage_cost",         "20" );
        g_pStaminaCost            = register_cvar( "jb_stamina_cost",     "20" );
        g_psweaponDropCost        = register_cvar( "jb_weapondrop_cost",     "20" );

        g_pHealthMax            = register_cvar( "jb_health_max",         "10" );
        g_pStealingMax            = register_cvar( "jb_stealing_max",     "10" );
        g_pGravityMax            = register_cvar( "jb_gravity_max",         "10" );
        g_pDamageMax            = register_cvar( "jb_damage_max",         "10" );
        g_pStaminaMax            = register_cvar( "jb_stamina_max",         "10" );
        g_psweaponDropMax        = register_cvar( "jb_weapondrop_max",     "10" );

        g_pHealthPerLevel        = register_cvar( "jb_health_per",         "10"     );
        g_pStealingPerLevel        = register_cvar( "jb_stealing_per",     "0.05"     );
        g_pGravityPerLevel        = register_cvar( "jb_gravity_per",         "50"     );
        g_pDamagePerLevel        = register_cvar( "jb_damage_per",         "3"     );
        g_pStaminaPerLevel        = register_cvar( "jb_stamina_per",         "3"     );
        g_psweaponDropPerLevel     = register_cvar( "jb_weapondrop_per",     "1"     );

        g_pPointsPerKill        = register_cvar( "jb_points_per_kill",    "3" );
        g_pHeadshotBonus        = register_cvar( "jb_headshot_bonus",    "2" );
        p_namecol = register_cvar( "csm_namecolor", "0" )
        
        register_message( get_user_msgid("SayText"), "col_changer" )
        
        g_pMaxMembers            = register_cvar( "jb_max_members",        "10" );
        g_pAdminCreate            = register_cvar( "jb_admin_create",     "0" );
        
        register_menu( "Gang Menu", 1023, "GangMenu_Handler" );
        register_menu( "Skills Menu", 1023, "SkillsMenu_Handler" );
        
        for( new i = 0; i < sizeof g_szGangValues; i++ )
        {
            TrieSetCell( g_tGangValues, g_szGangValues[ i ], i );
        }

        RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn_Post", 1 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Pre", 0 );
        RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamage_Post", 1 );
        RegisterHam( Ham_Item_PreFrame, "player", "Ham_PlayerResetSpeedPost", 1);
        
        register_event( "DeathMsg", "Event_DeathMsg", "a" );
                
        register_clcmd( "say /klan", "Cmd_Gang" );
        register_clcmd( "say /kaydet", "kaydet" );
        register_clcmd( "gang_name", "Cmd_CreateGang" );
        
        
        register_logevent( "elsonu", 2, "1=Round_End" );
        register_logevent( "elbasi", 2, "1=Round_Start" );
        
        LoadGangs();
    }
    public elsonu()
    {
    }
    public elbasi()
    {
    SaveGangs();
    glkaydet();
    }

    public client_disconnected( id )
    {
        g_iGang[ id ] = -1;
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
    }
    public glkaydet()
    {
        new players[32],inum,id
        get_players(players,inum)
        for(new i;i<inum;i++)
        {
            id = players[i]
            kaydet(id)
        }
    }
    public col_changer( msg_id, msg_dest, rcvr )
    {
        new str2[26]
        get_msg_arg_string( 2, str2, 25 )
        if( equal( str2, "#Cstrike_Chat", 13 ) )
        {
            new str3[22]
            get_msg_arg_string( 3, str3, 21 )
        
            if( !strlen( str3 ) )
            {
                new str4[101]
                get_msg_arg_string( 4, str4, 100 )
                new sndr = get_msg_arg_int( 1 )
            
                new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
            
                new sndr_team = get_user_team( sndr )
                new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
            
                new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
            
                new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
            
                if( !same_as_last )
                {
                
                
                    if( !( is_team_msg && ( is_sndr_spec || is_team_msg) ) )
                    {
                        new flags[5], team[10]
                        if( is_user_alive( sndr ) ) flags = "bc"
                        else flags = "ac"
                    
                        if( is_team_msg )
                        {
                            add( flags[strlen( flags )], 4, "e" )
                            if( sndr_team == 1 ) team = "TERRORIST"
                            else team = "CT"
                        }
                    
                        new players[32], num
                        get_players( players, num, flags, team )
                        if( get_user_flags( sndr ) & FLAG)
                            buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )
                        else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, str4 )
                    
                        for( new i=0; i < num; i++ )
                        {
                            if(is_user_alive(players[i]) && get_user_flags( players[i] ) & FLAG || !is_user_alive(players[i])){
                                message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
                                write_byte( sndr )
                                write_string( msg )
                                message_end()
                            }
                        }
                    
                    }
    
                    alv_sndr = sndr
                    alv_str2 = str2
                    alv_str4 = str4
                    if( task_exists( 411 ) ) remove_task( 411 )
                    set_task( 0.1, "task_clear_antiloop_vars", 411 )
                
                }
            
                if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )

                set_msg_arg_string( 2, msg )
                set_msg_arg_string( 4, "" )
            
            }
        }
        return PLUGIN_CONTINUE
    }

    public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4[ ] )
    {
        new sndr_name[33]
        get_user_name( sndr, sndr_name, 32 )
    
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ sndr ], aData );
    
        new prefix[30] = "^x01"
    
        if(is_user_admin(sndr)){
            if(!(get_user_flags(sndr) == FLAG)){
                if(is_user_steam(sndr)){
                }
                else if(!is_user_steam(sndr)){
                }
            }
            else{
                if(is_user_steam(sndr)){    
                }
                else if(!is_user_steam(sndr)){
                }
            }
        }
        else {
            if(is_user_steam(sndr)){
                if( g_iGang[ sndr ] == -1 )
                {
                return HAM_IGNORED;
                }
            }
            else{
                prefix = "^x01"
            }
        }
        if( is_sndr_spec ) add( prefix[strlen(prefix)-1], 29, "*Spec*" )
        else if( !is_user_alive( sndr ) ) add( prefix[strlen(prefix)-1], 29, "*Olu*" )
    
    
        if( is_team_msg )
        {
            if( is_sndr_spec ) prefix = "^x01(Spec) "
            else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "*(TE)*" )
            else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "*(CT)*" )
        }
        if(get_user_flags(sndr) & ADMIN_RESERVATION)
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x04%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x04%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }        
    
        }
        else
        {
            if( g_iGang[ sndr ] == -1 )
            {
                format( msg, 199, "%s%s%s :  ^x01%s",\
                strlen( prefix ) > 1 ? prefix : "",\
                COLCHAR[namecol], sndr_name, str4 )
            }
            else
            {
                format( msg, 199, "%s^x04%s %s%s :  ^x01%s",strlen( prefix ) > 1 ? prefix : "",\
                aData[ GangName ],\
                COLCHAR[namecol], sndr_name, str4 )
            }
        }
        return PLUGIN_HANDLED
    }

    public task_clear_antiloop_vars( )
    {
        alv_sndr = 0
        alv_str2 = ""
        alv_str4 = ""
        return PLUGIN_HANDLED
    }
    public kaydet(id)
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        sqlv_set_num( g_hPointsVault, szAuthID, g_iPoints[ id ] );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
        
    }
    public client_putinserver( id )
    {
        g_iGang[ id ] = get_user_gang( id );
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
    }
    public plugin_end()
    {
        SaveGangs();
        glkaydet();
        sqlv_close( g_hVault );
    }
    public Ham_PlayerSpawn_Post( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
                
            
        if( g_iGang[ id ] == -1 )
        {
            return HAM_IGNORED;
        }
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        kaydet(id)
        
        new iHealth = 100 + aData[ GangHP ] * get_pcvar_num( g_pHealthPerLevel );
        set_user_health( id, iHealth );
        
        new iGravity = 800 - ( get_pcvar_num( g_pGravityPerLevel ) * aData[ GangGravity ] );
        set_user_gravity( id, float( iGravity ) / 800.0 );
        g_iPoints[ id ] = sqlv_get_num( g_hPointsVault, szAuthID );
            
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Pre( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || cs_get_user_team( iAttacker ) != CS_TEAM_T )
            return HAM_IGNORED;
            
        if( g_iGang[ iAttacker ] == -1 )
            return HAM_IGNORED;
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        SetHamParamFloat( 4, flDamage + ( get_pcvar_num( g_pDamagePerLevel ) * ( aData[ GangDamage ] ) ) );
        
        return HAM_IGNORED;
    }

    public Ham_TakeDamage_Post( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
    {
        if( !is_user_alive( iAttacker ) || g_iGang[ iAttacker ] == -1 || get_user_weapon( iAttacker ) != CSW_KNIFE || cs_get_user_team( iAttacker ) != CS_TEAM_T  )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ iAttacker ], aData );
        
        new iChance = aData[ GangWeaponDrop ] * get_pcvar_num( g_psweaponDropPerLevel );
        
        if( iChance == 0 )
            return HAM_IGNORED;
        
        new bool:bDrop = ( random_num( 1, 100 ) <= iChance );
        
        if( bDrop )
            client_cmd( iVictim, "drop" );
        
        return HAM_IGNORED;
    }

    public Ham_PlayerResetSpeedPost( id )
    {
        if( g_iGang[ id ] == -1 || !is_user_alive( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            return HAM_IGNORED;
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        if( aData[ GangStamina ] > 0 && get_user_maxspeed( id ) > 1.0 )
            set_user_maxspeed( id, 250.0 + ( aData[ GangStamina ] * get_pcvar_num( g_pStaminaPerLevel ) ) );
            
        return HAM_IGNORED;
    }

    public Event_DeathMsg()
    {
        new iKiller = read_data( 1 );
        new iVictim = read_data( 2 );
        
        if( !is_user_alive( iKiller ) || cs_get_user_team( iVictim ) != CS_TEAM_CT || cs_get_user_team( iKiller ) != CS_TEAM_T )
            return PLUGIN_CONTINUE;
        
        new iTotal = get_pcvar_num( g_pPointsPerKill ) + ( bool:read_data( 3 ) ? get_pcvar_num( g_pHeadshotBonus ) : 0 );
        
        if( g_iGang[ iKiller ] > -1 )
        {
            new aData[ GangInfo ];
            ArrayGetArray( g_aGangs, g_iGang[ iKiller ], aData );
            aData[ GangKills ]++;
            ArraySetArray( g_aGangs, g_iGang[ iKiller ], aData );
            
            iTotal += iTotal * ( aData[ GangStealing ] * get_pcvar_num( g_pStealingPerLevel ) );
        }
        
        g_iPoints[ iKiller ] += iTotal;
        
        return PLUGIN_CONTINUE;
    }

    public Cmd_Gang( id )
    {    
        if( !is_user_connected( id ) || cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSadece Mahkumlar Bu Menuye Girebilir Dostum",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        static szMenu[ 512 ], iLen, aData[ GangInfo ], iKeys, iStatus;
        
        iKeys = MENU_KEY_0 | MENU_KEY_4;
        
        iStatus = getStatus( id, g_iGang[ id ] );
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\y %s^n", aData[ GangName ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \dKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
        }
        
        else
        {
            iLen     =     formatex( szMenu, charsmax( szMenu ),  "\yKlan Menu^n\wBulundugun Klan:\r None^n" );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\yKlan Puani: \w%i^n^n", g_iPoints[ id ] );
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r1. \wKlan Kur [%i Points]^n", get_pcvar_num( g_pCreateCost ) );
            
            iKeys |= MENU_KEY_1;
        }
        
        
        if( iStatus > STATUS_MEMBER && g_iGang[ id ] > -1 && get_pcvar_num( g_pMaxMembers ) > aData[ NumMembers ] )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \wKlana Birini Davet Et^n" );
            iKeys |= MENU_KEY_2;
        }
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r2. \dKlana Birini Davet Et^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \wOzellikler^n" );
            iKeys |= MENU_KEY_3;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r3. \dOzellikler^n" );
            
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r4. \wTop-10 Klan^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \wKlandan Ayril^n" );
            iKeys |= MENU_KEY_5;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r5. \dKlandan Ayril^n" );
        
        
        if( iStatus > STATUS_MEMBER )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \wKlan Yetkili Menusu^n" );
            iKeys |= MENU_KEY_6;
        }
        
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r6. \dKlan Lider Menusu^n" );
        
        if( g_iGang[ id ] > -1 )
        {
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \wOnline Uyeler^n" );
            iKeys |= MENU_KEY_7;
        }
            
        else
            iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "\r7. \dOnline Uyeler^n" );
        
        iLen    +=    formatex( szMenu[ iLen ], charsmax( szMenu ) - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Gang Menu" );
        
        return PLUGIN_CONTINUE;
    }

    public GangMenu_Handler( id, iKey )
    {
        switch( ( iKey + 1 ) % 10 )
        {
            case 0: return PLUGIN_HANDLED;
            
            case 1:
            {
                if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
                {
                    client_cmd( id, "messagemode gang_name" );
                }
                
                else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Varmi",g_szPrefix );
                    
                    return PLUGIN_HANDLED;
                }
                
                else
                    client_cmd( id, "messagemode gang_name" );
            }
            
            case 2:
            {
                ShowInviteMenu( id );
            }
            
            case 3:
            {
                ShowSkillsMenu( id );
            }
            
            case 4:
            {
                Cmd_Top10( id );
            }
            
            case 5:
            {
                ShowLeaveConfirmMenu( id );
            }
            
            case 6:
            {
                ShowLeaderMenu( id );
            }
            
            case 7:
            {
                ShowMembersMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public Cmd_CreateGang( id )
    {
        new bool:bAdmin = false;
        
        if( get_pcvar_num( g_pAdminCreate ) && get_user_flags( id ) & ADMIN_CREATE )
        {
            bAdmin = true;
        }
        
        else if( g_iPoints[ id ] < get_pcvar_num( g_pCreateCost ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gKlan Kuracak Kadar Puanin Yok!",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( g_iGang[ id ] > -1 )
        {
            renkli_yazi(id,"!n[!t%s!n] !gZaten Bir Klandasin",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        else if( cs_get_user_team( id ) != CS_TEAM_T )
        {
            renkli_yazi(id,"!n[!t%s!n] !gMahkumlar Klan Kurabilir",g_szPrefix );
            return PLUGIN_HANDLED;
        }
        
        new szArgs[ 60 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        remove_quotes( szArgs );
        
        if( TrieKeyExists( g_tGangNames, szArgs ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gBoyle bir klan kayitlarda mevcut",g_szPrefix );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new aData[ GangInfo ];
        
        aData[ GangName ]         = szArgs;
        aData[ GangHP ]         = 0;
        aData[ GangStealing ]     = 0;
        aData[ GangGravity ]     = 0;
        aData[ GangStamina ]     = 0;
        aData[ GangWeaponDrop ] = 0;
        aData[ GangDamage ]     = 0;
        aData[ NumMembers ]     = 0;
        aData[ GangMembers ]     = _:TrieCreate();
        
        ArrayPushArray( g_aGangs, aData );
        
        if( !bAdmin )
            g_iPoints[ id ] -= get_pcvar_num( g_pCreateCost );
        
        set_user_gang( id, ArraySize( g_aGangs ) - 1, STATUS_LEADER );
        
        renkli_yazi(id,"!n[!t%s!n] !gKlani Kurdunuz Hadi Hayirli Olsun %s ", g_szPrefix, szArgs );
        
        return PLUGIN_HANDLED;
    }

    public ShowInviteMenu( id )
    {    
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new szInfo[ 6 ], hMenu;
        hMenu = menu_create( "Choose a Player to Invite:", "InviteMenu_Handler" );
        new szName[ 32 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            
            if( iPlayer == id || g_iGang[ iPlayer ] == g_iGang[ id ] || cs_get_user_team( iPlayer ) != CS_TEAM_T )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szInfo, charsmax( szInfo ) );
            
            menu_additem( hMenu, szName, szInfo );
        }
            
        menu_display( id, hMenu, 0 );
    }

    public InviteMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new szData[ 6 ], iAccess, hCallback, szName[ 32 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, 31, hCallback );
        
        new iPlayer = str_to_num( szData );

        if( !is_user_connected( iPlayer ) )
            return PLUGIN_HANDLED;
            
        ShowInviteConfirmMenu( id, iPlayer );

        renkli_yazi(id,"!n[!t%s!n] !g%s Adli Oyuncuyu Klanina Katilmasi Icin Davet Ettiniz ", g_szPrefix, szName );
        
        
        Cmd_Gang( id );
        return PLUGIN_HANDLED;
    }

    public ShowInviteConfirmMenu( id, iPlayer )
    {
        new szName[ 32 ];
        get_user_name( id, szName, charsmax( szName ) );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        new szMenuTitle[ 128 ];
        formatex( szMenuTitle, charsmax( szMenuTitle ), "%s Seni    %s Klanina Davet Etti", szName, aData[ GangName ] );
        new hMenu = menu_create( szMenuTitle, "InviteConfirmMenu_Handler" );
        
        new szInfo[ 6 ];
        num_to_str( g_iGang[ id ], szInfo, 5 );
        
        menu_additem( hMenu, "Klana Gir", szInfo );
        menu_additem( hMenu, "Klana Girme", "-1" );
        
        menu_display( iPlayer, hMenu, 0 );    
    }

    public InviteConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        new iGang = str_to_num( szData );
        
        if( iGang == -1 )
            return PLUGIN_HANDLED;
        
        if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
        {
            renkli_yazi(id,"!n[!t%s!n] !g Senin Zaten Bir Klanin Var!", g_szPrefix);
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( id, iGang );
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        renkli_yazi(id,"!n[!t%s!n] !g Basarili bir bicimde Klana katildin ^%s.", g_szPrefix, aData[ GangName ] );
        
        return PLUGIN_HANDLED;
    }
        

    public ShowSkillsMenu( id )
    {    
        static szMenu[ 512 ], iLen, iKeys, aData[ GangInfo ];
        
        if( !iKeys )
        {
            iKeys = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_0;
        }
        
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        iLen    =    formatex( szMenu, charsmax( szMenu ), "\ySkill Menu^n^n" );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r1. \wCan Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pHealthCost ), aData[ GangHP ], get_pcvar_num( g_pHealthMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r2. \wCalma Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStealingCost ), aData[ GangStealing ], get_pcvar_num( g_pStealingMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r3. \wYerCekimi Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pGravityCost ), aData[ GangGravity ], get_pcvar_num( g_pGravityMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r4. \wHasar Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pDamageCost ), aData[ GangDamage ], get_pcvar_num( g_pDamageMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r5. \wSilah Dusurme Gelistir [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_psweaponDropCost ), aData[ GangWeaponDrop ], get_pcvar_num( g_psweaponDropMax ) );
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "\r6. \wHiz Gelistirme [\rGerek: \y%i Puan\w] \y[Level:%i/%i]^n", get_pcvar_num( g_pStaminaCost ), aData[ GangStamina ], get_pcvar_num( g_pStaminaMax ) );
        
        iLen    +=    formatex( szMenu[ iLen ], 511 - iLen, "^n\r0. \wExit" );
        
        show_menu( id, iKeys, szMenu, -1, "Skills Menu" );
    }

    public SkillsMenu_Handler( id, iKey )
    {
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
        
        switch( ( iKey + 1 ) % 10 )
        {
            case 0:
            {
                Cmd_Gang( id );
                return PLUGIN_HANDLED;
            }
            
            case 1:
            {
                if( aData[ GangHP ] == get_pcvar_num( g_pHealthMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pHealthCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangHP ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 2:
            {
                if( aData[ GangStealing ] == get_pcvar_num( g_pStealingMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStealingCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStealing ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 3:
            {
                if( aData[ GangGravity ] == get_pcvar_num( g_pGravityMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pGravityCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangGravity ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 4:
            {
                if( aData[ GangDamage ] == get_pcvar_num( g_pDamageMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pDamageCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangDamage ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 5:
            {
                if( aData[ GangWeaponDrop ] == get_pcvar_num( g_psweaponDropMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_psweaponDropCost );
                
                if( iRemaining < 0 )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangWeaponDrop ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
            
            case 6:
            {
                if( aData[ GangStamina ] == get_pcvar_num( g_pStaminaMax ) )
                {
                    renkli_yazi(id,"!n[!t%s!n] !g Klanin Butun Ozellikleri Full Guzeel :)", g_szPrefix);
                    renkli_yazi(id,"!n[!t%s!n] !gYeteri Kadar Puanin Yok!!?", g_szPrefix );
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                new iRemaining = g_iPoints[ id ] - get_pcvar_num( g_pStaminaCost );
                
                if( iRemaining < 0 )
                {
                    
                    renkli_yazi(id,"!n[!t%s!n] !g Gelistirmek Icin Yeteri Kadar Puanin Yok", g_szPrefix);
                    
                    ShowSkillsMenu( id );
                    return PLUGIN_HANDLED;
                }
                
                aData[ GangStamina ]++;
                
                g_iPoints[ id ] = iRemaining;
            }
        }
        
        ArraySetArray( g_aGangs, g_iGang[ id ], aData );
        
        new iPlayers[ 32 ], iNum, iPlayer;
        new szName[ 32 ];
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( iPlayer == id || g_iGang[ iPlayer ] != g_iGang[ id ] )
                continue;
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Bir Ozellik Gelistirdi", g_szPrefix, szName )
        }

        renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir sekilde Klani gelistirdin", g_szPrefix )
        
        ShowSkillsMenu( id );
        
        return PLUGIN_HANDLED;
    }
            
        
    public Cmd_Top10( id )
    {
        new iSize = ArraySize( g_aGangs );
        
        new iOrder[ 100 ][ 2 ];
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < iSize; i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            iOrder[ i ][ 0 ] = i;
            iOrder[ i ][ 1 ] = aData[ GangKills ];
        }
        
        SortCustom2D( iOrder, iSize, "Top10_Sort" );
        
        new szMessage[ 2048 ];
        formatex( szMessage, charsmax( szMessage ), "<body bgcolor=#000000><font color=#FFB000><pre>" );
        format( szMessage, charsmax( szMessage ), "%s%2s %-22.22s %7s %4s %10s %9s %9s %11s %8s^n", szMessage, "#", "Klan", "Oldurme", "Can", "Hirsizlik",
            "YerCekimi", "Dayaniklilik", "SilahDusurme", "Hasar" );
            
        for( new i = 0; i < min( 10, iSize ); i++ )
        {
            ArrayGetArray( g_aGangs, iOrder[ i ][ 0 ], aData );
            
            format( szMessage, charsmax( szMessage ), "%s%-2d %22.22s %7d %4d %10d %9d %9d %11d %8d^n", szMessage, i + 1, aData[ GangName ],
            aData[ GangKills ], aData[ GangHP ], aData[ GangStealing ], aData[ GangGravity ], aData[ GangStamina], aData[ GangWeaponDrop ], aData[ GangDamage ] );
        }
        
        show_motd( id, szMessage, "Gang Top 10" );
    }

    public Top10_Sort( const iElement1[ ], const iElement2[ ], const iArray[ ], szData[], iSize )
    {
        if( iElement1[ 1 ] > iElement2[ 1 ] )
            return -1;
        
        else if( iElement1[ 1 ] < iElement2[ 1 ] )
            return 1;
        
        return 0;
    }

    public ShowLeaveConfirmMenu( id )
    {
        new hMenu = menu_create( "Cikmak Istedigine Eminmisin", "LeaveConfirmMenu_Handler" );
        menu_additem( hMenu, "Evet!, Simdi cik.", "0" );
        menu_additem( hMenu, "Hayir.! Cikmayacagim.", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public LeaveConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                if( getStatus( id, g_iGang[ id ] ) == STATUS_LEADER )
                {
                    renkli_yazi(id,"!n[!t%s!n] !gLiderligi Devretmen Yada Klan Yetkili Yerinden Klani Sil.", g_szPrefix)
                    Cmd_Gang( id );
                    
                    return PLUGIN_HANDLED;
                }
                
                renkli_yazi(id,"!n[!t%s!n] !gBasarili Bir Sekilde Bulundugun Klandan Ciktiniz", g_szPrefix);
                set_user_gang( id, -1 );
                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowLeaderMenu( id )
    {
        new hMenu = menu_create( "Klan Lider Menusu", "LeaderMenu_Handler" );
        
        new iStatus = getStatus( id, g_iGang[ id ] );
        
        if( iStatus == STATUS_LEADER )
        {
            menu_additem( hMenu, "Klani Kapat/Sil", "0" );
            menu_additem( hMenu, "Liderligi Devret", "1" );
            menu_additem( hMenu, "Yetkili Ekle", "4" );
            menu_additem( hMenu, "Yetkili Sil", "5" );
        }
        
        menu_additem( hMenu, "Birini Klandan At", "2" );
        menu_additem( hMenu, "Klan Ismini Degistir", "3" );
        
        
        menu_display( id, hMenu, 0 );
    }

    public LeaderMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ];
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
                ShowDisbandConfirmMenu( id );
            }
            
            case 1:
            {
                ShowTransferMenu( id );
            }
            
            case 2:
            {
                ShowKickMenu( id );
            }
            
            case 3:
            {
                client_cmd( id, "messagemode New_Name" );
            }
            
            case 4:
            {
                ShowAddAdminMenu( id );
            }
            
            case 5:
            {
                ShowRemoveAdminMenu( id );
            }
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowDisbandConfirmMenu( id )
    {
        new hMenu = menu_create( "Yoluna Bir Gururla Ciktigin Klanini Kapatacakmisin.", "DisbandConfirmMenu_Handler" );
        menu_additem( hMenu, "Ne Yazikki Kapatacagim", "0" );
        menu_additem( hMenu, "Hayir Yoluma Devam Edecegim!!", "1" );
        
        menu_display( id, hMenu, 0 );
    }

    public DisbandConfirmMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
            return PLUGIN_HANDLED;
        
        new szData[ 6 ], iAccess, hCallback;
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
        
        switch( str_to_num( szData ) )
        {
            case 0:
            {
        
                renkli_yazi(id,"!n[!t%s!n] !gBunu Yasadigin Icin Uzgunuz Klanini Kapattin.", g_szPrefix)
                
                new iPlayers[ 32 ], iNum;
                
                get_players( iPlayers, iNum );
                
                new iPlayer;
                
                for( new i = 0; i < iNum; i++ )
                {
                    iPlayer = iPlayers[ i ];
                    
                    if( iPlayer == id )
                        continue;
                    
                    if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                        continue;

                    renkli_yazi(id,"!n[!t%s!n] !gLiderin Az Once Klani Kapatti.!", g_szPrefix)
                    set_user_gang( iPlayer, -1 );
                }
                
                new iGang = g_iGang[ id ];
                
                set_user_gang( id, -1 );
                
                ArrayDeleteItem( g_aGangs, iGang );

                Cmd_Gang( id );
            }
            
            case 1: Cmd_Gang( id );
        }
        
        return PLUGIN_HANDLED;
    }

    public ShowTransferMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum, "e", "TERRORIST" );
        
        new hMenu = menu_create( "Liderligini Buna Devret :", "TransferMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public TransferMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gSectigin Oyuncu Oyunda Degil!", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, g_iGang[ id ], STATUS_LEADER );
        set_user_gang( id, g_iGang[ id ], STATUS_ADMIN );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );

        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer )
            {
                renkli_yazi(id,"!n[!t%s!n] !gBulundugun Klanin Liderligi Sana Devredildi!", g_szPrefix)
                continue;
            }
            
            else if( g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;
            
            renkli_yazi(iTemp,"!n[!t%s!n] !g+_-_-%s-_-_+ Klanininizin Yeni Lideri Cok Yasa %s", g_szPrefix, szName);
        }
        
        return PLUGIN_HANDLED;
    }


    public ShowKickMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Kick Player From Gang:", "KickMenu_Handler" );
        new szName[ 32 ], szData[ 6 ];
        
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || id == iPlayer )
                continue;
                
            get_user_name( iPlayer, szName, charsmax( szName ) );
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public KickMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, szName, charsmax( szName ), hCallback );
        
        new iPlayer = str_to_num( szData );
        
        if( !is_user_connected( iPlayer ) )
        {
            renkli_yazi(id,"!n[!t%s!n] !gOyuncu Su Anda Oyunda Degil", g_szPrefix)
            ShowTransferMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iPlayer, -1 );
        
        Cmd_Gang( id );
        
        new iPlayers[ 32 ], iNum, iTemp;
        get_players( iPlayers, iNum );
        
        for( new i = 0; i < iNum; i++ )
        {
            iTemp = iPlayers[ i ];
            
            if( iTemp == iPlayer || g_iGang[ iTemp ] != g_iGang[ id ] )
                continue;

            renkli_yazi(iTemp,"!n[!t%s!n] !g%s Bulundugun Klandan Atildi Elveda %s", g_szPrefix, szName);
        }
    
        renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Klandan Atildin/Kovuldun ", g_szPrefix, szName );
        
        return PLUGIN_HANDLED;
    }

    public ChangeName_Handler( id )
    {
        if( g_iGang[ id ] == -1 || getStatus( id, g_iGang[ id ] ) == STATUS_MEMBER )
        {
            return;
        }
        
        new iGang = g_iGang[ id ];
        
        new szArgs[ 64 ];
        read_args( szArgs, charsmax( szArgs ) );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new bool:bInGang[ 33 ];
        new iStatus[ 33 ];
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
        
            bInGang[ iPlayer ] = true;
            iStatus[ iPlayer ] = getStatus( id, iGang );
            
            set_user_gang( iPlayer, -1 );
        }
        
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        aData[ GangName ] = szArgs;
        
        ArraySetArray( g_aGangs, iGang, aData );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( !bInGang[ iPlayer ] )
                continue;
            
            set_user_gang( iPlayer, iGang, iStatus[ id ] );
        }
    }
        
    public ShowAddAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Oyuncu Seciniz", "AddAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) > STATUS_MEMBER )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public AddAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_LEADER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(iPlayer,"!n[!t%s!n] !g%s Adminden Dusuruldu", g_szPrefix, szName );

        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !g Adminden Dusuruldunuz", g_szPrefix );
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }

    public ShowRemoveAdminMenu( id )
    {
        new iPlayers[ 32 ], iNum;
        new szName[ 32 ], szData[ 6 ];
        new hMenu = menu_create( "Choose a Player to Demote:", "RemoveAdminMenu_Handler" );
        
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] || getStatus( iPlayer, g_iGang[ iPlayer ] ) != STATUS_ADMIN )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            num_to_str( iPlayer, szData, charsmax( szData ) );
            
            menu_additem( hMenu, szName, szData );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public RemoveAdminMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        new iAccess, hCallback, szData[ 6 ], szName[ 32 ];
        
        menu_item_getinfo( hMenu, iItem, iAccess, szData, charsmax( szData ), szName, charsmax( szName ), hCallback );
        
        new iChosen = str_to_num( szData );
        
        if( !is_user_connected( iChosen ) )
        {
            menu_destroy( hMenu );
            ShowLeaderMenu( id );
            return PLUGIN_HANDLED;
        }
        
        set_user_gang( iChosen, g_iGang[ id ], STATUS_MEMBER );
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ iPlayer ] != g_iGang[ id ] || iPlayer == iChosen )
                continue;
            
            renkli_yazi(id,"!n[!t%s!n] !g%s Klan Yoneticiliginden Dusuruldu.", g_szPrefix, szName)
        }
        
        renkli_yazi(iChosen,"!n[!t%s!n] !gKlan Yoneticiliginden Dusuruldunuz.", g_szPrefix);
        
        menu_destroy( hMenu );
        return PLUGIN_HANDLED;
    }
        
    public ShowMembersMenu( id )
    {
        new szName[ 64 ], iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum );
        
        new hMenu = menu_create( "Online Members:", "MemberMenu_Handler" );
        
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( g_iGang[ id ] != g_iGang[ iPlayer ] )
                continue;
            
            get_user_name( iPlayer, szName, charsmax( szName ) );
            
            switch( getStatus( iPlayer, g_iGang[ id ] ) )
            {
                case STATUS_MEMBER:
                {
                    add( szName, charsmax( szName ), " \r[Uye]" );
                }
                
                case STATUS_ADMIN:
                {
                    add( szName, charsmax( szName ), " \r[Yetkili]" );
                }
                
                case STATUS_LEADER:
                {
                    add( szName, charsmax( szName ), " \r[Lider]" );
                }
            }

            menu_additem( hMenu, szName );
        }
        
        menu_display( id, hMenu, 0 );
    }

    public MemberMenu_Handler( id, hMenu, iItem )
    {
        if( iItem == MENU_EXIT )
        {
            menu_destroy( hMenu );
            Cmd_Gang( id );
            return PLUGIN_HANDLED;
        }
        
        menu_destroy( hMenu );
        
        ShowMembersMenu( id )
        return PLUGIN_HANDLED;
    }

    // Credits to Tirant from zombie mod and xOR from xRedirect
    public LoadGangs()
    {
        new szConfigsDir[ 60 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        new iFile = fopen( szConfigsDir, "rt" );
        
        new aData[ GangInfo ];
        
        new szBuffer[ 512 ], szData[ 6 ], szValue[ 6 ], i, iCurGang;
        
        while( !feof( iFile ) )
        {
            fgets( iFile, szBuffer, charsmax( szBuffer ) );
            
            trim( szBuffer );
            remove_quotes( szBuffer );
            
            if( !szBuffer[ 0 ] || szBuffer[ 0 ] == ';' )
            {
                continue;
            }
            
            if( szBuffer[ 0 ] == '[' && szBuffer[ strlen( szBuffer ) - 1 ] == ']' )
            {
                copy( aData[ GangName ], strlen( szBuffer ) - 2, szBuffer[ 1 ] );
                aData[ GangHP ] = 0;
                aData[ GangStealing ] = 0;
                aData[ GangGravity ] = 0;
                aData[ GangStamina ] = 0;
                aData[ GangWeaponDrop ] = 0;
                aData[ GangDamage ] = 0;
                aData[ GangKills ] = 0;
                aData[ NumMembers ] = 0;
                aData[ GangMembers ] = _:TrieCreate();
                
                if( TrieKeyExists( g_tGangNames, aData[ GangName ] ) )
                {
                    new szError[ 256 ];
                    formatex( szError, charsmax( szError ), "[JB Gangs] Gang already exists: %s", aData[ GangName ] );
                    set_fail_state( szError );
                }
                
                ArrayPushArray( g_aGangs, aData );
                
                TrieSetCell( g_tGangNames, aData[ GangName ], iCurGang );

                log_amx( "Gang Created: %s", aData[ GangName ] );
                
                iCurGang++;
                
                continue;
            }
            
            strtok( szBuffer, szData, 31, szValue, 511, '=' );
            trim( szData );
            trim( szValue );
            
            if( TrieGetCell( g_tGangValues, szData, i ) )
            {
                ArrayGetArray( g_aGangs, iCurGang - 1, aData );
                
                switch( i )
                {                    
                    case VALUE_HP:
                        aData[ GangHP ] = str_to_num( szValue );
                    
                    case VALUE_STEALING:
                        aData[ GangStealing ] = str_to_num( szValue );
                    
                    case VALUE_GRAVITY:
                        aData[ GangGravity ] = str_to_num( szValue );
                    
                    case VALUE_STAMINA:
                        aData[ GangStamina ] = str_to_num( szValue );
                    
                    case VALUE_WEAPONDROP:
                        aData[ GangWeaponDrop ] = str_to_num( szValue );
                        
                    case VALUE_DAMAGE:
                        aData[ GangDamage ] = str_to_num( szValue );
                    
                    case VALUE_KILLS:
                        aData[ GangKills ] = str_to_num( szValue );
                }
                
                ArraySetArray( g_aGangs, iCurGang - 1, aData );
            }
        }
        
        new Array:aSQL;
        sqlv_read_all_ex( g_hVault, aSQL );
        
        new aVaultData[ SQLVaultEntryEx ];
        
        new iGang;
        
        for( i = 0; i < ArraySize( aSQL ); i++ )
        {
            ArrayGetArray( aSQL, i, aVaultData );
            
            if( TrieGetCell( g_tGangNames, aVaultData[ SQLVEx_Key2 ], iGang ) )
            {
                ArrayGetArray( g_aGangs, iGang, aData );
                
                TrieSetCell( aData[ GangMembers ], aVaultData[ SQLVEx_Key1 ], str_to_num( aVaultData[ SQLVEx_Data ] ) );
                
                aData[ NumMembers ]++;
                
                ArraySetArray( g_aGangs, iGang, aData );
            }
        }
        
        fclose( iFile );
    }

    public SaveGangs()
    {
        new szConfigsDir[ 64 ];
        get_configsdir( szConfigsDir, charsmax( szConfigsDir ) );
        
        add( szConfigsDir, charsmax( szConfigsDir ), "/jb_gangs.ini" );
        
        if( file_exists( szConfigsDir ) )
            delete_file( szConfigsDir );
            
        new iFile = fopen( szConfigsDir, "wt" );
            
        new aData[ GangInfo ];
        
        new szBuffer[ 256 ];

        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            formatex( szBuffer, charsmax( szBuffer ), "[%s]^n", aData[ GangName ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Can=%i^n", aData[ GangHP ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hirsizlik=%i^n", aData[ GangStealing ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "YerCekimi=%i^n", aData[ GangGravity ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Dayaniklilik=%i^n", aData[ GangStamina ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "SilahDusurme=%i^n", aData[ GangWeaponDrop ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Hasar=%i^n", aData[ GangDamage ] );
            fputs( iFile, szBuffer );
            
            formatex( szBuffer, charsmax( szBuffer ), "Oldurme=%i^n^n", aData[ GangKills ] );
            fputs( iFile, szBuffer );
        }
        
        fclose( iFile );
    }
        
        

    set_user_gang( id, iGang, iStatus=STATUS_MEMBER )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );

        new aData[ GangInfo ];
        
        if( g_iGang[ id ] > -1 )
        {
            ArrayGetArray( g_aGangs, g_iGang[ id ], aData );
            TrieDeleteKey( aData[ GangMembers ], szAuthID );
            aData[ NumMembers ]--;
            ArraySetArray( g_aGangs, g_iGang[ id ], aData );
            
            sqlv_remove_ex( g_hVault, szAuthID, aData[ GangName ] );
        }

        if( iGang > -1 )
        {
            ArrayGetArray( g_aGangs, iGang, aData );
            TrieSetCell( aData[ GangMembers ], szAuthID, iStatus );
            aData[ NumMembers ]++;
            ArraySetArray( g_aGangs, iGang, aData );
            
            sqlv_set_num_ex( g_hVault, szAuthID, aData[ GangName ], iStatus );        
        }

        g_iGang[ id ] = iGang;
        
        return 1;
    }
        
    get_user_gang( id )
    {
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new aData[ GangInfo ];
        
        for( new i = 0; i < ArraySize( g_aGangs ); i++ )
        {
            ArrayGetArray( g_aGangs, i, aData );
            
            if( TrieKeyExists( aData[ GangMembers ], szAuthID ) )
                return i;
        }
        
        return -1;
    }
                
    getStatus( id, iGang )
    {
        if( !is_user_connected( id ) || iGang == -1 )
            return STATUS_NONE;
            
        new aData[ GangInfo ];
        ArrayGetArray( g_aGangs, iGang, aData );
        
        new szAuthID[ 35 ];
        get_user_authid( id, szAuthID, charsmax( szAuthID ) );
        
        new iStatus;
        TrieGetCell( aData[ GangMembers ], szAuthID, iStatus );
        
        return iStatus;
    }
    stock renkli_yazi(const id, const input[], any:...)
    {
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);

    replace_all(msg, 190, "!n", "^x01");
    replace_all(msg, 190, "!t", "^x03");
    replace_all(msg, 190, "!g", "^x04");

    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, get_user_msgid("SayText"), _, players[i]);
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
    
        }
    }
    }
    stock bool:is_user_steam(id)
    {
        static dp_pointer;
    
        if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
        {
            server_cmd("dp_clientinfo %d", id);
            server_exec();
            return (get_pcvar_num(dp_pointer) == 2) ? true : false;
        }
    
        new szAuthid[34];
        get_user_authid(id, szAuthid, charsmax(szAuthid));
    
        return (containi(szAuthid, "LAN") < 0);
    }


klan menude klan olusturuyoruz sonra kapatmak istedigimizde kapatıyoruz fakat top10 dan kalkmıyor ayrıyetten bitane daha  hata var klan olusturdugumuzda bazen ismi degisiyor kendi kendine
Olabılır eskı bı eklentı.Daha guncel eklentılerı arastırın.Ek olarak sql gerektırıyor.
reCs:Go Rank Menu (%50)
#7
(16-01-2022, 00:05)bilalgecer47 Adlı Kullanıcıdan Alıntı:
(15-01-2022, 20:31)JukeLord12 Adlı Kullanıcıdan Alıntı: klan menude klan olusturuyoruz sonra kapatmak istedigimizde kapatıyoruz fakat top10 dan kalkmıyor ayrıyetten bitane daha  hata var klan olusturdugumuzda bazen ismi degisiyor kendi kendine
Olabılır eskı bı eklentı.Daha guncel eklentılerı arastırın.Ek olarak sql gerektırıyor.

duzeltebilirmisiniz peki
#8
Ücretli olarak sattığım eklenti var. Onun dışında, temiz klan sistemi bulamazsınız.
(- Ücretli Eklenti Yaptırmak İsteyen -)
#9
İstek konusu, @bilalgecer47 adlı kullanıcı tarafından 10 saat içinde çözülmüştür.
İsteği çözdüğü için bilalgecer47 Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
bilalgecer47 Adlı kullanıcı sizin dışınızda toplam 107 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task
Kayıt Ol
Discord Adresimize Katılın