CSPLague
.Sma Reklamı Kaldırırmısınız - Printable Version

+- CSPLague (https://www.csplague.com)
+-- Forum: CS 1.6 Plugin (Eklenti) Bölümü (https://www.csplague.com/forumdisplay.php?fid=6)
+--- Forum: [İSTEK] Cs 1.6 Plugin İstek Bölümü (https://www.csplague.com/forumdisplay.php?fid=80)
+---- Forum: Çözülmüş İstekler (https://www.csplague.com/forumdisplay.php?fid=87)
+---- Thread: .Sma Reklamı Kaldırırmısınız (/showthread.php?tid=7707)

Pages: 1 2


.Sma Reklamı Kaldırırmısınız - Config Setting - 30-05-13

Code:
#include <amxmisc>
#include <engine>

#define PLUGIN "Menu Plugini"
#define VERSION "1.4"
#define AUTHOR "NiCoMeDiA"
#define SITE "www.CsPlague.com"

#define DEFAULT_TIME 600.0 // In Seconds

enum ( <<= 1 ) {
    GAG_CHAT = 1,
    GAG_TEAMSAY,
    GAG_VOICE
};

enum _:GagData {
    GAG_AUTHID[ 20 ],
    GAG_TIME,
    GAG_START,
    GAG_FLAGS
};

new g_szAuthid[ 33 ][ 20 ];
new g_iThinker, g_iGagged;
new bool:g_bColoredMenus, Trie:g_tArrayPos, Array:g_aGagData, Array:g_aGagTimes;
new g_iMenuOption[ 33 ], g_iMenuPosition[ 33 ], g_iMenuPlayers[ 33 ][ 32 ];

new g_menuPosition[33]
new g_menuSelect[33][64]
new g_menuUnBanType[33]
new g_menuUnBanLine[33][2]
new g_menuUnBanText[33][8][32]
new g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"}
new g_coloredMenus

new menucvar

public plugin_init()
{
    menucvar = register_cvar("menu_aktif","1")

    register_clcmd("amx_unbanmenu","cmdUnBanMenu", ADMIN_BAN, "- displays unban menu")
    
    register_menucmd(register_menuid("UnBan STEAMID or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType")
    register_menucmd(register_menuid("UnBan  Menu"),1023,"actionUnBanMenu")
    
    g_coloredMenus = colored_menus()

    register_clcmd("say /menu","adminmenu");
    register_clcmd("say !menu","adminmenu");
    register_clcmd("say .menu","adminmenu");
    register_clcmd("say menu","adminmenu");
    
    set_task(300.0,"nicomediaa",0,"",0,"b",0)

    register_clcmd( "say",        "CmdSay" );
    register_clcmd( "say_team",   "CmdTeamSay" );
    
    register_concmd( "amx_gag",       "CmdGagPlayer",   ADMIN_KICK, "<nick or #userid> <time> <a|b|c>" );
    register_concmd( "amx_ungag",     "CmdUnGagPlayer", ADMIN_KICK, "<nick or #userid>" );
    register_concmd( "amx_gagmenu",   "CmdGagMenu",     ADMIN_KICK, "- displays gag menu" );
    register_srvcmd( "amx_gag_times", "CmdSetBanTimes" );
    
    register_menucmd( register_menuid( "Gag Menu" ), 1023, "ActionGagMenu" );
    register_message( get_user_msgid( "SayText" ), "MessageSayText" );
    
    g_tArrayPos = TrieCreate( );
    g_aGagData  = ArrayCreate( GagData );
    g_aGagTimes = ArrayCreate( );
    g_bColoredMenus = bool:colored_menus( );
    
    // Gag times for the gag menu (amx_gagmenu)
    // Default values: 60 300 600 1800 3600 7200 86400
    
    // Load up standart times
    ArrayPushCell( g_aGagTimes, 60 );
    ArrayPushCell( g_aGagTimes, 300 );
    ArrayPushCell( g_aGagTimes, 600 );
    ArrayPushCell( g_aGagTimes, 1800 );
    ArrayPushCell( g_aGagTimes, 3600 );
    ArrayPushCell( g_aGagTimes, 7200 );
    ArrayPushCell( g_aGagTimes, 86400 );
    
    // Set up entity-thinker
    new const szClassname[ ] = "gag_thinker";
    
    g_iThinker = create_entity( "info_target" );
    entity_set_string( g_iThinker, EV_SZ_classname, szClassname );
    
    register_think( szClassname, "FwdThink" );

}

public adminmenu(id)
{        
    if(get_pcvar_num(menucvar) == 1)
    {
    new menu = menu_create("\rwww.CSPLAGUE.com^n\w[ ~ Admin Menu ~ ]", "adminmenudevam")
    
    menu_additem(menu, "\w=> \yBan Menu \w<= \r( \dOyundan Atma \r)", "1",ADMIN_BAN)
    menu_additem(menu, "\w=> \yKick Menu \w<= \r( \dOyundan Atma \r)", "2",ADMIN_BAN)
    menu_additem(menu, "\w=> \yUnban Menu \w<= \r( \dOyundan Atilanlarin Cezalarini Kaldirma \r)", "3",ADMIN_BAN)
    menu_additem(menu, "\w=> \ySlap Menu \w<= \r( \dTokatlama / Oldurme Menusu \r)", "4",ADMIN_BAN)
    menu_additem(menu, "\w=> \yTeam Menu \w<= \r( \dTakim Degistirme Menusu \r)", "5",ADMIN_BAN)
    menu_additem(menu, "\w=> \yGag Menu \w<= \r( \dSusturma Menusu \r)", "6",ADMIN_BAN)
    menu_additem(menu, "\w=> \yRestart Game \w<= \r( \dOyunu Yeniden Baslat \r)", "7",ADMIN_BAN)

    menu_setprop(menu, MPROP_NEXTNAME, "Ileri");  
       menu_setprop(menu, MPROP_BACKNAME, "Geri");
        menu_setprop(menu, MPROP_EXITNAME, "Menuyu Kapat");
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    new admin_name[32]                
    get_user_name(id , admin_name , 31 )
    
    chat_color(0,"!t[ %s ] !y%s !g/menu !yYazarak Ozel !tAdmin Menusune !yGirdi.",SITE,admin_name)
        
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
    }
}

public adminmenudevam(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    
    new key = str_to_num(data);
    
    switch(key)
    {
        case 1: {
            console_cmd(id,"amx_banmenu");
        }
        
        case 2: {
            console_cmd(id,"amx_kickmenu");
        }
        
        case 3: {
            console_cmd(id,"amx_unbanmenu");
        }
        
        case 4: {
            console_cmd(id,"amx_slapmenu");
        }
        
        case 5: {
            console_cmd(id,"amx_teammenu");
        }
        
        case 6: {
            console_cmd(id,"amx_gagmenu");
            
        }
        
        case 7: {
            console_cmd(id,"amx_cvar sv_restart 3");
        }
        
    }
    
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}

public nicomediaa()
{
    chat_color(0,"!y[ !t%s !y] !gCounter Strike Plugin Paylasim Platformu !t%s",SITE,SITE)
}

//===============================UNBANMENU================================//

public actionUnBanMenu(id,key) {
    
    switch(key) {
    case 8: {
        displayUnBanMenu(id, ++g_menuPosition)
    }
    case 9: {
        g_menuUnBanLine[0] = g_menuUnBanLine[0] - (8 + g_menuUnBanLine[1])
        if(g_menuUnBanLine[0] < 0) g_menuUnBanLine[0] = 0
        displayUnBanMenu(id, --g_menuPosition)
    }
    default: {
        
        new name[32], authid[32], ipaddress[24]
        get_user_authid(id, authid, 31)
        get_user_name(id, name, 31)
        get_user_ip(id, ipaddress, 23, 1)

        log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^"", name,get_user_userid(id),authid,ipaddress,g_menuUnBanText)

        switch (get_cvar_num("amx_show_activity"))
        {
        
            case 2: client_print(0, print_chat, "ADMIN %s: unban %s", name, g_menuUnBanText)
            case 1: client_print(0, print_chat, "ADMIN: unban %s", g_menuUnBanText)
        }

        if(g_menuUnBanType == 1) {
        server_cmd("removeip ^"%s^"; writeip", g_menuUnBanText)
        server_exec()
        console_print(id, "IP ^"%s^" removed from ban list", g_menuUnBanText)
        }
        
        else {
            
        server_cmd("removeid %s; writeid",  g_menuUnBanText)
        console_print(id, "Authid ^"%s^" removed from ban list",  g_menuUnBanText)
        }
    
        g_menuUnBanLine[0] = g_menuUnBanLine[1] = 0
        displayUnBanMenu(id, g_menuPosition = 0)
        }
    }
    return PLUGIN_HANDLED
}

checkSTEAMID(steamid[]) {
  
    new len = strlen(steamid)
    if(len > 10 && equali(steamid, "STEAM_", 6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) {
        return 1
    }
    return 0
}

checkIP(ip[]) {
    
    new len = strlen(ip)
    new dots = 0, i = 0
    while(isdigit(ip) || ip=='.')
        if(ip[i++] == '.')
            ++dots
    if(i == len && dots == 3) {
        return 1
    }
    return 0
}

displayUnBanMenu(id,pos) {
    if(pos < 0)
    return

    new menuBody[512]
    new b = 0

    new len = format(menuBody, 511, g_coloredMenus ? "\yBan Kaldir\R%d^n\w^n" : "UnBan Menu %d^n^n", id, "UNBAN_MENU", pos + 1)
    
    new keys = (1<<9)
    new textlen, line
    new type = g_menuUnBanType
    new temp[32], banTime[32], disable

    if(file_exists(g_bannedCfgFile)) {
        line = g_menuUnBanLine[0]
        while((line = read_file(g_bannedCfgFile, line, g_menuSelect, 63, textlen))) {
            temp[0] = '^0'
            banTime[0] = '^0'
            g_menuUnBanText[0] = '^0'
            disable = 0
            if(textlen < 9)
                disable = 1
            else if(parse(g_menuSelect, temp, 31, banTime, 31, g_menuUnBanText, 31) != 3)
                disable = 1
            else if((type == 1 && !checkIP(g_menuUnBanText)) || (type == 0 && !checkSTEAMID(g_menuUnBanText)))
                disable = 1
            if(disable == 0) {
                keys |= (1<<b)
                if(g_coloredMenus)
                len += format(menuBody, 511-len, "%d. %s\R\r%s^n\w", b, g_menuUnBanText[b++], banTime)
                else
                len += format(menuBody, 511-len, "%d. %s   ( %s )^n", b, g_menuUnBanText[b++], banTime)
            }
            else {
                if(g_coloredMenus)
                    len += format(menuBody, 511-len, "\d%d. %s^n\w", b, g_menuUnBanText[b++])
                else
                    len += format(menuBody, 511-len, "#. %s^n", b, g_menuUnBanText[b++])
            }
            if(b == 8) break
        }

        if(b == 8 && read_file(g_bannedCfgFile, line, g_menuSelect, 63, textlen) > 0) {
        format(menuBody, 511-len, "^n9. More...^n0. %s",id, pos ? "Back" : "Exit",id)
        keys |= (1<<8)
        }
        else
        format(menuBody, 511-len, "^n0. %s", pos ? "Back" : "Exit",id)

        g_menuUnBanLine[1] = line - g_menuUnBanLine[0]
        g_menuUnBanLine[0] = line
        show_menu(id, keys, menuBody, -1, "UnBan  Menu")
    }

    return
}

public actionUnBanMenuType(id,key) {
    
    switch(key) {
        case 9: return PLUGIN_HANDLED
        default: {
            g_menuUnBanType = key // 0 = STEAMID, 1 = IP
            g_menuUnBanLine[0] = g_menuUnBanLine[1] = 0
            displayUnBanMenu(id, g_menuPosition = 0)
        }
    }
    return PLUGIN_HANDLED
}

displayUnBanMenuType(id) {
    
    new menuBody[512]
  
    new len = format(menuBody, 511, g_coloredMenus ?  "\rBanned \yKaldirma Turu?^n\w^n" :"UnBan STEAMID or IP?^n^n",id)

    new keys = (1<<0)|(1<<1)|(1<<9)

    len += format(menuBody, 511-len, "1. \rSinirsiz \yBanlari Kaldir^n",id)
    len += format(menuBody, 511-len, "\w2. \rNormal \yBanlari Kaldir^n",id)
    format(menuBody, 511-len, "^n\w0. \rExit",id)

    show_menu(id, keys, menuBody, -1, "UnBan STEAMID or IP?")
}

public cmdUnBanMenu(id,level,cid) {
    
    if(!cmd_access(id,level,cid,1))
    return PLUGIN_HANDLED

    g_menuUnBanType = -1
    displayUnBanMenuType(id)
    return PLUGIN_HANDLED
}

stock chat_color(const id, const input[], any:...) {
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!t", "^3")
    replace_all(msg, 190, "!team2", "^0")
    
    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
}

//======================================GAGMENU=====================================//

public CmdSetBanTimes( ) {
    new iArgs = read_argc( );
    
    if( iArgs <= 1 ) {
        server_print( "Usage: amx_gag_times <time1> [time2] [time3] ..." );
        
        return;
    }
    
    ArrayClear( g_aGagTimes );
    
    new szBuffer[ 32 ], iTime;
    for( new i = 1; i < iArgs; i++ ) {
        read_argv( i, szBuffer, 31 );
        
        iTime = str_to_num( szBuffer );
        
        if( iTime > 86400 ) {
            server_print( "[AMXX GAG] Time more then 86400 is not allowed!" );
            
            continue;
        }
        
        ArrayPushCell( g_aGagTimes, iTime );
    }
}

public plugin_end( ) {
    TrieDestroy( g_tArrayPos );
    ArrayDestroy( g_aGagData );
    ArrayDestroy( g_aGagTimes );
}

public client_putinserver( id )
    if( CheckGagFlag( id, GAG_VOICE ) )
        set_speak( id, SPEAK_MUTED );

public client_authorized( id )
    get_user_authid( id, g_szAuthid[ id ], 19 );

public client_disconnect( id ) {
    if( TrieKeyExists( g_tArrayPos, g_szAuthid[ id ] ) ) {
        new szName[ 32 ];
        get_user_name( id, szName, 31 );
        
        new iPlayers[ 32 ], iNum, iPlayer;
        get_players( iPlayers, iNum, "ch" );
        
        for( new i; i < iNum; i++ ) {
            iPlayer = iPlayers[ i ];
            
            if( get_user_flags( iPlayer ) & ADMIN_KICK )
                client_print( iPlayer, print_chat, " Gagged player ^"%s<%s>^" has disconnected!", szName, g_szAuthid[ id ] );
        }
    }
    
    g_szAuthid[ id ][ 0 ] = '^0';
}

public client_infochanged( id ) {
    if( !CheckGagFlag( id, ( GAG_CHAT | GAG_TEAMSAY ) ) )
        return;
    
    static const name[ ] = "name";
    
    static szNewName[ 32 ], szOldName[ 32 ];
    get_user_info( id, name, szNewName, 31 );
    get_user_name( id, szOldName, 31 );
    
    if( !equal( szNewName, szOldName ) ) {
        client_print( id, print_chat, " Gagged players cannot change their names!" );
        
        set_user_info( id, name, szOldName );
    }
}

public MessageSayText( ) {
    static const Cstrike_Name_Change[ ] = "#Cstrike_Name_Change";
    
    new szMessage[ sizeof( Cstrike_Name_Change ) + 1 ];
    get_msg_arg_string( 2, szMessage, sizeof( szMessage ) - 1 );
    
    if( equal( szMessage, Cstrike_Name_Change ) ) {
        new szName[ 32 ], id;
        for( new i = 3; i <= 4; i++ ) {
            get_msg_arg_string( i, szName, 31 );
            
            id = get_user_index( szName );
            
            if( is_user_connected( id ) ) {
                if( CheckGagFlag( id, ( GAG_CHAT | GAG_TEAMSAY ) ) )
                    return PLUGIN_HANDLED;
                
                break;
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}

public FwdThink( const iEntity ) {
    if( !g_iGagged )
        return;
    
    new Float:fGametime;
    fGametime = get_gametime( );
    
    new data[ GagData ], id, szName[ 32 ];
    for( new i = 0; i < g_iGagged; i++ ) {
        ArrayGetArray( g_aGagData, i, data );
        
        if( ( Float:data[ GAG_START ] + Float:data[ GAG_TIME ] - 0.5 ) <= fGametime ) {
            id = find_player( "c", data[ GAG_AUTHID ] );
            
            if( is_user_connected( id ) ) {
                get_user_name( id, szName, 31 );
                
                client_print( 0, print_chat, " Player ^"%s^" is no longer gagged.", szName );
            }
            
            DeleteGag( i );
            
            i--;
        }
    }
    
    if( !g_iGagged )
        return;
    
    new Float:flNextTime = 999999.9;
    for( new i = 0; i < g_iGagged; i++ ) {
        ArrayGetArray( g_aGagData, i, data );
        
        flNextTime = floatmin( flNextTime, Float:data[ GAG_START ] + Float:data[ GAG_TIME ] );
    }
    
    entity_set_float( iEntity, EV_FL_nextthink, flNextTime );
}

public CmdSay( const id )
    return CheckSay( id, 0 );

public CmdTeamSay( const id )
    return CheckSay( id, 1 );

CheckSay( const id, const bTeam ) {
    new iArrayPos;
    if( TrieGetCell( g_tArrayPos, g_szAuthid[ id ], iArrayPos ) ) {
        new data[ GagData ];
        ArrayGetArray( g_aGagData, iArrayPos, data );
        
        new const iFlags[ ] = { GAG_CHAT, GAG_TEAMSAY };
        
        if( data[ GAG_FLAGS ] & iFlags[ bTeam ] ) {
            new szInfo[ 32 ], iLen, iTime = floatround( ( Float:data[ GAG_START ] + Float:data[ GAG_TIME ] ) - get_gametime( ) ), iMinutes = iTime / 60, iSeconds = iTime % 60;
            
            if( iMinutes > 0 )
                iLen = formatex( szInfo, 31, "%i minute%s", iMinutes, iMinutes == 1 ? "" : "s" );
            if( iSeconds > 0 )
                formatex( szInfo[ iLen ], 31 - iLen, "%s%i second%s", iLen ? " and " : "", iSeconds, iSeconds == 1 ? "" : "s" );
            
            client_print( id, print_chat, " %s left before your ungag!", szInfo );
            client_print( id, print_center, "** You are gagged from%s chat! **", bTeam ? " team" : "" );
            
            return PLUGIN_HANDLED;
        }
    }
    
    return PLUGIN_CONTINUE;
}

public CmdGagPlayer( const id, const iLevel, const iCid ) {
    if( !cmd_access( id, iLevel, iCid, 2 ) ) {
        console_print( id, "Flags: a - Chat | b - Team Chat | c - Voice communications" );
        
        return PLUGIN_HANDLED;
    }
    
    new szArg[ 32 ];
    read_argv( 1, szArg, 31 );
    
    new iPlayer = cmd_target( id, szArg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS );
    
    if( !iPlayer )
        return PLUGIN_HANDLED;
    
    new szName[ 20 ];
    get_user_name( iPlayer, szName, 19 );
    
    if( TrieKeyExists( g_tArrayPos, g_szAuthid[ iPlayer ] ) ) {
        console_print( id, "User ^"%s^" is already gagged!", szName );
        
        return PLUGIN_HANDLED;
    }
    
    new szFlags[ 4 ], Float:flGagTime;
    read_argv( 2, szArg, 31 );
    
    if( !szArg[ 0 ] ) { // No time entered
        flGagTime = DEFAULT_TIME;
        
        formatex( szFlags, 3, "abc" );
    } else {
        if( is_str_num( szArg ) ) { // Seconds entered
            flGagTime = floatstr( szArg );
            
            if( flGagTime > 86400.0 )
                flGagTime = 86400.0;
        } else {
            console_print( id, "The value must be in seconds!" );
            
            return PLUGIN_HANDLED;
        }
        
        read_argv( 3, szArg, 31 );
        
        if( !szArg[ 0 ] ) // No flag entered
            formatex( szFlags, 3, "abc" );
        else
            formatex( szFlags, 3, szArg );
    }
    
    new iFlags = read_flags( szFlags );
    
    new data[ GagData ];
    data[ GAG_START ] = _:get_gametime( );
    data[ GAG_TIME ]  = _:flGagTime;
    data[ GAG_FLAGS ] = iFlags;
    copy( data[ GAG_AUTHID ], 19, g_szAuthid[ iPlayer ] );
    
    TrieSetCell( g_tArrayPos, g_szAuthid[ iPlayer ], g_iGagged );
    ArrayPushArray( g_aGagData, data );
    
    new szFrom[ 64 ];
    
    if( iFlags & GAG_CHAT )
        formatex( szFrom, 63, "say" );
    
    if( iFlags & GAG_TEAMSAY ) {
        if( !szFrom[ 0 ] )
            formatex( szFrom, 63, "say_team" );
        else
            format( szFrom, 63, "%s / say_team", szFrom );
    }
    
    if( iFlags & GAG_VOICE ) {
        set_speak( iPlayer, SPEAK_MUTED );
        
        if( !szFrom[ 0 ] )
            formatex( szFrom, 63, "voicecomm" );
        else
            format( szFrom, 63, "%s / voicecomm", szFrom );
    }
    
    g_iGagged++;
    
    new Float:flGametime = get_gametime( ), Float:flNextThink;
    flNextThink = entity_get_float( g_iThinker, EV_FL_nextthink );
    
    if( !flNextThink || flNextThink > ( flGametime + flGagTime ) )
        entity_set_float( g_iThinker, EV_FL_nextthink, flGametime + flGagTime );
    
    new szInfo[ 32 ], szAdmin[ 20 ], iTime = floatround( flGagTime ), iMinutes = iTime / 60, iSeconds = iTime % 60;
    get_user_name( id, szAdmin, 19 );
    
    if( !iMinutes )
        formatex( szInfo, 31, "%i second%s", iSeconds, iSeconds == 1 ? "" : "s" );
    else
        formatex( szInfo, 31, "%i minute%s", iMinutes, iMinutes == 1 ? "" : "s" );
    
    show_activity( id, szAdmin, "Has gagged %s from speaking for %s! (%s)", szName, szInfo, szFrom );
    
    console_print( id, "You have gagged ^"%s^" (%s) !", szName, szFrom );
    
    log_amx( "Gag: ^"%s<%s>^" has gagged ^"%s<%s>^" for %i minutes. (%s)", szAdmin, g_szAuthid[ id ], szName, g_szAuthid[ iPlayer ], floatround( flGagTime / 60 ), szFrom );
    
    return PLUGIN_HANDLED;
}

public CmdUnGagPlayer( const id, const iLevel, const iCid ) {
    if( !cmd_access( id, iLevel, iCid, 2 ) )
        return PLUGIN_HANDLED;
    
    new szArg[ 32 ];
    read_argv( 1, szArg, 31 );
    
    if( equali( szArg, "@all" ) ) {
        if( !g_iGagged ) {
            console_print( id, "No gagged players!" );
            
            return PLUGIN_HANDLED;
        }
        
        while( g_iGagged ) DeleteGag( 0 ); // Excellent by Exolent
        
        if( entity_get_float( g_iThinker, EV_FL_nextthink ) > 0.0 )
            entity_set_float( g_iThinker, EV_FL_nextthink, 0.0 );
        
        console_print( id, "You have ungagged all players!" );
        
        new szAdmin[ 32 ];
        get_user_name( id, szAdmin, 31 );
        
        show_activity( id, szAdmin, "Has ungagged all players." );
        
        log_amx( "UnGag: ^"%s<%s>^" has ungagged all players.", szAdmin, g_szAuthid[ id ] );
        
        return PLUGIN_HANDLED;
    }
    
    new iPlayer = cmd_target( id, szArg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS );
    
    if( !iPlayer )
        return PLUGIN_HANDLED;
    
    new szName[ 32 ];
    get_user_name( iPlayer, szName, 31 );
    
    new iArrayPos;
    if( !TrieGetCell( g_tArrayPos, g_szAuthid[ iPlayer ], iArrayPos ) ) {
        console_print( id, "User ^"%s^" is not gagged!", szName );
        
        return PLUGIN_HANDLED;
    }
    
    DeleteGag( iArrayPos );
    
    new szAdmin[ 32 ];
    get_user_name( id, szAdmin, 31 );
    
    show_activity( id, szAdmin, "Has ungagged %s.", szName );
    
    console_print( id, "You have ungagged ^"%s^" !", szName );
    
    log_amx( "UnGag: ^"%s<%s>^" has ungagged ^"%s<%s>^"", szAdmin, g_szAuthid[ id ], szName, g_szAuthid[ iPlayer ] );
    
    return PLUGIN_HANDLED;
}

public CmdGagMenu( const id, const iLevel, const iCid ) {
    if( !cmd_access( id, iLevel, iCid, 1 ) )
        return PLUGIN_HANDLED;
    
    g_iMenuOption[ id ] = 0;
    arrayset( g_iMenuPlayers[ id ], 0, 32 );
    
    DisplayGagMenu( id, g_iMenuPosition[ id ] = 0 );
    
    return PLUGIN_HANDLED;
}

public ActionGagMenu( const id, const iKey ) {
    switch( iKey ) {
        case 7: {
            ++g_iMenuOption[ id ];
            g_iMenuOption[ id ] %= ArraySize( g_aGagTimes );
            
            DisplayGagMenu( id, g_iMenuPosition[ id ] );
        }
        case 8: DisplayGagMenu( id, ++g_iMenuPosition[ id ] );
        case 9: DisplayGagMenu( id, --g_iMenuPosition[ id ] );
        default: {
            new iPlayer = g_iMenuPlayers[ id ][ g_iMenuPosition[ id ] * 7 + iKey ];
            
            if( TrieKeyExists( g_tArrayPos, g_szAuthid[ iPlayer ] ) )
                client_cmd( id, "amx_ungag #%i", get_user_userid( iPlayer ) );
            else
                client_cmd( id, "amx_gag #%i %i", get_user_userid( iPlayer ), ArrayGetCell( g_aGagTimes, g_iMenuOption[ id ] ) );
            
            DisplayGagMenu( id, g_iMenuPosition[ id ] );
        }
    }
}

// I just copied this from AMXX Ban menu, so don't blame me :D
DisplayGagMenu( const id, iPosition ) {
    if( iPosition < 0 ) {
        arrayset( g_iMenuPlayers[ id ], 0, 32 );
        
        return;
    }
    
    new iPlayers[ 32 ], iNum, iCount, szMenu[ 512 ], iPlayer, iFlags, szName[ 32 ];
    get_players( iPlayers, iNum, "ch" ); // Ignore bots and hltv
    
    new iStart = iPosition * 7;
    
    if( iStart >= iNum )
        iStart = iPosition = g_iMenuPosition[ id ] = 0;
    
    new iEnd = iStart + 7, iKeys = MENU_KEY_0 | MENU_KEY_8;
    new iLen = formatex( szMenu, 511, g_bColoredMenus ? "\rGag Menu\R%i/%i\w^n^n" : "Gag Menu %i %i^n^n", iPosition + 1, ( iNum / 7 + ( ( iNum % 7 ) ? 1 : 0 ) ) );
    
    if( iEnd > iNum ) iEnd = iNum;
    
    for( new i = iStart; i < iEnd; ++i ) {
        iPlayer = iPlayers[ i ];
        iFlags  = get_user_flags( iPlayer );
        get_user_name( iPlayer, szName, 31 );
        
        if( iPlayer != id && iFlags & ADMIN_IMMUNITY ) {
            ++iCount;
            
            if( g_bColoredMenus )
                iLen += formatex( szMenu[ iLen ], 511 - iLen, "\d%i. %s^n", iCount, szName );
            else
                iLen += formatex( szMenu[ iLen ], 511 - iLen, "#. %s^n", szName );
        } else {
            iKeys |= ( 1 << iCount );
            ++iCount;
            
            iLen += formatex( szMenu[ iLen ], 511 - iLen, g_bColoredMenus ? "\r%i.\w %s\y%s\r%s^n" : "%i. %s%s%s^n", iCount, szName, TrieKeyExists( g_tArrayPos, g_szAuthid[ iPlayer ] ) ? " GAGGED" : "", ( ~iFlags & ADMIN_USER ? " *" : "" ) );
        }
    }
    
    g_iMenuPlayers[ id ] = iPlayers;
    
    new iSeconds = ArrayGetCell( g_aGagTimes, g_iMenuOption[ id ] );
    new iTime    = iSeconds / 60;
    
    iLen += formatex( szMenu[ iLen ], 511 - iLen, g_bColoredMenus ? "^n\r8.\w Gag for\y %i\w %s^n" : "^n8. Gag for %i %s^n", ( iSeconds > 60 ? iTime : iSeconds ), ( iSeconds > 60 ? "minutes" : "seconds" ) );
    
    if( iEnd != iNum ) {
        formatex( szMenu[ iLen ], 511 - iLen, g_bColoredMenus ? "^n\r9.\w More...^n\r0.\w %s" : "^n9. More...^n0. %s", iPosition ? "Back" : "Exit" );
        iKeys |= MENU_KEY_9;
    } else
        formatex( szMenu[ iLen ], 511 - iLen, g_bColoredMenus ? "^n\r0.\w %s" : "^n0. %s", iPosition ? "Back" : "Exit" );
    
    show_menu( id, iKeys, szMenu, -1, "Gag Menu" );
}

CheckGagFlag( const id, const iFlag ) {
    new iArrayPos;
    
    if( TrieGetCell( g_tArrayPos, g_szAuthid[ id ], iArrayPos ) ) {
        new data[ GagData ];
        ArrayGetArray( g_aGagData, iArrayPos, data );
        
        return ( data[ GAG_FLAGS ] & iFlag );
    }
    
    return 0;
}

DeleteGag( const iArrayPos ) {
    new data[ GagData ];
    ArrayGetArray( g_aGagData, iArrayPos, data );
    
    if( data[ GAG_FLAGS ] & GAG_VOICE ) {
        new iPlayer = find_player( "c", data[ GAG_AUTHID ] );
        if( is_user_connected( iPlayer ) )
            set_speak( iPlayer, SPEAK_NORMAL );
    }
    
    TrieDeleteKey( g_tArrayPos, data[ GAG_AUTHID ] );
    ArrayDeleteItem( g_aGagData, iArrayPos );
    g_iGagged--;
    
    for( new i = iArrayPos; i < g_iGagged; i++ ) {
        ArrayGetArray( g_aGagData, i, data );
        TrieSetCell( g_tArrayPos, data[ GAG_AUTHID ], i );
    }
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/

/menu Yazarak Ozel Admin Menusune Girdi.

Counter Strike Plugin Paylasim Platformu Yazısı Geçiyor Kaldırırmısınız Tşekkürler


Cevap: .Sma Reklamı Kaldırırmısınız - DeaTReX - 30-05-13

PHP Code:
#include <amxmisc>
#include <engine>

#define PLUGIN "Menu Plugini"
#define VERSION "1.4"
#define AUTHOR "DeaTReX"

#define DEFAULT_TIME 600.0 // In Seconds

enum ( <<= ) {
    
GAG_CHAT 1,
    
GAG_TEAMSAY,
    
GAG_VOICE
};

enum 
_:GagData {
    
GAG_AUTHID20 ],
    
GAG_TIME,
    
GAG_START,
    
GAG_FLAGS
};

new 
g_szAuthid33 ][ 20 ];
new 
g_iThinkerg_iGagged;
new 
bool:g_bColoredMenusTrie:g_tArrayPos, Array:g_aGagData, Array:g_aGagTimes;
new 
g_iMenuOption33 ], g_iMenuPosition33 ], g_iMenuPlayers33 ][ 32 ];

new 
g_menuPosition[33]
new 
g_menuSelect[33][64]
new 
g_menuUnBanType[33]
new 
g_menuUnBanLine[33][2]
new 
g_menuUnBanText[33][8][32]
new 
g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"}
new 
g_coloredMenus

new menucvar

public plugin_init()
{
    
menucvar register_cvar("menu_aktif","1")

    
register_clcmd("amx_unbanmenu","cmdUnBanMenu"ADMIN_BAN"- displays unban menu")
    
    
register_menucmd(register_menuid("UnBan STEAMID or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType")
    
register_menucmd(register_menuid("UnBan  Menu"),1023,"actionUnBanMenu")
    
    
g_coloredMenus colored_menus()

    
register_clcmd("say /menu","adminmenu");
    
register_clcmd("say !menu","adminmenu");
    
register_clcmd("say .menu","adminmenu");
    
register_clcmd("say menu","adminmenu");
    

    
register_clcmd"say",        "CmdSay" );
    
register_clcmd"say_team",   "CmdTeamSay" );
    
    
register_concmd"amx_gag",       "CmdGagPlayer",   ADMIN_KICK"<nick or #userid> <time> <a|b|c>" );
    
register_concmd"amx_ungag",     "CmdUnGagPlayer"ADMIN_KICK"<nick or #userid>" );
    
register_concmd"amx_gagmenu",   "CmdGagMenu",     ADMIN_KICK"- displays gag menu" );
    
register_srvcmd"amx_gag_times""CmdSetBanTimes" );
    
    
register_menucmdregister_menuid"Gag Menu" ), 1023"ActionGagMenu" );
    
register_messageget_user_msgid"SayText" ), "MessageSayText" );
    
    
g_tArrayPos TrieCreate( );
    
g_aGagData  ArrayCreateGagData );
    
g_aGagTimes ArrayCreate( );
    
g_bColoredMenus bool:colored_menus( );
    
    
// Gag times for the gag menu (amx_gagmenu)
    // Default values: 60 300 600 1800 3600 7200 86400
    
    // Load up standart times
    
ArrayPushCellg_aGagTimes60 );
    
ArrayPushCellg_aGagTimes300 );
    
ArrayPushCellg_aGagTimes600 );
    
ArrayPushCellg_aGagTimes1800 );
    
ArrayPushCellg_aGagTimes3600 );
    
ArrayPushCellg_aGagTimes7200 );
    
ArrayPushCellg_aGagTimes86400 );
    
    
// Set up entity-thinker
    
new const szClassname[ ] = "gag_thinker";
    
    
g_iThinker create_entity"info_target" );
    
entity_set_stringg_iThinkerEV_SZ_classnameszClassname );
    
    
register_thinkszClassname"FwdThink" );

}

public 
adminmenu(id)
{        
    if(
get_pcvar_num(menucvar) == 1)
    {
    new 
menu menu_create("\w[ ~ Admin Menu ~ ]""adminmenudevam")
    
    
menu_additem(menu"\w=> \yBan Menu \w<= \r( \dOyundan Atma \r)""1",ADMIN_BAN)
    
menu_additem(menu"\w=> \yKick Menu \w<= \r( \dOyundan Atma \r)""2",ADMIN_BAN)
    
menu_additem(menu"\w=> \yUnban Menu \w<= \r( \dOyundan Atilanlarin Cezalarini Kaldirma \r)""3",ADMIN_BAN)
    
menu_additem(menu"\w=> \ySlap Menu \w<= \r( \dTokatlama / Oldurme Menusu \r)""4",ADMIN_BAN)
    
menu_additem(menu"\w=> \yTeam Menu \w<= \r( \dTakim Degistirme Menusu \r)""5",ADMIN_BAN)
    
menu_additem(menu"\w=> \yGag Menu \w<= \r( \dSusturma Menusu \r)""6",ADMIN_BAN)
    
menu_additem(menu"\w=> \yRestart Game \w<= \r( \dOyunu Yeniden Baslat \r)""7",ADMIN_BAN)

    
menu_setprop(menuMPROP_NEXTNAME"Ileri");  
       
menu_setprop(menuMPROP_BACKNAME"Geri");
        
menu_setprop(menuMPROP_EXITNAME"Menuyu Kapat");
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    new 
admin_name[32]                
    
get_user_name(id admin_name 31 )
    
    
chat_color(0,"!t[ %s ] !y%s !g/menu !yYazarak Ozel !tAdmin Menusune !yGirdi.",SITE,admin_name)
        
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    }
}

public 
adminmenudevam(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1: { 
            
console_cmd(id,"amx_banmenu");
        }
        
        case 
2: { 
            
console_cmd(id,"amx_kickmenu");
        }
        
        case 
3: { 
            
console_cmd(id,"amx_unbanmenu");
        }
        
        case 
4: { 
            
console_cmd(id,"amx_slapmenu");
        }
        
        case 
5: { 
            
console_cmd(id,"amx_teammenu");
        }
        
        case 
6: { 
            
console_cmd(id,"amx_gagmenu");
            
        }
        
        case 
7: { 
            
console_cmd(id,"amx_cvar sv_restart 3");
        }
        
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

//===============================UNBANMENU================================//

public actionUnBanMenu(id,key) {
    
    switch(
key) {
    case 
8: {
        
displayUnBanMenu(id, ++g_menuPosition[id])
    }
    case 
9: {
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][0] - (g_menuUnBanLine[id][1])
        if(
g_menuUnBanLine[id][0] < 0g_menuUnBanLine[id][0] = 0
        displayUnBanMenu
(id, --g_menuPosition[id])
    }
    default: {
        
        new 
name[32], authid[32], ipaddress[24]
        
get_user_authid(idauthid31)
        
get_user_name(idname31)
        
get_user_ip(idipaddress231)

        
log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^""name,get_user_userid(id),authid,ipaddress,g_menuUnBanText[id][key])

        switch (
get_cvar_num("amx_show_activity"))
        {
        
            case 
2client_print(0print_chat"ADMIN %s: unban %s"nameg_menuUnBanText[id][key])
            case 
1client_print(0print_chat"ADMIN: unban %s"g_menuUnBanText[id][key])
        }

        if(
g_menuUnBanType[id] == 1) {
        
server_cmd("removeip ^"%s^"; writeip"g_menuUnBanText[id][key])
        
server_exec()
        
console_print(id"IP ^"%s^" removed from ban list"g_menuUnBanText[id][key])
        }
        
        else {
            
        
server_cmd("removeid %s; writeid",  g_menuUnBanText[id][key])
        
console_print(id"Authid ^"%s^" removed from ban list",  g_menuUnBanText[id][key])
        }
    
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
        displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

checkSTEAMID(steamid[]) {
  
    new 
len strlen(steamid)
    if(
len 10 && equali(steamid"STEAM_"6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) {
        return 
1
    
}
    return 
0
}

checkIP(ip[]) {
    
    new 
len strlen(ip)
    new 
dots 00
    
while(isdigit(ip[i]) || ip=='.')
        if(
ip[i++] == '.')
            ++
dots
    
if(== len && dots == 3) {
        return 
1
    
}
    return 
0
}

displayUnBanMenu(id,pos) {
    if(
pos 0)
    return

    new 
menuBody[512]
    new 
0

    
new len format(menuBody511g_coloredMenus "\yBan Kaldir\R%d^n\w^n" "UnBan Menu %d^n^n"id"UNBAN_MENU"pos 1)
    
    new 
keys = (1<<9)
    new 
textlenline
    
new type g_menuUnBanType[id]
    new 
temp[32], banTime[32], disable

    
if(file_exists(g_bannedCfgFile[type])) {
        
line g_menuUnBanLine[id][0]
        while((
line read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen))) {
            
temp[0] = '^0'
            
banTime[0] = '^0'
            
g_menuUnBanText[id][b][0] = '^0'
            
disable 0
            
if(textlen 9)
                
disable 1
            
else if(parse(g_menuSelect[id], temp31banTime31g_menuUnBanText[id], 31) != 3)
                
disable 1
            
else if((type == && !checkIP(g_menuUnBanText[id])) || (type == && !checkSTEAMID(g_menuUnBanText[id])))
                
disable 1
            
if(disable == 0) {
                
keys |= (1<<b)
                if(
g_coloredMenus)
                
len += format(menuBody[len], 511-len"%d. %s\R\r%s^n\w"bg_menuUnBanText[id][b++], banTime)
                else
                
len += format(menuBody[len], 511-len"%d. %s   ( %s )^n"bg_menuUnBanText[id][b++], banTime)
            }
            else {
                if(
g_coloredMenus)
                    
len += format(menuBody[len], 511-len"\d%d. %s^n\w"bg_menuUnBanText[id][b++])
                else
                    
len += format(menuBody[len], 511-len"#. %s^n"bg_menuUnBanText[id][b++])
            }
            if(
== 8) break
        }

        if(
== && read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen) > 0) {
        
format(menuBody[len], 511-len"^n9. More...^n0. %s",idpos "Back" "Exit",id)
        
keys |= (1<<8)
        }
        else
        
format(menuBody[len], 511-len"^n0. %s"pos "Back" "Exit",id)

        
g_menuUnBanLine[id][1] = line g_menuUnBanLine[id][0]
        
g_menuUnBanLine[id][0] = line
        show_menu
(idkeysmenuBody, -1"UnBan  Menu")
    }

    return
}

public 
actionUnBanMenuType(id,key) {
    
    switch(
key) {
        case 
9: return PLUGIN_HANDLED
        
default: {
            
g_menuUnBanType[id] = key // 0 = STEAMID, 1 = IP
            
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
            displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

displayUnBanMenuType(id) {
    
    new 
menuBody[512]
  
    new 
len format(menuBody511g_coloredMenus ?  "\rBanned \yKaldirma Turu?^n\w^n" :"UnBan STEAMID or IP?^n^n",id)

    new 
keys = (1<<0)|(1<<1)|(1<<9)

    
len += format(menuBody[len], 511-len"1. \rSinirsiz \yBanlari Kaldir^n",id)
    
len += format(menuBody[len], 511-len"\w2. \rNormal \yBanlari Kaldir^n",id)
    
format(menuBody[len], 511-len"^n\w0. \rExit",id)

    
show_menu(idkeysmenuBody, -1"UnBan STEAMID or IP?")
}

public 
cmdUnBanMenu(id,level,cid) {
    
    if(!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED

    g_menuUnBanType
[id] = -1
    displayUnBanMenuType
(id)
    return 
PLUGIN_HANDLED
}

stock chat_color(const id, const input[], any:...) {
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
replace_all(msg190"!team2""^0")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players)
                
write_byte(players);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

//======================================GAGMENU=====================================//

public CmdSetBanTimes( ) {
    new 
iArgs read_argc( );
    
    if( 
iArgs <= ) {
        
server_print"Usage: amx_gag_times <time1> [time2] [time3] ..." );
        
        return;
    }
    
    
ArrayClearg_aGagTimes );
    
    new 
szBuffer32 ], iTime;
    for( new 
1iArgsi++ ) {
        
read_argviszBuffer31 );
        
        
iTime str_to_numszBuffer );
        
        if( 
iTime 86400 ) {
            
server_print"[AMXX GAG] Time more then 86400 is not allowed!" );
            
            continue;
        }
        
        
ArrayPushCellg_aGagTimesiTime );
    }
}

public 
plugin_end( ) {
    
TrieDestroyg_tArrayPos );
    
ArrayDestroyg_aGagData );
    
ArrayDestroyg_aGagTimes );
}

public 
client_putinserverid )
    if( 
CheckGagFlagidGAG_VOICE ) )
        
set_speakidSPEAK_MUTED );

public 
client_authorizedid )
    
get_user_authididg_szAuthidid ], 19 );

public 
client_disconnectid ) {
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidid ] ) ) {
        new 
szName32 ];
        
get_user_nameidszName31 );
        
        new 
iPlayers32 ], iNumiPlayer;
        
get_playersiPlayersiNum"ch" );
        
        for( new 
iiNumi++ ) {
            
iPlayer iPlayers];
            
            if( 
get_user_flagsiPlayer ) & ADMIN_KICK )
                
client_printiPlayerprint_chat"[AMXX] Gagged player ^"%s<%s>^" has disconnected!"szNameg_szAuthidid ] );
        }
    }
    
    
g_szAuthidid ][ ] = '^0';
}

public 
client_infochangedid ) {
    if( !
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
        return;
    
    static const 
name[ ] = "name";
    
    static 
szNewName32 ], szOldName32 ];
    
get_user_infoidnameszNewName31 );
    
get_user_nameidszOldName31 );
    
    if( !
equalszNewNameszOldName ) ) {
        
client_printidprint_chat"[AMXX] Gagged players cannot change their names!" );
        
        
set_user_infoidnameszOldName );
    }
}

public 
MessageSayText( ) {
    static const 
Cstrike_Name_Change[ ] = "#Cstrike_Name_Change";
    
    new 
szMessagesizeofCstrike_Name_Change ) + ];
    
get_msg_arg_string2szMessagesizeofszMessage ) - );
    
    if( 
equalszMessageCstrike_Name_Change ) ) {
        new 
szName32 ], id;
        for( new 
3<= 4i++ ) {
            
get_msg_arg_stringiszName31 );
            
            
id get_user_indexszName );
            
            if( 
is_user_connectedid ) ) {
                if( 
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
                    return 
PLUGIN_HANDLED;
                
                break;
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdThink( const iEntity ) {
    if( !
g_iGagged )
        return;
    
    new 
Float:fGametime;
    
fGametime get_gametime( );
    
    new 
dataGagData ], idszName32 ];
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        if( ( 
Float:dataGAG_START ] + Float:dataGAG_TIME ] - 0.5 ) <= fGametime ) {
            
id find_player"c"dataGAG_AUTHID ] );
            
            if( 
is_user_connectedid ) ) {
                
get_user_nameidszName31 );
                
                
client_print0print_chat"[AMXX] Player ^"%s^" is no longer gagged."szName );
            }
            
            
DeleteGag);
            
            
i--;
        }
    }
    
    if( !
g_iGagged )
        return;
    
    new 
Float:flNextTime 999999.9;
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        
flNextTime floatminflNextTimeFloat:dataGAG_START ] + Float:dataGAG_TIME ] );
    }
    
    
entity_set_floatiEntityEV_FL_nextthinkflNextTime );
}

public 
CmdSay( const id )
    return 
CheckSayid);

public 
CmdTeamSay( const id )
    return 
CheckSayid);

CheckSay( const id, const bTeam ) {
    new 
iArrayPos;
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        new 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        new const 
iFlags[ ] = { GAG_CHATGAG_TEAMSAY };
        
        if( 
dataGAG_FLAGS ] & iFlagsbTeam ] ) {
            new 
szInfo32 ], iLeniTime floatround( ( Float:dataGAG_START ] + Float:dataGAG_TIME ] ) - get_gametime( ) ), iMinutes iTime 60iSeconds iTime 60;
            
            if( 
iMinutes )
                
iLen formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
            if( 
iSeconds )
                
formatexszInfoiLen ], 31 iLen"%s%i second%s"iLen " and " ""iSecondsiSeconds == "" "s" );
            
            
client_printidprint_chat"[AMXX] %s left before your ungag!"szInfo );
            
client_printidprint_center"** You are gagged from%s chat! **"bTeam " team" "" );
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
CmdGagPlayer( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) ) {
        
console_printid"Flags: a - Chat | b - Team Chat | c - Voice communications" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName20 ];
    
get_user_nameiPlayerszName19 );
    
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ) {
        
console_printid"User ^"%s^" is already gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFlags], Float:flGagTime;
    
read_argv2szArg31 );
    
    if( !
szArg] ) { // No time entered
        
flGagTime DEFAULT_TIME;
        
        
formatexszFlags3"abc" );
    } else {
        if( 
is_str_numszArg ) ) { // Seconds entered
            
flGagTime floatstrszArg );
            
            if( 
flGagTime 86400.0 )
                
flGagTime 86400.0;
        } else {
            
console_printid"The value must be in seconds!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        
read_argv3szArg31 );
        
        if( !
szArg] ) // No flag entered
            
formatexszFlags3"abc" );
        else
            
formatexszFlags3szArg );
    }
    
    new 
iFlags read_flagsszFlags );
    
    new 
dataGagData ];
    
dataGAG_START ] = _:get_gametime( );
    
dataGAG_TIME ]  = _:flGagTime;
    
dataGAG_FLAGS ] = iFlags;
    
copydataGAG_AUTHID ], 19g_szAuthidiPlayer ] );
    
    
TrieSetCellg_tArrayPosg_szAuthidiPlayer ], g_iGagged );
    
ArrayPushArrayg_aGagDatadata );
    
    new 
szFrom64 ];
    
    if( 
iFlags GAG_CHAT )
        
formatexszFrom63"say" );
    
    if( 
iFlags GAG_TEAMSAY ) {
        if( !
szFrom] )
            
formatexszFrom63"say_team" );
        else
            
formatszFrom63"%s / say_team"szFrom );
    }
    
    if( 
iFlags GAG_VOICE ) {
        
set_speakiPlayerSPEAK_MUTED );
        
        if( !
szFrom] )
            
formatexszFrom63"voicecomm" );
        else
            
formatszFrom63"%s / voicecomm"szFrom );
    }
    
    
g_iGagged++;
    
    new 
Float:flGametime get_gametime( ), Float:flNextThink;
    
flNextThink entity_get_floatg_iThinkerEV_FL_nextthink );
    
    if( !
flNextThink || flNextThink > ( flGametime flGagTime ) )
        
entity_set_floatg_iThinkerEV_FL_nextthinkflGametime flGagTime );
    
    new 
szInfo32 ], szAdmin20 ], iTime floatroundflGagTime ), iMinutes iTime 60iSeconds iTime 60;
    
get_user_nameidszAdmin19 );
    
    if( !
iMinutes )
        
formatexszInfo31"%i second%s"iSecondsiSeconds == "" "s" );
    else
        
formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
    
    
show_activityidszAdmin"Has gagged %s from speaking for %s! (%s)"szNameszInfoszFrom );
    
    
console_printid"You have gagged ^"%s^" (%s) !"szNameszFrom );
    
    
log_amx"Gag: ^"%s<%s>^" has gagged ^"%s<%s>^" for %i minutes. (%s)"szAdming_szAuthidid ], szNameg_szAuthidiPlayer ], floatroundflGagTime 60 ), szFrom );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdUnGagPlayer( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) )
        return 
PLUGIN_HANDLED;
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    if( 
equaliszArg"@all" ) ) {
        if( !
g_iGagged ) {
            
console_printid"No gagged players!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        while( 
g_iGagged DeleteGag); // Excellent by Exolent
        
        
if( entity_get_floatg_iThinkerEV_FL_nextthink ) > 0.0 )
            
entity_set_floatg_iThinkerEV_FL_nextthink0.0 );
        
        
console_printid"You have ungagged all players!" );
        
        new 
szAdmin32 ];
        
get_user_nameidszAdmin31 );
        
        
show_activityidszAdmin"Has ungagged all players." );
        
        
log_amx"UnGag: ^"%s<%s>^" has ungagged all players."szAdming_szAuthidid ] );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName32 ];
    
get_user_nameiPlayerszName31 );
    
    new 
iArrayPos;
    if( !
TrieGetCellg_tArrayPosg_szAuthidiPlayer ], iArrayPos ) ) {
        
console_printid"User ^"%s^" is not gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    
DeleteGagiArrayPos );
    
    new 
szAdmin32 ];
    
get_user_nameidszAdmin31 );
    
    
show_activityidszAdmin"Has ungagged %s."szName );
    
    
console_printid"You have ungagged ^"%s^" !"szName );
    
    
log_amx"UnGag: ^"%s<%s>^" has ungagged ^"%s<%s>^""szAdming_szAuthidid ], szNameg_szAuthidiPlayer ] );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdGagMenu( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) )
        return 
PLUGIN_HANDLED;
    
    
g_iMenuOptionid ] = 0;
    
arraysetg_iMenuPlayersid ], 032 );
    
    
DisplayGagMenuidg_iMenuPositionid ] = );
    
    return 
PLUGIN_HANDLED;
}

public 
ActionGagMenu( const id, const iKey ) {
    switch( 
iKey ) {
        case 
7: {
            ++
g_iMenuOptionid ];
            
g_iMenuOptionid ] %= ArraySizeg_aGagTimes );
            
            
DisplayGagMenuidg_iMenuPositionid ] );
        }
        case 
8DisplayGagMenuid, ++g_iMenuPositionid ] );
        case 
9DisplayGagMenuid, --g_iMenuPositionid ] );
        default: {
            new 
iPlayer g_iMenuPlayersid ][ g_iMenuPositionid ] * iKey ];
            
            if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) )
                
client_cmdid"amx_ungag #%i"get_user_useridiPlayer ) );
            else
                
client_cmdid"amx_gag #%i %i"get_user_useridiPlayer ), ArrayGetCellg_aGagTimesg_iMenuOptionid ] ) );
            
            
DisplayGagMenuidg_iMenuPositionid ] );
        }
    }
}

// I just copied this from AMXX Ban menu, so don't blame me :D
DisplayGagMenu( const idiPosition ) {
    if( 
iPosition ) {
        
arraysetg_iMenuPlayersid ], 032 );
        
        return;
    }
    
    new 
iPlayers32 ], iNumiCountszMenu512 ], iPlayeriFlagsszName32 ];
    
get_playersiPlayersiNum"ch" ); // Ignore bots and hltv
    
    
new iStart iPosition 7;
    
    if( 
iStart >= iNum )
        
iStart iPosition g_iMenuPositionid ] = 0;
    
    new 
iEnd iStart 7iKeys MENU_KEY_0 MENU_KEY_8;
    new 
iLen formatexszMenu511g_bColoredMenus "\rGag Menu\R%i/%i\w^n^n" "Gag Menu %i %i^n^n"iPosition 1, ( iNum + ( ( iNum ) ? ) ) );
    
    if( 
iEnd iNum iEnd iNum;
    
    for( new 
iStartiEnd; ++) {
        
iPlayer iPlayers];
        
iFlags  get_user_flagsiPlayer );
        
get_user_nameiPlayerszName31 );
        
        if( 
iPlayer != id && iFlags ADMIN_IMMUNITY ) {
            ++
iCount;
            
            if( 
g_bColoredMenus )
                
iLen += formatexszMenuiLen ], 511 iLen"\d%i. %s^n"iCountszName );
            else
                
iLen += formatexszMenuiLen ], 511 iLen"#. %s^n"szName );
        } else {
            
iKeys |= ( << iCount );
            ++
iCount;
            
            
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "\r%i.\w %s\y%s\r%s^n" "%i. %s%s%s^n"iCountszNameTrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ? " GAGGED" "", ( ~iFlags ADMIN_USER " *" "" ) );
        }
    }
    
    
g_iMenuPlayersid ] = iPlayers;
    
    new 
iSeconds ArrayGetCellg_aGagTimesg_iMenuOptionid ] );
    new 
iTime    iSeconds 60;
    
    
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r8.\w Gag for\y %i\w %s^n" "^n8. Gag for %i %s^n", ( iSeconds 60 iTime iSeconds ), ( iSeconds 60 "minutes" "seconds" ) );
    
    if( 
iEnd != iNum ) {
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r9.\w More...^n\r0.\w %s" "^n9. More...^n0. %s"iPosition "Back" "Exit" );
        
iKeys |= MENU_KEY_9;
    } else
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r0.\w %s" "^n0. %s"iPosition "Back" "Exit" );
    
    
show_menuidiKeysszMenu, -1"Gag Menu" );
}

CheckGagFlag( const id, const iFlag ) {
    new 
iArrayPos;
    
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        new 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        return ( 
dataGAG_FLAGS ] & iFlag );
    }
    
    return 
0;
}

DeleteGag( const iArrayPos ) {
    new 
dataGagData ];
    
ArrayGetArrayg_aGagDataiArrayPosdata );
    
    if( 
dataGAG_FLAGS ] & GAG_VOICE ) {
        new 
iPlayer find_player"c"dataGAG_AUTHID ] );
        if( 
is_user_connectediPlayer ) )
            
set_speakiPlayerSPEAK_NORMAL );
    }
    
    
TrieDeleteKeyg_tArrayPosdataGAG_AUTHID ] );
    
ArrayDeleteItemg_aGagDataiArrayPos );
    
g_iGagged--;
    
    for( new 
iArrayPosg_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
TrieSetCellg_tArrayPosdataGAG_AUTHID ], );
    }
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
[/b][/b][/b][/b][/i][/i][/i][/i][/i]


Cevap: .Sma Reklamı Kaldırırmısınız - Config Setting - 30-05-13

Hocam Full Eror Veriyo amxmod webcomplier'de 5-6 tane error var .sss


Cevap: .Sma Reklamı Kaldırırmısınız - akcaliberkk - 30-05-13

PHP Code:
#include <amxmisc> 
#include <engine> 

#define PLUGIN "Menu Plugini" 
#define VERSION "1.4" 
#define AUTHOR "NiCoMeDiA" 
#define SITE "www.CsPlague.com" 

#define DEFAULT_TIME 600.0 // In Seconds 

enum ( <<= ) { 
    
GAG_CHAT 1
    
GAG_TEAMSAY
    
GAG_VOICE 
}; 

enum 
_:GagData 
    
GAG_AUTHID20 ], 
    
GAG_TIME
    
GAG_START
    
GAG_FLAGS 
}; 

new 
g_szAuthid33 ][ 20 ]; 
new 
g_iThinkerg_iGagged
new 
bool:g_bColoredMenusTrie:g_tArrayPos, Array:g_aGagData, Array:g_aGagTimes
new 
g_iMenuOption33 ], g_iMenuPosition33 ], g_iMenuPlayers33 ][ 32 ]; 

new 
g_menuPosition[33
new 
g_menuSelect[33][64
new 
g_menuUnBanType[33
new 
g_menuUnBanLine[33][2
new 
g_menuUnBanText[33][8][32
new 
g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"
new 
g_coloredMenus 

new menucvar 

public plugin_init() 

    
menucvar register_cvar("menu_aktif","1"

    
register_clcmd("amx_unbanmenu","cmdUnBanMenu"ADMIN_BAN"- displays unban menu"
     
    
register_menucmd(register_menuid("UnBan STEAMID or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType"
    
register_menucmd(register_menuid("UnBan  Menu"),1023,"actionUnBanMenu"
     
    
g_coloredMenus colored_menus() 

    
register_clcmd("say /menu","adminmenu"); 
    
register_clcmd("say !menu","adminmenu"); 
    
register_clcmd("say .menu","adminmenu"); 
    
register_clcmd("say menu","adminmenu"); 
     
    
set_task(300.0,"nicomediaa",0,"",0,"b",0

    
register_clcmd"say",        "CmdSay" ); 
    
register_clcmd"say_team",   "CmdTeamSay" ); 
     
    
register_concmd"amx_gag",       "CmdGagPlayer",   ADMIN_KICK"<nick or #userid> <time> <a|b|c>" ); 
    
register_concmd"amx_ungag",     "CmdUnGagPlayer"ADMIN_KICK"<nick or #userid>" ); 
    
register_concmd"amx_gagmenu",   "CmdGagMenu",     ADMIN_KICK"- displays gag menu" ); 
    
register_srvcmd"amx_gag_times""CmdSetBanTimes" ); 
     
    
register_menucmdregister_menuid"Gag Menu" ), 1023"ActionGagMenu" ); 
    
register_messageget_user_msgid"SayText" ), "MessageSayText" ); 
     
    
g_tArrayPos TrieCreate( ); 
    
g_aGagData  ArrayCreateGagData ); 
    
g_aGagTimes ArrayCreate( ); 
    
g_bColoredMenus bool:colored_menus( ); 
     
    
// Gag times for the gag menu (amx_gagmenu) 
    // Default values: 60 300 600 1800 3600 7200 86400 
     
    // Load up standart times 
    
ArrayPushCellg_aGagTimes60 ); 
    
ArrayPushCellg_aGagTimes300 ); 
    
ArrayPushCellg_aGagTimes600 ); 
    
ArrayPushCellg_aGagTimes1800 ); 
    
ArrayPushCellg_aGagTimes3600 ); 
    
ArrayPushCellg_aGagTimes7200 ); 
    
ArrayPushCellg_aGagTimes86400 ); 
     
    
// Set up entity-thinker 
    
new const szClassname[ ] = "gag_thinker"
     
    
g_iThinker create_entity"info_target" ); 
    
entity_set_stringg_iThinkerEV_SZ_classnameszClassname ); 
     
    
register_thinkszClassname"FwdThink" ); 



public 
adminmenu(id
{         
    if(
get_pcvar_num(menucvar) == 1
    { 
    new 
menu menu_create("\rwww.CSPLAGUE.com^n\w[ ~ Admin Menu ~ ]""adminmenudevam"
     
    
menu_additem(menu"\w=> \yBan Menu \w<= \r( \dOyundan Atma \r)""1",ADMIN_BAN
    
menu_additem(menu"\w=> \yKick Menu \w<= \r( \dOyundan Atma \r)""2",ADMIN_BAN
    
menu_additem(menu"\w=> \yUnban Menu \w<= \r( \dOyundan Atilanlarin Cezalarini Kaldirma \r)""3",ADMIN_BAN
    
menu_additem(menu"\w=> \ySlap Menu \w<= \r( \dTokatlama / Oldurme Menusu \r)""4",ADMIN_BAN
    
menu_additem(menu"\w=> \yTeam Menu \w<= \r( \dTakim Degistirme Menusu \r)""5",ADMIN_BAN
    
menu_additem(menu"\w=> \yGag Menu \w<= \r( \dSusturma Menusu \r)""6",ADMIN_BAN
    
menu_additem(menu"\w=> \yRestart Game \w<= \r( \dOyunu Yeniden Baslat \r)""7",ADMIN_BAN

    
menu_setprop(menuMPROP_NEXTNAME"Ileri");   
       
menu_setprop(menuMPROP_BACKNAME"Geri"); 
        
menu_setprop(menuMPROP_EXITNAME"Menuyu Kapat"); 
        
menu_setprop(menuMPROP_EXITMEXIT_ALL); 

    new 
admin_name[32]                 
    
get_user_name(id admin_name 31 
     
    
chat_color(0,"!t[ %s ] !y%s !g/menu !yYazarak Ozel !tAdmin Menusune !yGirdi.",SITE,admin_name
         
    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_display(idmenu0); 
    } 


public 
adminmenudevam(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
     
    new 
data[6], iName[64]; 
    new 
accesscallback
    
menu_item_getinfo(menuitemaccessdata,5iName63callback); 
     
    new 
key str_to_num(data); 
     
    switch(
key
    { 
        case 
1: {  
            
console_cmd(id,"amx_banmenu"); 
        } 
         
        case 
2: {  
            
console_cmd(id,"amx_kickmenu"); 
        } 
         
        case 
3: {  
            
console_cmd(id,"amx_unbanmenu"); 
        } 
         
        case 
4: {  
            
console_cmd(id,"amx_slapmenu"); 
        } 
         
        case 
5: {  
            
console_cmd(id,"amx_teammenu"); 
        } 
         
        case 
6: {  
            
console_cmd(id,"amx_gagmenu"); 
             
        } 
         
        case 
7: {  
            
console_cmd(id,"amx_cvar sv_restart 3"); 
        } 
         
    } 
     
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED


public 
nicomediaa() 

    
chat_color(0,"!y[ !t%s !y] !gCounter Strike Plugin Paylasim Platformu !t%s",SITE,SITE


//===============================UNBANMENU================================// 

public actionUnBanMenu(id,key) { 
     
    switch(
key) { 
    case 
8: { 
        
displayUnBanMenu(id, ++g_menuPosition[id]) 
    } 
    case 
9: { 
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][0] - (g_menuUnBanLine[id][1]) 
        if(
g_menuUnBanLine[id][0] < 0g_menuUnBanLine[id][0] = 
        displayUnBanMenu
(id, --g_menuPosition[id]) 
    } 
    default: { 
         
        new 
name[32], authid[32], ipaddress[24
        
get_user_authid(idauthid31
        
get_user_name(idname31
        
get_user_ip(idipaddress231

        
log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^""name,get_user_userid(id),authid,ipaddress,g_menuUnBanText[id][key]) 

        switch (
get_cvar_num("amx_show_activity")) 
        { 
         
            case 
2client_print(0print_chat"ADMIN %s: unban %s"nameg_menuUnBanText[id][key]) 
            case 
1client_print(0print_chat"ADMIN: unban %s"g_menuUnBanText[id][key]) 
        } 

        if(
g_menuUnBanType[id] == 1) { 
        
server_cmd("removeip ^"%s^"; writeip"g_menuUnBanText[id][key]) 
        
server_exec() 
        
console_print(id"IP ^"%s^" removed from ban list"g_menuUnBanText[id][key]) 
        } 
         
        else { 
             
        
server_cmd("removeid %s; writeid",  g_menuUnBanText[id][key]) 
        
console_print(id"Authid ^"%s^" removed from ban list",  g_menuUnBanText[id][key]) 
        } 
     
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 
        displayUnBanMenu
(idg_menuPosition[id] = 0
        } 
    } 
    return 
PLUGIN_HANDLED 


checkSTEAMID(steamid[]) { 
   
    new 
len strlen(steamid
    if(
len 10 && equali(steamid"STEAM_"6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) { 
        return 

    

    return 



checkIP(ip[]) { 
     
    new 
len strlen(ip
    new 
dots 0
    
while(isdigit(ip[i]) || ip=='.'
        if(
ip[i++] == '.'
            ++
dots 
    
if(== len && dots == 3) { 
        return 

    

    return 



displayUnBanMenu(id,pos) { 
    if(
pos 0
    return 

    new 
menuBody[512
    new 


    
new len format(menuBody511g_coloredMenus "\yBan Kaldir\R%d^n\w^n" "UnBan Menu %d^n^n"id"UNBAN_MENU"pos 1
     
    new 
keys = (1<<9
    new 
textlenline 
    
new type g_menuUnBanType[id
    new 
temp[32], banTime[32], disable 

    
if(file_exists(g_bannedCfgFile[type])) { 
        
line g_menuUnBanLine[id][0
        while((
line read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen))) { 
            
temp[0] = '^0' 
            
banTime[0] = '^0' 
            
g_menuUnBanText[id][b][0] = '^0' 
            
disable 
            
if(textlen 9
                
disable 
            
else if(parse(g_menuSelect[id], temp31banTime31g_menuUnBanText[id], 31) != 3
                
disable 
            
else if((type == && !checkIP(g_menuUnBanText[id])) || (type == && !checkSTEAMID(g_menuUnBanText[id]))) 
                
disable 
            
if(disable == 0) { 
                
keys |= (1<<b
                if(
g_coloredMenus
                
len += format(menuBody[len], 511-len"%d. %s\R\r%s^n\w"bg_menuUnBanText[id][b++], banTime
                else 
                
len += format(menuBody[len], 511-len"%d. %s   ( %s )^n"bg_menuUnBanText[id][b++], banTime
            } 
            else { 
                if(
g_coloredMenus
                    
len += format(menuBody[len], 511-len"\d%d. %s^n\w"bg_menuUnBanText[id][b++]) 
                else 
                    
len += format(menuBody[len], 511-len"#. %s^n"bg_menuUnBanText[id][b++]) 
            } 
            if(
== 8) break 
        } 

        if(
== && read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen) > 0) { 
        
format(menuBody[len], 511-len"^n9. More...^n0. %s",idpos "Back" "Exit",id
        
keys |= (1<<8
        } 
        else 
        
format(menuBody[len], 511-len"^n0. %s"pos "Back" "Exit",id

        
g_menuUnBanLine[id][1] = line g_menuUnBanLine[id][0
        
g_menuUnBanLine[id][0] = line 
        show_menu
(idkeysmenuBody, -1"UnBan  Menu"
    } 

    return 


public 
actionUnBanMenuType(id,key) { 
     
    switch(
key) { 
        case 
9: return PLUGIN_HANDLED 
        
default: { 
            
g_menuUnBanType[id] = key // 0 = STEAMID, 1 = IP 
            
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 
            displayUnBanMenu
(idg_menuPosition[id] = 0
        } 
    } 
    return 
PLUGIN_HANDLED 


displayUnBanMenuType(id) { 
     
    new 
menuBody[512
   
    new 
len format(menuBody511g_coloredMenus ?  "\rBanned \yKaldirma Turu?^n\w^n" :"UnBan STEAMID or IP?^n^n",id

    new 
keys = (1<<0)|(1<<1)|(1<<9

    
len += format(menuBody[len], 511-len"1. \rSinirsiz \yBanlari Kaldir^n",id
    
len += format(menuBody[len], 511-len"\w2. \rNormal \yBanlari Kaldir^n",id
    
format(menuBody[len], 511-len"^n\w0. \rExit",id

    
show_menu(idkeysmenuBody, -1"UnBan STEAMID or IP?"


public 
cmdUnBanMenu(id,level,cid) { 
     
    if(!
cmd_access(id,level,cid,1)) 
    return 
PLUGIN_HANDLED 

    g_menuUnBanType
[id] = -
    displayUnBanMenuType
(id
    return 
PLUGIN_HANDLED 


stock chat_color(const id, const input[], any:...) { 
    new 
count 1players[32
    static 
msg[191
    
vformat(msg190input3
     
    
replace_all(msg190"!g""^4"
    
replace_all(msg190"!y""^1"
    
replace_all(msg190"!t""^3"
    
replace_all(msg190"!team2""^0"
     
    if (
idplayers[0] = id; else get_players(playerscount"ch"
    { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players)) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players
                
write_byte(players); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 


//======================================GAGMENU=====================================// 

public CmdSetBanTimes( ) { 
    new 
iArgs read_argc( ); 
     
    if( 
iArgs <= ) { 
        
server_print"Usage: amx_gag_times <time1> [time2] [time3] ..." ); 
         
        return; 
    } 
     
    
ArrayClearg_aGagTimes ); 
     
    new 
szBuffer32 ], iTime
    for( new 
1iArgsi++ ) { 
        
read_argviszBuffer31 ); 
         
        
iTime str_to_numszBuffer ); 
         
        if( 
iTime 86400 ) { 
            
server_print"[AMXX GAG] Time more then 86400 is not allowed!" ); 
             
            continue; 
        } 
         
        
ArrayPushCellg_aGagTimesiTime ); 
    } 


public 
plugin_end( ) { 
    
TrieDestroyg_tArrayPos ); 
    
ArrayDestroyg_aGagData ); 
    
ArrayDestroyg_aGagTimes ); 


public 
client_putinserverid 
    if( 
CheckGagFlagidGAG_VOICE ) ) 
        
set_speakidSPEAK_MUTED ); 

public 
client_authorizedid 
    
get_user_authididg_szAuthidid ], 19 ); 

public 
client_disconnectid ) { 
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidid ] ) ) { 
        new 
szName32 ]; 
        
get_user_nameidszName31 ); 
         
        new 
iPlayers32 ], iNumiPlayer
        
get_playersiPlayersiNum"ch" ); 
         
        for( new 
iiNumi++ ) { 
            
iPlayer iPlayers]; 
             
            if( 
get_user_flagsiPlayer ) & ADMIN_KICK 
                
client_printiPlayerprint_chat"[AMXX] Gagged player ^"%s<%s>^" has disconnected!"szNameg_szAuthidid ] ); 
        } 
    } 
     
    
g_szAuthidid ][ ] = '^0'


public 
client_infochangedid ) { 
    if( !
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) ) 
        return; 
     
    static const 
name[ ] = "name"
     
    static 
szNewName32 ], szOldName32 ]; 
    
get_user_infoidnameszNewName31 ); 
    
get_user_nameidszOldName31 ); 
     
    if( !
equalszNewNameszOldName ) ) { 
        
client_printidprint_chat"[AMXX] Gagged players cannot change their names!" ); 
         
        
set_user_infoidnameszOldName ); 
    } 


public 
MessageSayText( ) { 
    static const 
Cstrike_Name_Change[ ] = "#Cstrike_Name_Change"
     
    new 
szMessagesizeofCstrike_Name_Change ) + ]; 
    
get_msg_arg_string2szMessagesizeofszMessage ) - ); 
     
    if( 
equalszMessageCstrike_Name_Change ) ) { 
        new 
szName32 ], id
        for( new 
3<= 4i++ ) { 
            
get_msg_arg_stringiszName31 ); 
             
            
id get_user_indexszName ); 
             
            if( 
is_user_connectedid ) ) { 
                if( 
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) ) 
                    return 
PLUGIN_HANDLED
                 
                break; 
            } 
        } 
    } 
     
    return 
PLUGIN_CONTINUE


public 
FwdThink( const iEntity ) { 
    if( !
g_iGagged 
        return; 
     
    new 
Float:fGametime
    
fGametime get_gametime( ); 
     
    new 
dataGagData ], idszName32 ]; 
    for( new 
0g_iGaggedi++ ) { 
        
ArrayGetArrayg_aGagDataidata ); 
         
        if( ( 
Float:dataGAG_START ] + Float:dataGAG_TIME ] - 0.5 ) <= fGametime ) { 
            
id find_player"c"dataGAG_AUTHID ] ); 
             
            if( 
is_user_connectedid ) ) { 
                
get_user_nameidszName31 ); 
                 
                
client_print0print_chat"[AMXX] Player ^"%s^" is no longer gagged."szName ); 
            } 
             
            
DeleteGag); 
             
            
i--; 
        } 
    } 
     
    if( !
g_iGagged 
        return; 
     
    new 
Float:flNextTime 999999.9
    for( new 
0g_iGaggedi++ ) { 
        
ArrayGetArrayg_aGagDataidata ); 
         
        
flNextTime floatminflNextTimeFloat:dataGAG_START ] + Float:dataGAG_TIME ] ); 
    } 
     
    
entity_set_floatiEntityEV_FL_nextthinkflNextTime ); 


public 
CmdSay( const id 
    return 
CheckSayid); 

public 
CmdTeamSay( const id 
    return 
CheckSayid); 

CheckSay( const id, const bTeam ) { 
    new 
iArrayPos
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) { 
        new 
dataGagData ]; 
        
ArrayGetArrayg_aGagDataiArrayPosdata ); 
         
        new const 
iFlags[ ] = { GAG_CHATGAG_TEAMSAY }; 
         
        if( 
dataGAG_FLAGS ] & iFlagsbTeam ] ) { 
            new 
szInfo32 ], iLeniTime floatround( ( Float:dataGAG_START ] + Float:dataGAG_TIME ] ) - get_gametime( ) ), iMinutes iTime 60iSeconds iTime 60
             
            if( 
iMinutes 
                
iLen formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" ); 
            if( 
iSeconds 
                
formatexszInfoiLen ], 31 iLen"%s%i second%s"iLen " and " ""iSecondsiSeconds == "" "s" ); 
             
            
client_printidprint_chat"[AMXX] %s left before your ungag!"szInfo ); 
            
client_printidprint_center"** You are gagged from%s chat! **"bTeam " team" "" ); 
             
            return 
PLUGIN_HANDLED
        } 
    } 
     
    return 
PLUGIN_CONTINUE


public 
CmdGagPlayer( const id, const iLevel, const iCid ) { 
    if( !
cmd_accessidiLeveliCid) ) { 
        
console_printid"Flags: a - Chat | b - Team Chat | c - Voice communications" ); 
         
        return 
PLUGIN_HANDLED
    } 
     
    new 
szArg32 ]; 
    
read_argv1szArg31 ); 
     
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS ); 
     
    if( !
iPlayer 
        return 
PLUGIN_HANDLED
     
    new 
szName20 ]; 
    
get_user_nameiPlayerszName19 ); 
     
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ) { 
        
console_printid"User ^"%s^" is already gagged!"szName ); 
         
        return 
PLUGIN_HANDLED
    } 
     
    new 
szFlags], Float:flGagTime
    
read_argv2szArg31 ); 
     
    if( !
szArg] ) { // No time entered 
        
flGagTime DEFAULT_TIME
         
        
formatexszFlags3"abc" ); 
    } else { 
        if( 
is_str_numszArg ) ) { // Seconds entered 
            
flGagTime floatstrszArg ); 
             
            if( 
flGagTime 86400.0 
                
flGagTime 86400.0
        } else { 
            
console_printid"The value must be in seconds!" ); 
             
            return 
PLUGIN_HANDLED
        } 
         
        
read_argv3szArg31 ); 
         
        if( !
szArg] ) // No flag entered 
            
formatexszFlags3"abc" ); 
        else 
            
formatexszFlags3szArg ); 
    } 
     
    new 
iFlags read_flagsszFlags ); 
     
    new 
dataGagData ]; 
    
dataGAG_START ] = _:get_gametime( ); 
    
dataGAG_TIME ]  = _:flGagTime
    
dataGAG_FLAGS ] = iFlags
    
copydataGAG_AUTHID ], 19g_szAuthidiPlayer ] ); 
     
    
TrieSetCellg_tArrayPosg_szAuthidiPlayer ], g_iGagged ); 
    
ArrayPushArrayg_aGagDatadata ); 
     
    new 
szFrom64 ]; 
     
    if( 
iFlags GAG_CHAT 
        
formatexszFrom63"say" ); 
     
    if( 
iFlags GAG_TEAMSAY ) { 
        if( !
szFrom] ) 
            
formatexszFrom63"say_team" ); 
        else 
            
formatszFrom63"%s / say_team"szFrom ); 
    } 
     
    if( 
iFlags GAG_VOICE ) { 
        
set_speakiPlayerSPEAK_MUTED ); 
         
        if( !
szFrom] ) 
            
formatexszFrom63"voicecomm" ); 
        else 
            
formatszFrom63"%s / voicecomm"szFrom ); 
    } 
     
    
g_iGagged++; 
     
    new 
Float:flGametime get_gametime( ), Float:flNextThink
    
flNextThink entity_get_floatg_iThinkerEV_FL_nextthink ); 
     
    if( !
flNextThink || flNextThink > ( flGametime flGagTime ) ) 
        
entity_set_floatg_iThinkerEV_FL_nextthinkflGametime flGagTime ); 
     
    new 
szInfo32 ], szAdmin20 ], iTime floatroundflGagTime ), iMinutes iTime 60iSeconds iTime 60
    
get_user_nameidszAdmin19 ); 
     
    if( !
iMinutes 
        
formatexszInfo31"%i second%s"iSecondsiSeconds == "" "s" ); 
    else 
        
formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" ); 
     
    
show_activityidszAdmin"Has gagged %s from speaking for %s! (%s)"szNameszInfoszFrom ); 
     
    
console_printid"You have gagged ^"%s^" (%s) !"szNameszFrom ); 
     
    
log_amx"Gag: ^"%s<%s>^" has gagged ^"%s<%s>^" for %i minutes. (%s)"szAdming_szAuthidid ], szNameg_szAuthidiPlayer ], floatroundflGagTime 60 ), szFrom ); 
     
    return 
PLUGIN_HANDLED


public 
CmdUnGagPlayer( const id, const iLevel, const iCid ) { 
    if( !
cmd_accessidiLeveliCid) ) 
        return 
PLUGIN_HANDLED
     
    new 
szArg32 ]; 
    
read_argv1szArg31 ); 
     
    if( 
equaliszArg"@all" ) ) { 
        if( !
g_iGagged ) { 
            
console_printid"No gagged players!" ); 
             
            return 
PLUGIN_HANDLED
        } 
         
        while( 
g_iGagged DeleteGag); // Excellent by Exolent 
         
        
if( entity_get_floatg_iThinkerEV_FL_nextthink ) > 0.0 
            
entity_set_floatg_iThinkerEV_FL_nextthink0.0 ); 
         
        
console_printid"You have ungagged all players!" ); 
         
        new 
szAdmin32 ]; 
        
get_user_nameidszAdmin31 ); 
         
        
show_activityidszAdmin"Has ungagged all players." ); 
         
        
log_amx"UnGag: ^"%s<%s>^" has ungagged all players."szAdming_szAuthidid ] ); 
         
        return 
PLUGIN_HANDLED
    } 
     
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS ); 
     
    if( !
iPlayer 
        return 
PLUGIN_HANDLED
     
    new 
szName32 ]; 
    
get_user_nameiPlayerszName31 ); 
     
    new 
iArrayPos
    if( !
TrieGetCellg_tArrayPosg_szAuthidiPlayer ], iArrayPos ) ) { 
        
console_printid"User ^"%s^" is not gagged!"szName ); 
         
        return 
PLUGIN_HANDLED
    } 
     
    
DeleteGagiArrayPos ); 
     
    new 
szAdmin32 ]; 
    
get_user_nameidszAdmin31 ); 
     
    
show_activityidszAdmin"Has ungagged %s."szName ); 
     
    
console_printid"You have ungagged ^"%s^" !"szName ); 
     
    
log_amx"UnGag: ^"%s<%s>^" has ungagged ^"%s<%s>^""szAdming_szAuthidid ], szNameg_szAuthidiPlayer ] ); 
     
    return 
PLUGIN_HANDLED


public 
CmdGagMenu( const id, const iLevel, const iCid ) { 
    if( !
cmd_accessidiLeveliCid) ) 
        return 
PLUGIN_HANDLED
     
    
g_iMenuOptionid ] = 0
    
arraysetg_iMenuPlayersid ], 032 ); 
     
    
DisplayGagMenuidg_iMenuPositionid ] = ); 
     
    return 
PLUGIN_HANDLED


public 
ActionGagMenu( const id, const iKey ) { 
    switch( 
iKey ) { 
        case 
7: { 
            ++
g_iMenuOptionid ]; 
            
g_iMenuOptionid ] %= ArraySizeg_aGagTimes ); 
             
            
DisplayGagMenuidg_iMenuPositionid ] ); 
        } 
        case 
8DisplayGagMenuid, ++g_iMenuPositionid ] ); 
        case 
9DisplayGagMenuid, --g_iMenuPositionid ] ); 
        default: { 
            new 
iPlayer g_iMenuPlayersid ][ g_iMenuPositionid ] * iKey ]; 
             
            if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ) 
                
client_cmdid"amx_ungag #%i"get_user_useridiPlayer ) ); 
            else 
                
client_cmdid"amx_gag #%i %i"get_user_useridiPlayer ), ArrayGetCellg_aGagTimesg_iMenuOptionid ] ) ); 
             
            
DisplayGagMenuidg_iMenuPositionid ] ); 
        } 
    } 


// I just copied this from AMXX Ban menu, so don't blame me :D 
DisplayGagMenu( const idiPosition ) { 
    if( 
iPosition ) { 
        
arraysetg_iMenuPlayersid ], 032 ); 
         
        return; 
    } 
     
    new 
iPlayers32 ], iNumiCountszMenu512 ], iPlayeriFlagsszName32 ]; 
    
get_playersiPlayersiNum"ch" ); // Ignore bots and hltv 
     
    
new iStart iPosition 7
     
    if( 
iStart >= iNum 
        
iStart iPosition g_iMenuPositionid ] = 0
     
    new 
iEnd iStart 7iKeys MENU_KEY_0 MENU_KEY_8
    new 
iLen formatexszMenu511g_bColoredMenus "\rGag Menu\R%i/%i\w^n^n" "Gag Menu %i %i^n^n"iPosition 1, ( iNum + ( ( iNum ) ? ) ) ); 
     
    if( 
iEnd iNum iEnd iNum
     
    for( new 
iStartiEnd; ++) { 
        
iPlayer iPlayers]; 
        
iFlags  get_user_flagsiPlayer ); 
        
get_user_nameiPlayerszName31 ); 
         
        if( 
iPlayer != id && iFlags ADMIN_IMMUNITY ) { 
            ++
iCount
             
            if( 
g_bColoredMenus 
                
iLen += formatexszMenuiLen ], 511 iLen"\d%i. %s^n"iCountszName ); 
            else 
                
iLen += formatexszMenuiLen ], 511 iLen"#. %s^n"szName ); 
        } else { 
            
iKeys |= ( << iCount ); 
            ++
iCount
             
            
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "\r%i.\w %s\y%s\r%s^n" "%i. %s%s%s^n"iCountszNameTrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ? " GAGGED" "", ( ~iFlags ADMIN_USER " *" "" ) ); 
        } 
    } 
     
    
g_iMenuPlayersid ] = iPlayers
     
    new 
iSeconds ArrayGetCellg_aGagTimesg_iMenuOptionid ] ); 
    new 
iTime    iSeconds 60
     
    
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r8.\w Gag for\y %i\w %s^n" "^n8. Gag for %i %s^n", ( iSeconds 60 iTime iSeconds ), ( iSeconds 60 "minutes" "seconds" ) ); 
     
    if( 
iEnd != iNum ) { 
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r9.\w More...^n\r0.\w %s" "^n9. More...^n0. %s"iPosition "Back" "Exit" ); 
        
iKeys |= MENU_KEY_9
    } else 
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r0.\w %s" "^n0. %s"iPosition "Back" "Exit" ); 
     
    
show_menuidiKeysszMenu, -1"Gag Menu" ); 


CheckGagFlag( const id, const iFlag ) { 
    new 
iArrayPos
     
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) { 
        new 
dataGagData ]; 
        
ArrayGetArrayg_aGagDataiArrayPosdata ); 
         
        return ( 
dataGAG_FLAGS ] & iFlag ); 
    } 
     
    return 
0


DeleteGag( const iArrayPos ) { 
    new 
dataGagData ]; 
    
ArrayGetArrayg_aGagDataiArrayPosdata ); 
     
    if( 
dataGAG_FLAGS ] & GAG_VOICE ) { 
        new 
iPlayer find_player"c"dataGAG_AUTHID ] ); 
        if( 
is_user_connectediPlayer ) ) 
            
set_speakiPlayerSPEAK_NORMAL ); 
    } 
     
    
TrieDeleteKeyg_tArrayPosdataGAG_AUTHID ] ); 
    
ArrayDeleteItemg_aGagDataiArrayPos ); 
    
g_iGagged--; 
     
    for( new 
iArrayPosg_iGaggedi++ ) { 
        
ArrayGetArrayg_aGagDataidata ); 
        
TrieSetCellg_tArrayPosdataGAG_AUTHID ], ); 
    } 



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par } 
*/ 
[/b][/b][/b][/b][/i][/i][/i][/i][/i]


Cevap: .Sma Reklamı Kaldırırmısınız - Config Setting - 30-05-13

3 Tane Hata Veriyor .s Hocam Sana Zahmet Tekrar Yapıp notepadtan atarmısın bana tşk ederm


Cevap: .Sma Reklamı Kaldırırmısınız - t4t1fati - 30-05-13

PHP Code:
#include <amxmisc>
#include <engine>

#define PLUGIN "Menu Plugini"
#define VERSION "1.4"
#define AUTHOR "NiCoMeDiA"
#define SITE ""


#define DEFAULT_TIME 600.0 // In Seconds

enum ( <<= ) {
    
GAG_CHAT 1,
    
GAG_TEAMSAY,
    
GAG_VOICE
};

enum 
_:GagData {
    
GAG_AUTHID20 ],
    
GAG_TIME,
    
GAG_START,
    
GAG_FLAGS
};

new 
g_szAuthid33 ][ 20 ];
new 
g_iThinkerg_iGagged;
new 
bool:g_bColoredMenusTrie:g_tArrayPos, Array:g_aGagData, Array:g_aGagTimes;
new 
g_iMenuOption33 ], g_iMenuPosition33 ], g_iMenuPlayers33 ][ 32 ];

new 
g_menuPosition[33]
new 
g_menuSelect[33][64]
new 
g_menuUnBanType[33]
new 
g_menuUnBanLine[33][2]
new 
g_menuUnBanText[33][8][32]
new 
g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"}
new 
g_coloredMenus

new menucvar

public plugin_init()
{
    
menucvar register_cvar("menu_aktif","1")

    
register_clcmd("amx_unbanmenu","cmdUnBanMenu"ADMIN_BAN"- displays unban menu")
    
    
register_menucmd(register_menuid("UnBan STEAMID or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType")
    
register_menucmd(register_menuid("UnBan  Menu"),1023,"actionUnBanMenu")
    
    
g_coloredMenus colored_menus()

    
register_clcmd("say /menu","adminmenu");
    
register_clcmd("say !menu","adminmenu");
    
register_clcmd("say .menu","adminmenu");
    
register_clcmd("say menu","adminmenu");
    
    

    
register_clcmd"say",        "CmdSay" );
    
register_clcmd"say_team",   "CmdTeamSay" );
    
    
register_concmd"amx_gag",       "CmdGagPlayer",   ADMIN_KICK"<nick or #userid> <time> <a|b|c>" );
    
register_concmd"amx_ungag",     "CmdUnGagPlayer"ADMIN_KICK"<nick or #userid>" );
    
register_concmd"amx_gagmenu",   "CmdGagMenu",     ADMIN_KICK"- displays gag menu" );
    
register_srvcmd"amx_gag_times""CmdSetBanTimes" );
    
    
register_menucmdregister_menuid"Gag Menu" ), 1023"ActionGagMenu" );
    
register_messageget_user_msgid"SayText" ), "MessageSayText" );
    
    
g_tArrayPos TrieCreate( );
    
g_aGagData  ArrayCreateGagData );
    
g_aGagTimes ArrayCreate( );
    
g_bColoredMenus bool:colored_menus( );
    
    
// Gag times for the gag menu (amx_gagmenu)
    // Default values: 60 300 600 1800 3600 7200 86400
    
    // Load up standart times
    
ArrayPushCellg_aGagTimes60 );
    
ArrayPushCellg_aGagTimes300 );
    
ArrayPushCellg_aGagTimes600 );
    
ArrayPushCellg_aGagTimes1800 );
    
ArrayPushCellg_aGagTimes3600 );
    
ArrayPushCellg_aGagTimes7200 );
    
ArrayPushCellg_aGagTimes86400 );
    
    
// Set up entity-thinker
    
new const szClassname[ ] = "gag_thinker";
    
    
g_iThinker create_entity"info_target" );
    
entity_set_stringg_iThinkerEV_SZ_classnameszClassname );
    
    
register_thinkszClassname"FwdThink" );

}

public 
adminmenu(id)
{        
    if(
get_pcvar_num(menucvar) == 1)
    {
    new 
menu menu_create("\r[ ~ Admin Menu ~ ]""adminmenudevam")
    
    
menu_additem(menu"\w=> \yBan Menu \w<= \r( \dOyundan Atma \r)""1",ADMIN_BAN)
    
menu_additem(menu"\w=> \yKick Menu \w<= \r( \dOyundan Atma \r)""2",ADMIN_BAN)
    
menu_additem(menu"\w=> \yUnban Menu \w<= \r( \dOyundan Atilanlarin Cezalarini Kaldirma \r)""3",ADMIN_BAN)
    
menu_additem(menu"\w=> \ySlap Menu \w<= \r( \dTokatlama / Oldurme Menusu \r)""4",ADMIN_BAN)
    
menu_additem(menu"\w=> \yTeam Menu \w<= \r( \dTakim Degistirme Menusu \r)""5",ADMIN_BAN)
    
menu_additem(menu"\w=> \yGag Menu \w<= \r( \dSusturma Menusu \r)""6",ADMIN_BAN)
    
menu_additem(menu"\w=> \yRestart Game \w<= \r( \dOyunu Yeniden Baslat \r)""7",ADMIN_BAN)

    
menu_setprop(menuMPROP_NEXTNAME"Ileri");  
       
menu_setprop(menuMPROP_BACKNAME"Geri");
        
menu_setprop(menuMPROP_EXITNAME"Menuyu Kapat");
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    new 
admin_name[32]                
    
get_user_name(id admin_name 31 )
    
    
chat_color(0,"!t[ %s ] !y%s !g/menu !yYazarak Ozel !tAdmin Menusune !yGirdi.",SITE,admin_name)
        
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    }
}

public 
adminmenudevam(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1: { 
            
console_cmd(id,"amx_banmenu");
        }
        
        case 
2: { 
            
console_cmd(id,"amx_kickmenu");
        }
        
        case 
3: { 
            
console_cmd(id,"amx_unbanmenu");
        }
        
        case 
4: { 
            
console_cmd(id,"amx_slapmenu");
        }
        
        case 
5: { 
            
console_cmd(id,"amx_teammenu");
        }
        
        case 
6: { 
            
console_cmd(id,"amx_gagmenu");
            
        }
        
        case 
7: { 
            
console_cmd(id,"amx_cvar sv_restart 3");
        }
        
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}



//===============================UNBANMENU================================//

public actionUnBanMenu(id,key) {
    
    switch(
key) {
    case 
8: {
        
displayUnBanMenu(id, ++g_menuPosition[id])
    }
    case 
9: {
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][0] - (g_menuUnBanLine[id][1])
        if(
g_menuUnBanLine[id][0] < 0g_menuUnBanLine[id][0] = 0
        displayUnBanMenu
(id, --g_menuPosition[id])
    }
    default: {
        
        new 
name[32], authid[32], ipaddress[24]
        
get_user_authid(idauthid31)
        
get_user_name(idname31)
        
get_user_ip(idipaddress231)

        
log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^""name,get_user_userid(id),authid,ipaddress,g_menuUnBanText[id][key])

        switch (
get_cvar_num("amx_show_activity"))
        {
        
            case 
2client_print(0print_chat"ADMIN %s: unban %s"nameg_menuUnBanText[id][key])
            case 
1client_print(0print_chat"ADMIN: unban %s"g_menuUnBanText[id][key])
        }

        if(
g_menuUnBanType[id] == 1) {
        
server_cmd("removeip ^"%s^"; writeip"g_menuUnBanText[id][key])
        
server_exec()
        
console_print(id"IP ^"%s^" removed from ban list"g_menuUnBanText[id][key])
        }
        
        else {
            
        
server_cmd("removeid %s; writeid",  g_menuUnBanText[id][key])
        
console_print(id"Authid ^"%s^" removed from ban list",  g_menuUnBanText[id][key])
        }
    
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
        displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

checkSTEAMID(steamid[]) {
  
    new 
len strlen(steamid)
    if(
len 10 && equali(steamid"STEAM_"6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) {
        return 
1
    
}
    return 
0
}

checkIP(ip[]) {
    
    new 
len strlen(ip)
    new 
dots 00
    
while(isdigit(ip[i]) || ip=='.')
        if(
ip[i++] == '.')
            ++
dots
    
if(== len && dots == 3) {
        return 
1
    
}
    return 
0
}

displayUnBanMenu(id,pos) {
    if(
pos 0)
    return

    new 
menuBody[512]
    new 
0

    
new len format(menuBody511g_coloredMenus "\yBan Kaldir\R%d^n\w^n" "UnBan Menu %d^n^n"id"UNBAN_MENU"pos 1)
    
    new 
keys = (1<<9)
    new 
textlenline
    
new type g_menuUnBanType[id]
    new 
temp[32], banTime[32], disable

    
if(file_exists(g_bannedCfgFile[type])) {
        
line g_menuUnBanLine[id][0]
        while((
line read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen))) {
            
temp[0] = '^0'
            
banTime[0] = '^0'
            
g_menuUnBanText[id][b][0] = '^0'
            
disable 0
            
if(textlen 9)
                
disable 1
            
else if(parse(g_menuSelect[id], temp31banTime31g_menuUnBanText[id], 31) != 3)
                
disable 1
            
else if((type == && !checkIP(g_menuUnBanText[id])) || (type == && !checkSTEAMID(g_menuUnBanText[id])))
                
disable 1
            
if(disable == 0) {
                
keys |= (1<<b)
                if(
g_coloredMenus)
                
len += format(menuBody[len], 511-len"%d. %s\R\r%s^n\w"bg_menuUnBanText[id][b++], banTime)
                else
                
len += format(menuBody[len], 511-len"%d. %s   ( %s )^n"bg_menuUnBanText[id][b++], banTime)
            }
            else {
                if(
g_coloredMenus)
                    
len += format(menuBody[len], 511-len"\d%d. %s^n\w"bg_menuUnBanText[id][b++])
                else
                    
len += format(menuBody[len], 511-len"#. %s^n"bg_menuUnBanText[id][b++])
            }
            if(
== 8) break
        }

        if(
== && read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen) > 0) {
        
format(menuBody[len], 511-len"^n9. More...^n0. %s",idpos "Back" "Exit",id)
        
keys |= (1<<8)
        }
        else
        
format(menuBody[len], 511-len"^n0. %s"pos "Back" "Exit",id)

        
g_menuUnBanLine[id][1] = line g_menuUnBanLine[id][0]
        
g_menuUnBanLine[id][0] = line
        show_menu
(idkeysmenuBody, -1"UnBan  Menu")
    }

    return
}

public 
actionUnBanMenuType(id,key) {
    
    switch(
key) {
        case 
9: return PLUGIN_HANDLED
        
default: {
            
g_menuUnBanType[id] = key // 0 = STEAMID, 1 = IP
            
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
            displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

displayUnBanMenuType(id) {
    
    new 
menuBody[512]
  
    new 
len format(menuBody511g_coloredMenus ?  "\rBanned \yKaldirma Turu?^n\w^n" :"UnBan STEAMID or IP?^n^n",id)

    new 
keys = (1<<0)|(1<<1)|(1<<9)

    
len += format(menuBody[len], 511-len"1. \rSinirsiz \yBanlari Kaldir^n",id)
    
len += format(menuBody[len], 511-len"\w2. \rNormal \yBanlari Kaldir^n",id)
    
format(menuBody[len], 511-len"^n\w0. \rExit",id)

    
show_menu(idkeysmenuBody, -1"UnBan STEAMID or IP?")
}

public 
cmdUnBanMenu(id,level,cid) {
    
    if(!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED

    g_menuUnBanType
[id] = -1
    displayUnBanMenuType
(id)
    return 
PLUGIN_HANDLED
}

stock chat_color(const id, const input[], any:...) {
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
replace_all(msg190"!team2""^0")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players)
                
write_byte(players);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

//======================================GAGMENU=====================================//

public CmdSetBanTimes( ) {
    new 
iArgs read_argc( );
    
    if( 
iArgs <= ) {
        
server_print"Usage: amx_gag_times <time1> [time2] [time3] ..." );
        
        return;
    }
    
    
ArrayClearg_aGagTimes );
    
    new 
szBuffer32 ], iTime;
    for( new 
1iArgsi++ ) {
        
read_argviszBuffer31 );
        
        
iTime str_to_numszBuffer );
        
        if( 
iTime 86400 ) {
            
server_print"[AMXX GAG] Time more then 86400 is not allowed!" );
            
            continue;
        }
        
        
ArrayPushCellg_aGagTimesiTime );
    }
}

public 
plugin_end( ) {
    
TrieDestroyg_tArrayPos );
    
ArrayDestroyg_aGagData );
    
ArrayDestroyg_aGagTimes );
}

public 
client_putinserverid )
    if( 
CheckGagFlagidGAG_VOICE ) )
        
set_speakidSPEAK_MUTED );

public 
client_authorizedid )
    
get_user_authididg_szAuthidid ], 19 );

public 
client_disconnectid ) {
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidid ] ) ) {
        new 
szName32 ];
        
get_user_nameidszName31 );
        
        new 
iPlayers32 ], iNumiPlayer;
        
get_playersiPlayersiNum"ch" );
        
        for( new 
iiNumi++ ) {
            
iPlayer iPlayers];
            
            if( 
get_user_flagsiPlayer ) & ADMIN_KICK )
                
client_printiPlayerprint_chat"[AMXX] Gagged player ^"%s<%s>^" has disconnected!"szNameg_szAuthidid ] );
        }
    }
    
    
g_szAuthidid ][ ] = '^0';
}

public 
client_infochangedid ) {
    if( !
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
        return;
    
    static const 
name[ ] = "name";
    
    static 
szNewName32 ], szOldName32 ];
    
get_user_infoidnameszNewName31 );
    
get_user_nameidszOldName31 );
    
    if( !
equalszNewNameszOldName ) ) {
        
client_printidprint_chat"[AMXX] Gagged players cannot change their names!" );
        
        
set_user_infoidnameszOldName );
    }
}

public 
MessageSayText( ) {
    static const 
Cstrike_Name_Change[ ] = "#Cstrike_Name_Change";
    
    new 
szMessagesizeofCstrike_Name_Change ) + ];
    
get_msg_arg_string2szMessagesizeofszMessage ) - );
    
    if( 
equalszMessageCstrike_Name_Change ) ) {
        new 
szName32 ], id;
        for( new 
3<= 4i++ ) {
            
get_msg_arg_stringiszName31 );
            
            
id get_user_indexszName );
            
            if( 
is_user_connectedid ) ) {
                if( 
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
                    return 
PLUGIN_HANDLED;
                
                break;
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdThink( const iEntity ) {
    if( !
g_iGagged )
        return;
    
    new 
Float:fGametime;
    
fGametime get_gametime( );
    
    new 
dataGagData ], idszName32 ];
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        if( ( 
Float:dataGAG_START ] + Float:dataGAG_TIME ] - 0.5 ) <= fGametime ) {
            
id find_player"c"dataGAG_AUTHID ] );
            
            if( 
is_user_connectedid ) ) {
                
get_user_nameidszName31 );
                
                
client_print0print_chat"[AMXX] Player ^"%s^" is no longer gagged."szName );
            }
            
            
DeleteGag);
            
            
i--;
        }
    }
    
    if( !
g_iGagged )
        return;
    
    new 
Float:flNextTime 999999.9;
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        
flNextTime floatminflNextTimeFloat:dataGAG_START ] + Float:dataGAG_TIME ] );
    }
    
    
entity_set_floatiEntityEV_FL_nextthinkflNextTime );
}

public 
CmdSay( const id )
    return 
CheckSayid);

public 
CmdTeamSay( const id )
    return 
CheckSayid);

CheckSay( const id, const bTeam ) {
    new 
iArrayPos;
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        new 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        new const 
iFlags[ ] = { GAG_CHATGAG_TEAMSAY };
        
        if( 
dataGAG_FLAGS ] & iFlagsbTeam ] ) {
            new 
szInfo32 ], iLeniTime floatround( ( Float:dataGAG_START ] + Float:dataGAG_TIME ] ) - get_gametime( ) ), iMinutes iTime 60iSeconds iTime 60;
            
            if( 
iMinutes )
                
iLen formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
            if( 
iSeconds )
                
formatexszInfoiLen ], 31 iLen"%s%i second%s"iLen " and " ""iSecondsiSeconds == "" "s" );
            
            
client_printidprint_chat"[AMXX] %s left before your ungag!"szInfo );
            
client_printidprint_center"** You are gagged from%s chat! **"bTeam " team" "" );
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
CmdGagPlayer( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) ) {
        
console_printid"Flags: a - Chat | b - Team Chat | c - Voice communications" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName20 ];
    
get_user_nameiPlayerszName19 );
    
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ) {
        
console_printid"User ^"%s^" is already gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFlags], Float:flGagTime;
    
read_argv2szArg31 );
    
    if( !
szArg] ) { // No time entered
        
flGagTime DEFAULT_TIME;
        
        
formatexszFlags3"abc" );
    } else {
        if( 
is_str_numszArg ) ) { // Seconds entered
            
flGagTime floatstrszArg );
            
            if( 
flGagTime 86400.0 )
                
flGagTime 86400.0;
        } else {
            
console_printid"The value must be in seconds!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        
read_argv3szArg31 );
        
        if( !
szArg] ) // No flag entered
            
formatexszFlags3"abc" );
        else
            
formatexszFlags3szArg );
    }
    
    new 
iFlags read_flagsszFlags );
    
    new 
dataGagData ];
    
dataGAG_START ] = _:get_gametime( );
    
dataGAG_TIME ]  = _:flGagTime;
    
dataGAG_FLAGS ] = iFlags;
    
copydataGAG_AUTHID ], 19g_szAuthidiPlayer ] );
    
    
TrieSetCellg_tArrayPosg_szAuthidiPlayer ], g_iGagged );
    
ArrayPushArrayg_aGagDatadata );
    
    new 
szFrom64 ];
    
    if( 
iFlags GAG_CHAT )
        
formatexszFrom63"say" );
    
    if( 
iFlags GAG_TEAMSAY ) {
        if( !
szFrom] )
            
formatexszFrom63"say_team" );
        else
            
formatszFrom63"%s / say_team"szFrom );
    }
    
    if( 
iFlags GAG_VOICE ) {
        
set_speakiPlayerSPEAK_MUTED );
        
        if( !
szFrom] )
            
formatexszFrom63"voicecomm" );
        else
            
formatszFrom63"%s / voicecomm"szFrom );
    }
    
    
g_iGagged++;
    
    new 
Float:flGametime get_gametime( ), Float:flNextThink;
    
flNextThink entity_get_floatg_iThinkerEV_FL_nextthink );
    
    if( !
flNextThink || flNextThink > ( flGametime flGagTime ) )
        
entity_set_floatg_iThinkerEV_FL_nextthinkflGametime flGagTime );
    
    new 
szInfo32 ], szAdmin20 ], iTime floatroundflGagTime ), iMinutes iTime 60iSeconds iTime 60;
    
get_user_nameidszAdmin19 );
    
    if( !
iMinutes )
        
formatexszInfo31"%i second%s"iSecondsiSeconds == "" "s" );
    else
        
formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
    
    
show_activityidszAdmin"Has gagged %s from speaking for %s! (%s)"szNameszInfoszFrom );
    
    
console_printid"You have gagged ^"%s^" (%s) !"szNameszFrom );
    
    
log_amx"Gag: ^"%s<%s>^" has gagged ^"%s<%s>^" for %i minutes. (%s)"szAdming_szAuthidid ], szNameg_szAuthidiPlayer ], floatroundflGagTime 60 ), szFrom );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdUnGagPlayer( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) )
        return 
PLUGIN_HANDLED;
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    if( 
equaliszArg"@all" ) ) {
        if( !
g_iGagged ) {
            
console_printid"No gagged players!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        while( 
g_iGagged DeleteGag); // Excellent by Exolent
        
        
if( entity_get_floatg_iThinkerEV_FL_nextthink ) > 0.0 )
            
entity_set_floatg_iThinkerEV_FL_nextthink0.0 );
        
        
console_printid"You have ungagged all players!" );
        
        new 
szAdmin32 ];
        
get_user_nameidszAdmin31 );
        
        
show_activityidszAdmin"Has ungagged all players." );
        
        
log_amx"UnGag: ^"%s<%s>^" has ungagged all players."szAdming_szAuthidid ] );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName32 ];
    
get_user_nameiPlayerszName31 );
    
    new 
iArrayPos;
    if( !
TrieGetCellg_tArrayPosg_szAuthidiPlayer ], iArrayPos ) ) {
        
console_printid"User ^"%s^" is not gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    
DeleteGagiArrayPos );
    
    new 
szAdmin32 ];
    
get_user_nameidszAdmin31 );
    
    
show_activityidszAdmin"Has ungagged %s."szName );
    
    
console_printid"You have ungagged ^"%s^" !"szName );
    
    
log_amx"UnGag: ^"%s<%s>^" has ungagged ^"%s<%s>^""szAdming_szAuthidid ], szNameg_szAuthidiPlayer ] );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdGagMenu( const id, const iLevel, const iCid ) {
    if( !
cmd_accessidiLeveliCid) )
        return 
PLUGIN_HANDLED;
    
    
g_iMenuOptionid ] = 0;
    
arraysetg_iMenuPlayersid ], 032 );
    
    
DisplayGagMenuidg_iMenuPositionid ] = );
    
    return 
PLUGIN_HANDLED;
}

public 
ActionGagMenu( const id, const iKey ) {
    switch( 
iKey ) {
        case 
7: {
            ++
g_iMenuOptionid ];
            
g_iMenuOptionid ] %= ArraySizeg_aGagTimes );
            
            
DisplayGagMenuidg_iMenuPositionid ] );
        }
        case 
8DisplayGagMenuid, ++g_iMenuPositionid ] );
        case 
9DisplayGagMenuid, --g_iMenuPositionid ] );
        default: {
            new 
iPlayer g_iMenuPlayersid ][ g_iMenuPositionid ] * iKey ];
            
            if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) )
                
client_cmdid"amx_ungag #%i"get_user_useridiPlayer ) );
            else
                
client_cmdid"amx_gag #%i %i"get_user_useridiPlayer ), ArrayGetCellg_aGagTimesg_iMenuOptionid ] ) );
            
            
DisplayGagMenuidg_iMenuPositionid ] );
        }
    }
}

// I just copied this from AMXX Ban menu, so don't blame me :D
DisplayGagMenu( const idiPosition ) {
    if( 
iPosition ) {
        
arraysetg_iMenuPlayersid ], 032 );
        
        return;
    }
    
    new 
iPlayers32 ], iNumiCountszMenu512 ], iPlayeriFlagsszName32 ];
    
get_playersiPlayersiNum"ch" ); // Ignore bots and hltv
    
    
new iStart iPosition 7;
    
    if( 
iStart >= iNum )
        
iStart iPosition g_iMenuPositionid ] = 0;
    
    new 
iEnd iStart 7iKeys MENU_KEY_0 MENU_KEY_8;
    new 
iLen formatexszMenu511g_bColoredMenus "\rGag Menu\R%i/%i\w^n^n" "Gag Menu %i %i^n^n"iPosition 1, ( iNum + ( ( iNum ) ? ) ) );
    
    if( 
iEnd iNum iEnd iNum;
    
    for( new 
iStartiEnd; ++) {
        
iPlayer iPlayers];
        
iFlags  get_user_flagsiPlayer );
        
get_user_nameiPlayerszName31 );
        
        if( 
iPlayer != id && iFlags ADMIN_IMMUNITY ) {
            ++
iCount;
            
            if( 
g_bColoredMenus )
                
iLen += formatexszMenuiLen ], 511 iLen"\d%i. %s^n"iCountszName );
            else
                
iLen += formatexszMenuiLen ], 511 iLen"#. %s^n"szName );
        } else {
            
iKeys |= ( << iCount );
            ++
iCount;
            
            
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "\r%i.\w %s\y%s\r%s^n" "%i. %s%s%s^n"iCountszNameTrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ? " GAGGED" "", ( ~iFlags ADMIN_USER " *" "" ) );
        }
    }
    
    
g_iMenuPlayersid ] = iPlayers;
    
    new 
iSeconds ArrayGetCellg_aGagTimesg_iMenuOptionid ] );
    new 
iTime    iSeconds 60;
    
    
iLen += formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r8.\w Gag for\y %i\w %s^n" "^n8. Gag for %i %s^n", ( iSeconds 60 iTime iSeconds ), ( iSeconds 60 "minutes" "seconds" ) );
    
    if( 
iEnd != iNum ) {
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r9.\w More...^n\r0.\w %s" "^n9. More...^n0. %s"iPosition "Back" "Exit" );
        
iKeys |= MENU_KEY_9;
    } else
        
formatexszMenuiLen ], 511 iLeng_bColoredMenus "^n\r0.\w %s" "^n0. %s"iPosition "Back" "Exit" );
    
    
show_menuidiKeysszMenu, -1"Gag Menu" );
}

CheckGagFlag( const id, const iFlag ) {
    new 
iArrayPos;
    
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        new 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        return ( 
dataGAG_FLAGS ] & iFlag );
    }
    
    return 
0;
}

DeleteGag( const iArrayPos ) {
    new 
dataGagData ];
    
ArrayGetArrayg_aGagDataiArrayPosdata );
    
    if( 
dataGAG_FLAGS ] & GAG_VOICE ) {
        new 
iPlayer find_player"c"dataGAG_AUTHID ] );
        if( 
is_user_connectediPlayer ) )
            
set_speakiPlayerSPEAK_NORMAL );
    }
    
    
TrieDeleteKeyg_tArrayPosdataGAG_AUTHID ] );
    
ArrayDeleteItemg_aGagDataiArrayPos );
    
g_iGagged--;
    
    for( new 
iArrayPosg_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
TrieSetCellg_tArrayPosdataGAG_AUTHID ], );
    }
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
[/b][/b][/b][/b][/i][/i][/i][/i][/i]


Cevap: .Sma Reklamı Kaldırırmısınız - Config Setting - 30-05-13

/tmp/textuqlV9n.sma(111) : warning 217: loose indentation
/tmp/textuqlV9n.sma(112) : warning 217: loose indentation
/tmp/textuqlV9n.sma(115) : warning 217: loose indentation
Header size: 2488 bytes
Code size: 32648 bytes
Data size: 64976 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 116496 bytes

3 Warnings.
Done.

Hata Hala Devam Ediyor ?s


Cevap: .Sma Reklamı Kaldırırmısınız - akcaliberkk - 31-05-13

Hatanın sebebi, buraya yapıştırılan kodların indentation'unun bozulması. Dolayısıyla senin compile etmeden önce studioda CTRL+I yapman gerekiyor. Eğer studion yoksa ben sma'yı ek olarak paylaşıyorum. O sma'yı kullanırsan hiç hata almazsın.

Sma ekte.


Dipnot: Son 2 mesajı ben sildim. Sayfa kasmaya başlamıştı Smile

Konu çözüldüğünden ekteki sma kaldırıldı.


Cevap: .Sma Reklamı Kaldırırmısınız - Config Setting - 31-05-13

Studiom Var Hocam Dediğini Yaptım Sorun Gitti Tşk


Cevap: .Sma Reklamı Kaldırırmısınız - akcaliberkk - 31-05-13

Çözülmüş İsteklere taşındı.