⭐🚀 TkyNET | Blacklist ve Profesyonel DDoS Korumalı TeamSpeak 3 Sunucuları 🚀⭐
Sponsor Görsel
⭐Kurumsal web sitesi barındırma, VDS ve sanal sunucu çözümleri. Name SSD altyapısı, yüksek performans, kesintisiz erişim ve profesyonel teknik destekle hizmetinizde.⭐
Sponsor Görsel 2
SponsorSponsor

Konu

#11
(24-02-2024, 14:40)Lynchk Adlı Kullanıcıdan Alıntı: Bu şekilde dener misin ?
PHP Kod:
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < regex >
#include < orpheu >
#include < orpheu_stocks >
#include < xs >

//#define DKNIFE_DUEL
//#define TEAM_PLUGIN          // if you have teamprotection plugin
// #define SQL                  // if you want to have a ranking system through sql


#define ADMIN_FLAG          ADMIN_LEVEL_A
#define PREFIX              "^3[RUSH]^1"
#define SLAY_PLAYERS_TIME  9.0
#define MAX_ZONES          4

#if defined SQL
    #include < sqlx >
#endif

#if defined TEAM_PLUGIN
    /** 
    * Pauses/Unpauses teams
    * 
    * @note    teams don't get removed. You will show as team.
    *
    * @param id        player1 id.
    * @param id2        player2 id.
    * @param unpause    if to unpause teams  
    */
    native kf_pause_teaming(idid2unpause 0);
#endif

#define set_bit(%1,%2)      (%1 |= (1<<(%2&31)))
#define clear_bit(%1,%2)    (%1 &= ~(1<<(%2&31)))
#define check_bit(%1,%2)    (%1 & (1<<(%2&31)))

new const VERSION[] = "2.0.6";

new const 
SPRITE_BEAM[] = "sprites/laserbeam.spr";

#if defined SQL
    new const host[] = "127.0.0.1";
    new const user[] = "root";
    new const pass[] = "";
    new const db[]  "mysql_dust";

    new Handle:tuple;
    new bool:bResetRanks;

    enum _:eRankData
    
{
        P_ADDED,
        P_DUELS,
        P_WON,
        P_DRAW,
        P_LOST,
        P_WONSLASH,
        P_WONSTAB,
        P_WONBOTH
    
}
    new g_SqlInfo33 ][ eRankData ];
    new Float:fCheckRank33 ];

    #define COOLDOWN    10.0
#endif

#if AMXX_VERSION_NUM < 183
    set_fail_state"Plugin requires 1.8.3 or higher." );
#endif

enum _:eLastData
{
    IPLAYER1 0,
    IPLAYER2,
    IROUND1,
    IROUND2,
    IWINNER,
    IREASON,
    IPOS,
    IZONE,
    ITYPE
}

enum
{
    TOTAL 2,
    FAKE  3
}

enum _:eEndRushReason
{
    NONE 0,
    FAKE_ROUNDS,
    TIME_END,
    PLAYER_STOP,
    PLAYER_DISCONNECTED
}

enum _:TASKS ( += 1000 )
{
    TASK_DRAW 141,
    TASK_COUNTDOWN,
    TASK_AUTOKILL,
    TASK_RESTART,
    TASK_REVIVE
}

enum _:attType
{
    SLASH  0,
    STAB    1,
    BOTH    2
}

enum _:rushData
{
    PLAYER1,
    PLAYER2,
    RUSHTYPE
}

enum _:eWin
{
    WON 0,
    LOST,
    DRAW
}

new 
hasDisabledRush;
new 
hasBlockedMAX_PLAYERS ];
new 
bool:canRush;
new 
rushDir128 ];
new 
activeZones;
new 
busyZones;

new 
bHasTouch;
new 
bIsInRushbCanRun;
new 
g_RushInfoMAX_ZONES ][ rushData ]; 
new 
g_RoundsMAX_ZONES ][ ];

new 
Float:g_HealthCacheMAX_ZONES ][ ];
new 
bIsZoneBusy;

new 
beam;
new 
editoredit_zone;

new 
Float:g_vecOriginMAX_ZONES ][ ][ ];
new 
Float:g_Velocity MAX_ZONES ][ ][ ];
new 
Float:g_Position MAX_ZONES ][ ][ ];
new const 
DisableAccess = ( << 26 );

new 
HamHook:PostKilled;
new 
HamHook:PreKilled;
new 
HamHook:PlayerTouch;
new 
HamHook:PlayerSpawnPost;
//new HamHook:PlayerThink; // for some reason this doesn't work, so imma use fakemeta
new PlayerThink;

new 
OrpheuStruct:ppmove;

new 
Float:pHealthattType ];
new 
pRounds;
new 
pAlive;
new 
pSavePos;
new 
pSaveHealth;
new 
pFakeRounds;

public 
plugin_init()
{
    register_plugin"Rush Duel"VERSION"DusT" );

    register_cvar"AmX_DusT""Rush_Duel"FCVAR_SPONLY FCVAR_SERVER );

    register_clcmd"amx_rush_menu""AdminRush"ADMIN_FLAG );

    register_clcmd"say /rush""CmdRush" );
    register_clcmd"say /stop""CmdStopDuel" );

    bind_pcvar_floatcreate_cvar"rush_health_slash""1"  ), Float:pHealthSLASH ] );
    bind_pcvar_floatcreate_cvar"rush_health_stab",  "35" ), Float:pHealthSTAB ]  );
    bind_pcvar_floatcreate_cvar"rush_health_both",  "35" ), Float:pHealthBOTH ]  );
    
    bind_pcvar_num
create_cvar"rush_save_health""1" ), pSaveHealth );
    bind_pcvar_numcreate_cvar"rush_save_pos""0" ), pSavePos );
    bind_pcvar_numcreate_cvar"rush_rounds""10"  ), pRounds  );
    bind_pcvar_numcreate_cvar"rush_fake_rounds""3"  ), pFakeRounds );
    /*
        Explanation rush_alive:
            - 0: revives who made most kills. In case of draw, both revive.
            - 1: revives who made most kills. In case of draw, both dead.
            - 2: revives who killed the player on last round. 
            - 3: both revive.
    */
    bind_pcvar_numcreate_cvar"rush_alive""0", .description="Info on github.com/amxDust/RushDuel-amxx"), pAlive );

    DisableHamForwardPostKilled  RegisterHamPlayerHam_Killed"fw_PlayerKilled_Post") ); 
    DisableHamForwardPreKilled  RegisterHamPlayerHam_Killed"fw_PlayerKilled_Pre",  0 ) ); 
    //DisableHamForward( PlayerThink = RegisterHamPlayer( Ham_Think,  "fw_PlayerThink_Pre",  0 ) );
    DisableHamForwardPlayerTouch RegisterHamPlayerHam_Touch,  "fw_PlayerTouch" ) );
    DisableHamForwardPlayerSpawnPost  RegisterHamPlayerHam_Spawn,  "fw_PlayerSpawn_Post",  1 ) );

    register_logevent"RoundStart"2"1=Round_Start" );
    register_logevent"RoundEnd"  2"1=Round_End"  );

    OrpheuRegisterHookOrpheuGetFunction"PM_Duck" ), "OnPM_Duck" );
    OrpheuRegisterHookOrpheuGetFunction"PM_Jump" ), "OnPM_Jump" );
    OrpheuRegisterHookOrpheuGetDLLFunction"pfnPM_Move""PM_Move" ), "OnPM_Move" );

    activeZones CountZones();

    #if defined SQL
        tuple SQL_MakeDbTuplehostuserpassdb );

        register_concmd"amx_rush_reset""CmdRushReset"ADMIN_FLAG );
        register_clcmd"say /rrank""CmdGetRank" );
        register_clcmd"say /rstats""CmdGetRankStats" );
        register_clcmd"say /rtop""CmdGetTop" );
    #endif
}

public 
plugin_precache()
{
    beam precache_modelSPRITE_BEAM );
}

public 
client_disconnectedid )
{
    if( task_existsid TASK_REVIVE ) )
        remove_taskid TASK_REVIVE );
    
    
if( check_bitbIsInRushid ) )
        StopDuelPreGetZoneid ), PLAYER_DISCONNECTEDid );
    
    hasBlocked
id ] = 0;

    if( check_bithasDisabledRushid ) )
        clear_bithasDisabledRushid );

    #if defined SQL
        arraysetg_SqlInfoid ], 0eRankData );
        fCheckRankid ] = 0.0;
    #endif
}

public 
RoundStart()
{
    set_task2.0"AllowRush" );
}

public 
AllowRush()
{
    canRush true;
}

public 
RoundEnd()
{
    canRush false;
}

public 
AdminRushidlevelcid )
{
    if( !cmd_accessidlevelcid) )
        return PLUGIN_HANDLED;
    
    AdminRushMenu
id );
    
    
return PLUGIN_HANDLED;
}

AdminRushMenuid )
{
    new menuid menu_createfmt"\rRush Menu^n\yAdmin Menu^n^nCurrent Active Zones: %d"activeZones ), "AdminRushHandler" );
    
    menu_additem
menuid"Create New Zone"_activeZones >= MAX_ZONESDisableAccess:);

    menu_additemmenuid"Edit Existing Zone"_activeZones <= 0DisableAccess:);

    menu_displayidmenuid );

    return PLUGIN_HANDLED;
}

public 
AdminRushHandleridmenuiditem )
{
    if( is_user_connectedid ) && item != MENU_EXIT )
    {
        switch( item )
        {
            case 0EditZoneidactiveZones++ );
            
            
case 1EditZoneMenuid );
        }
    }

    menu_destroymenuid );
    return PLUGIN_HANDLED;


public 
CmdStopDuelid )
{
    if( check_bitbIsInRushid ) )
        StopDuelPreGetZoneid ), PLAYER_STOPid );
}

public 
CmdRushid )
{
    new menuid menu_create"Rush Menu""CmdRushHandler" );

    menu_additemmenuid"Rush" );
    menu_additemmenuid"Block Player" );

    menu_additemmenuidcheck_bithasDisabledRushid )? "ENABLE Requests":"DISABLE Requests" );

    menu_displayidmenuid );

    return PLUGIN_HANDLED;
}

public 
CmdRushHandleridmenuiditem )
{
    if( is_user_connectedid ) && item != MENU_EXIT )
    {
        switch( item 
        {
            case 0:
            {
                RushMenuid );
            }
            case 1:
            {
                BlockMenuid );
            }
            case 2:
            {
                if( check_bithasDisabledRushid ) )
                    clear_bithasDisabledRushid );
                else
                    set_bithasDisabledRushid );
                
                CmdRush
id );
            }
        }
    }

    menu_destroymenuid );
    return PLUGIN_HANDLED;
}

BlockMenuid )
{
    new players32 ], iNum;

    get_playersplayersiNum );
    
    
new menuid menu_create"Block Menu""BlockMenuHandler" );
    new buff];
    // using "e" flag on get_players doesn't work always fine.
    for( new iiNumi++ )
    {                                                                                                          //spectator
        if( id == players] || get_user_teamid ) == get_user_teamplayers] ) || get_user_teamplayers] ) == )
            continue;

        buff] = players];
        buff] = 0;
        menu_additemmenuidfmt"%n%s"buff], check_bithasBlockedid ], buff] )? " [UNBLOCK]":"" ), buff );
    

    menu_displayidmenuid );
}

public 
BlockMenuHandleridmenuiditem )
{
    if( is_user_connectedid ) && item != MENU_EXIT )
    {
        new buff]
        menu_item_getinfomenuiditem_buffcharsmaxbuff ) );
        
        
if( is_user_connectedbuff] ) )
        {
            if( check_bithasBlockedid ], buff] ) )
                clear_bithasBlockedid ], buff] );
            else
                set_bithasBlockedid ], buff] );
        }

        BlockMenuid );
    }
    
    menu_destroy
menuid );
    return PLUGIN_HANDLED;
}

public 
RushMenuid )
{
    if( !CanPlayerRushid ) )
        return PLUGIN_HANDLED;
    
    
new players32 ], num;

    get_playersplayersnum"ach" );
    
    
new menuid menu_create"\rRush Menu^n\yChoose a Player""RushMenuHandler" );
    new bool:hasPlayersbuff];
    for( new inumi++ )
    {
        if( id == players] || get_user_teamid ) == get_user_teamplayers] ) || get_user_teamplayers] ) == || check_bitbIsInRushplayers] ) )
            continue;

        if( check_bithasBlockedplayers] ], id ) || check_bithasDisabledRushplayers] ) )
            continue;

        buff] = players];
        buff] = 0;

        if( !hasPlayers )
            hasPlayers true;

        menu_additemmenuidfmt"%n"buff] ), buff );
    }
    if( !hasPlayers )
    {
        client_print_coloridprint_team_red"%s There are no players to rush with!"PREFIX );
        return PLUGIN_HANDLED;
    }

    menu_displayidmenuid );
    return PLUGIN_HANDLED;
}

public 
RushMenuHandleridmenuiditem )
{
    if( CanPlayerRushid ) && item != MENU_EXIT )
    {
        new buff]
        menu_item_getinfomenuiditem_buffcharsmaxbuff ) );

        if( CanPlayerRushidtruebuff] ) )
        {
            new menuid2 menu_create"Choose Rush Type""RushTypeHandler" );
            menu_additemmenuid2"Only Slash ( R1 )"buff );
            menu_additemmenuid2"Only Stab  ( R2 )" );
            menu_additemmenuid2"Both ( R1 and R2 )" );

            menu_displayidmenuid2 );
        }
    }

    menu_destroymenuid );
    return PLUGIN_HANDLED;
}

public 
RushTypeHandleridmenuiditem )
{
    if( CanPlayerRushid ) && item != MENU_EXIT )
    {
        new buff];
        menu_item_getinfomenuid0_buffcharsmaxbuff ) );

        if( CanPlayerRushidtruebuff] ) )
        {
            new menuid2 menu_createfmt"\y'%n' wants to rush %s with you!^nAccept?"iditem == 0"only SLASH(R1)":item == 1"only STAB(R2)":"(R1 and R2)" ), "SendChallengeHandler" );
            new buffer];
            buffer] = id;
            buffer] = item;
            buffer] = 0;
            menu_additemmenuid2"Accept"buffer );
            menu_additemmenuid2"Refuse" );

            menu_displaybuff], menuid2_10 );
        }
    }

    menu_destroymenuid );
    return PLUGIN_HANDLED;
}

public 
SendChallengeHandleridmenuiditem )
{
    if( CanPlayerRushid false ) && item == )
    {
        new buff];
        menu_item_getinfomenuid0_buffcharsmaxbuff ) );
        if( CanPlayerRushidtruebuff] ) )
        {
            client_print_coloridprint_team_red"%s You accepted %n's challenge."PREFIXbuff] );
            client_print_coloridprint_team_red"%s %n accepted your challenge."PREFIXid );
            GetReadybuff], idbuff] );
        }
    }
    menu_destroymenuid );
    return PLUGIN_HANDLED;
}

GetReadyidpidtype )
{
    new i;
    for( 0activeZonesi++ )
    {
        if( !check_bitbIsZoneBusy) )
            break;
        
        
if( == activeZones )
        {
            client_print_coloridprint_team_red"%s There are no free zones to play. Retry later."PREFIX );
            return;
        }
    }

    #if defined TEAM_PLUGIN
        kf_pause_teamingidpid );
    #endif

    g_RushInfo][ PLAYER1 ]  id;
    g_RushInfo][ PLAYER2 ]  pid;
    g_RushInfo][ RUSHTYPE ] = type;
    
    g_Rounds
][ PLAYER1 ] = 0;
    g_Rounds][ PLAYER2 ] = 0;
    g_Rounds][ TOTAL ]  1;
    g_Rounds][ FAKE ]    0;
    set_bitbIsInRushid );
    set_bitbIsInRushpid );

    if( !busyZones )
        ToggleFwdstrue );

    set_bitbIsZoneBusy);
    busyZones++;
    if( pSaveHealth )
    {
        pevid,  pev_healthg_HealthCache][ PLAYER1 ] );
        pevpidpev_healthg_HealthCache][ PLAYER2 ] );
    }
    
    set_pev
id,  pev_healthpHealthtype ] );
    set_pevpidpev_healthpHealthtype ] );
    
    
if( pSavePos )
    {
        pevid,  pev_origing_Position][ PLAYER1 ] );
        pevpidpev_origing_Position][ PLAYER2 ] );
    }
    
    TeleportPlayer
id,  iPLAYER1 );
    TeleportPlayerpidiPLAYER2 );

    LookAtOriginid,  g_vecOrigin][ PLAYER2 ] );
    LookAtOriginpidg_vecOrigin][ PLAYER1 ] );

    new params];
    params] = 3
    set_task1.2"CountDown"TASK_COUNTDOWN iparams); 
    set_taskSLAY_PLAYERS_TIME"SlayPlayers"TASK_AUTOKILL );

}

public 
ReviveDeadid )
{
    id -= TASK_REVIVE;
    
    ExecuteHamB
Ham_CS_RoundRespawnid );
}

// unfinished__
public ContinueRoundszone )
{
    zone -= TASK_RESTART;

    TeleportPlayerg_RushInfozone ][ PLAYER1 ], zonePLAYER1 );
    TeleportPlayerg_RushInfozone ][ PLAYER2 ], zonePLAYER2 );

    LookAtOriging_RushInfozone ][ PLAYER1 ], g_vecOriginzone ][ PLAYER2 ] );
    LookAtOriging_RushInfozone ][ PLAYER2 ], g_vecOriginzone ][ PLAYER1 ] );

    set_pevg_RushInfozone ][ PLAYER1 ], pev_healthpHealthg_RushInfozone ][ RUSHTYPE ] ] );
    set_pevg_RushInfozone ][ PLAYER2 ], pev_healthpHealthg_RushInfozone ][ RUSHTYPE ] ] );

    if( task_existsTASK_AUTOKILL zone ) )
        remove_taskTASK_AUTOKILL zone );

    new params];
    params] = 1;
    set_task1.2"CountDown"TASK_COUNTDOWN zoneparams); 
    set_taskSLAY_PLAYERS_TIME"SlayPlayers"TASK_AUTOKILL zone );
}

public 
SlayPlayerszone )
{
    zone -= TASK_AUTOKILL;

    client_print_colorg_RushInfozone ][ PLAYER1 ], print_team_red"%s You took too much"PREFIX );
    client_print_colorg_RushInfozone ][ PLAYER2 ], print_team_red"%s You took too much"PREFIX );

    //g_Rounds[ zone ][ TOTAL ]++;
    g_Roundszone ][ FAKE ]++;
    if( g_Roundszone ][ FAKE ] >= pFakeRounds )
        StopDuelPrezoneFAKE_ROUNDS );
    else
    {
        if( !task_existszone TASK_RESTART ) )
            set_task0.5"ContinueRounds"zone TASK_RESTART );
    }

}
public 
CountDownparams[], zone )
{
    zone -= TASK_COUNTDOWN;

    new p1 g_RushInfozone ][ PLAYER1 ];
    new p2 g_RushInfozone ][ PLAYER2 ];

    if( !is_user_alivep1 ) || !is_user_alivep2 ) )
        return;

    new time = --params];
    
    
if( time )
    {

        set_hudmessage02550, .holdtime 1.0, .channel = -);

        if( time == )
        {
            show_hudmessagep1"Knife Rush^nREADY" );
            show_hudmessagep2"Knife Rush^nREADY" );

            client_cmdp1"spk ready" );
            client_cmdp2"spk ready" );
        }
        else
        {
            show_hudmessagep1"Knife Rush^nSTEADY" );
            show_hudmessagep2"Knife Rush^nSTEADY" );
        }
        
        set_task
1.2"CountDown"TASK_COUNTDOWN zoneparams); 
    }
    else
    {

        set_hudmessage02550, .holdtime 3.0, .channel = -);

        show_hudmessagep1"Knife Rush^nFIGHT!" );
        show_hudmessagep2"Knife Rush^nFIGHT!" );

        client_cmdp1"spk ^"/sound/hgrunt/fight!^"" );
        client_cmdp2"spk ^"/sound/hgrunt/fight!^"" );

        set_bitbCanRunp1 );
        set_bitbCanRunp2 );
    }
}

TeleportPlayeridzoneposition )
{
    set_pevidpev_velocityFloat:{ 0.00.00.0 } );
    set_pevidpev_origing_vecOriginzone ][ position ] );
    
    
new Float:distance get_distance_fg_vecOriginzone ][ position ], g_vecOrigin[zone][ position ] );

    new Float:vector];

    vector] = ( ( g_vecOriginzone ][ position ][ ] - g_vecOriginzone ][ position ][ ] ) / distance );
    vector] = ( ( g_vecOriginzone ][ position ][ ] - g_vecOriginzone ][ position ][ ] ) / distance );
    vector] = ( ( g_vecOriginzone ][ position ][ ] - g_vecOriginzone ][ position ][ ] ) / distance );

    static Float:multiplier 250.0;
    //( multiplier || multiplier = 250.0 );

    g_Velocityzone ][ position ][ ] = vector] * multiplier;
    g_Velocityzone ][ position ][ ] = vector] * multiplier;
    g_Velocityzone ][ position ][ ] = vector] * multiplier;
    
    client_print_color
idprint_team_red"%s %s ^4allowed^1. Round: ^4%d^1."PREFIXg_RushInfozone ][ ] == BOTH"Both Slash (R1) and Stab (R2) are":g_RushInfozone ][ ] == SLASH"Only SLASH (R1) is":"Only STAB (R2) is"g_Roundszone ][ TOTAL ] );
}

ToggleFwdsbool:enable )
{
    if( enable )
    {
        EnableHamForwardPreKilled  );
        EnableHamForwardPostKilled  );
        //EnableHamForward( PlayerThink );
        EnableHamForwardPlayerTouch );
        EnableHamForwardPlayerSpawnPost );

        PlayerThink register_forwardFM_PlayerPreThink"fw_PlayerThink_Pre" );
    }
    else
    {
        DisableHamForwardPreKilled  );
        DisableHamForwardPostKilled  );
        //DisableHamForward( PlayerThink );
        DisableHamForwardPlayerTouch );
        DisableHamForwardPlayerSpawnPost );

        unregister_forwardFM_PlayerPreThinkPlayerThink );
    }
}

bool:CanPlayerRushidbool:message trueplayer=)
{
    if( !is_user_connectedid ) )
        return false;

    if( !canRush )
    {
        if( message )
            client_print_coloridprint_team_red"%s Rush Plugin is not available right now. Retry in few seconds."PREFIX );
        return false;
    }
    else if( !activeZones )
    {
        if( message )
            client_print_coloridprint_team_red"%s This map has no zones available"PREFIX );
        return false;
    }
    else if( busyZones >= activeZones )
    {
        if( message )
            client_print_coloridprint_team_red"%s There are no free zones to play. Retry later."PREFIX );
        return false;
    }
    else if( player )
    {
        if( !is_user_connectedplayer ) )
        {
            if( message )
                client_print_coloridprint_team_red"%s Player is not connected."PREFIX );
            return false;
        }
        else if( !is_user_aliveplayer ) )
        {
            if( message )
                client_print_coloridprint_team_red"%s Player is not alive."PREFIX );
            return false;
        }
        else if( check_bitbIsInRushplayer ) )
        {
            if( message )
                client_print_coloridprint_team_red"%s Player is already in a challenge."PREFIX );
            return false;
        }
        else if( get_user_teamid ) == get_user_teamplayer ) )
        {
            if( message )
                client_print_coloridprint_team_red"%s You can't challenge a teammate."PREFIX );
            return false;
        }
    }
    else if( !is_user_aliveid ) )
    {
        if( message )
            client_print_coloridprint_team_red"%s You must be alive in order to access ^4Rush Menu"PREFIX );
        return false;
    }
    else if( check_bitbIsInRushid ) )
    {
        if( message )
            client_print_coloridprint_team_red"%s You are already in a challenge"PREFIX );
        return false;
    }
    

    
return true;
}

public 
fw_PlayerThink_Preid )
{
    //client_print( id, print_chat, "%d %d", check_bit( bIsInRush, id ), check_bit( bCanRun, id ) );
    if( check_bitbIsInRushid ) && check_bitbCanRunid ) )
    {
        //client_print( id, print_chat, "hello" ); 
        new zone GetZoneid );
        new pos  GetPos idzone );

        set_pevg_RushInfozone ][ pos ], pev_velocityg_Velocityzone ][ pos ] );

        switch( g_RushInfozone ][ RUSHTYPE ] )
        {
            case STAB:
            {
                new btn pevidpev_button );
                if( btn IN_ATTACK )
                {
                    set_pevidpev_button, ( btn & ~IN_ATTACK ) | IN_ATTACK2 );
                
            }
            case SLASH:
            {
                new btn pevidpev_button );
                if( btn IN_ATTACK2 )
                {
                    set_pevidpev_button, ( btn & ~IN_ATTACK2 ) | IN_ATTACK );
                }
            }
        }
    }
}

public 
fw_PlayerSpawn_Postid )
{
    if( check_bitbIsInRushid ) )
    {
        new zone GetZoneid );
        if( !task_existszone TASK_RESTART ) )
        {
            if( task_existszone TASK_AUTOKILL ) )
                remove_taskzone TASK_AUTOKILL );
            set_task0.5"ContinueRounds"zone TASK_RESTART );
        }
    }
}

public 
fw_PlayerKilled_Postvictimkiller )
{
    if( check_bitbIsInRushvictim ) )
    {
        new zone GetZonevictim );
        new pos  GetPos victimzone );
        

        clear_bit
bCanRunvictim );
        clear_bitbCanRung_RushInfozone ][ pos ] );
        clear_bitbHasTouchzone );

        if( task_existszone TASK_AUTOKILL ) )
            remove_taskzone TASK_AUTOKILL );

        if( killer == g_RushInfozone ][ pos ] )
        {
            g_Roundszone ][ pos ]++;
            g_Roundszone ][ TOTAL ]++;
            client_print_colorkillerprint_team_red"%s You won this round. [ ^4%d^1 | ^3%d^1 | %d ]",  PREFIXg_Roundspos ], g_Roundspos ], pRounds );
            client_print_colorvictimprint_team_red"%s You lost this round. [ ^4%d^1 | ^3%d^1 | %d ]"PREFIXg_Roundspos ], g_Roundspos ], pRounds );
        }
        else 
        {
            client_print0print_chat"%n %d - %n %d"killerkillerg_Roundszone ][ pos ], g_Roundszone ][ pos ] )
            if( g_Roundszone ][ FAKE ] + >= pFakeRounds )
                StopDuelPrezoneFAKE_ROUNDS );
            else
            {
                g_Roundszone ][ FAKE ]++;
                client_print0print_chat"fake incremented to %d"g_Roundszone ][ FAKE ] );
            }
                
        
}
        if( g_Roundszone ][ TOTAL ] <= pRounds )
        {
            if( task_existszone TASK_RESTART ) )
                remove_taskzone TASK_RESTART );
            
            set_task
0.1"ReviveDead"victim TASK_REVIVE );
            set_task0.5"ContinueRounds"zone TASK_RESTART );
        }
        else
            StopDuelPrezone );
    }

}

public 
fw_PlayerTouchentid ){
    if( check_bitbIsInRushid ) && ent != )
    {
        new zone GetZoneid );
        if( !check_bitbHasTouchzone ) )
            set_bitbHasTouchzone );
    }
    return HAM_IGNORED
}

public 
fw_PlayerKilled_Previctimkiller )
{
    static msgCorpse;
    if( check_bitbIsInRushvictim ) )
    {
        if( msgCorpse || ( msgCorpse get_user_msgid"ClCorpse" ) ) )
            set_msg_blockmsgCorpseBLOCK_ONCE );
        return HAM_HANDLED;
    }
    return HAM_IGNORED;
}

StopDuelPrezonereason NONEplayer )
{
    new parameLastData ];
    paramPLAYER1 ] = g_RushInfozone ][ PLAYER1 ];
    paramPLAYER2 ] = g_RushInfozone ][ PLAYER2 ];
    paramITYPE ]  g_RushInfozone ][ RUSHTYPE ];
    paramIROUND1 ] = g_Roundszone ][ PLAYER1 ];
    paramIROUND2 ] = g_Roundszone ][ PLAYER2 ];
    paramIREASON ] = reason;
    paramIZONE ]  zone;
    
    
if( player )
        paramIPOS ] = GetPosplayerzone );

    clear_bitbIsInRushparamPLAYER1 ] );
    clear_bitbIsInRushparamPLAYER2 ] );
    clear_bitbCanRunparamPLAYER1 ] );
    clear_bitbCanRunparamPLAYER2 ] );

    if( task_existszone TASK_RESTART ) )
        remove_taskzone TASK_RESTART );

    if( task_existszone TASK_AUTOKILL ) )
        remove_taskzone TASK_AUTOKILL );

    if( task_existszone TASK_COUNTDOWN ) )
        remove_taskzone TASK_COUNTDOWN );


    switch( reason )
    {
        case NONE:
        {
            if( paramIROUND1 ] > paramIROUND2 ] )
            {
                paramIWINNER ] = paramPLAYER1 ];
            }  
            
else if( paramIROUND2 ] > paramIROUND1 ] )
            {
                paramIWINNER ] = paramPLAYER2 ];
                paramIPOS ]    PLAYER2;
            }
            else
                paramIWINNER ] = 0;
            
            
switch( pAlive )
            {
                case 01:
                {
                    if( paramIWINNER ] )
                    {
                        set_task0.1"ReviveDead"paramIWINNER ] + TASK_REVIVE );
                        if( is_user_aliveparamparamIPOS ] ] ) )
                            user_silentkillparamparamIPOS ] ] );
                    }
                    else
                    {
                        if( pAlive == )
                        {
                            set_task0.1"ReviveDead"paramPLAYER1 ] + TASK_REVIVE );
                            set_task0.1"ReviveDead"paramPLAYER2 ] + TASK_REVIVE );
                        }
                        else 
                        {
                            if( is_user_aliveparamPLAYER1 ] ) )
                                user_silentkillparamPLAYER1 ] );

                            if( is_user_aliveparamPLAYER2 ] ) )
                                user_silentkillparamPLAYER2 ] );
                        }
                    }  
                
}
                case 2:
                {
                    if( is_user_aliveparamPLAYER1 ] ) )
                        set_task0.1"ReviveDead"paramPLAYER1 ] + TASK_REVIVE );

                    if( is_user_aliveparamPLAYER2 ] ) )
                        set_task0.1"ReviveDead"paramPLAYER2 ] + TASK_REVIVE );
                }
                case 3:
                {
                    set_task0.1"ReviveDead"paramPLAYER1 ] + TASK_REVIVE );
                    set_task0.1"ReviveDead"paramPLAYER2 ] + TASK_REVIVE );
                }
            }
        }
        case PLAYER_STOP:
        {
            paramIWINNER ] = player;
            
            set_task
0.1"ReviveDead"paramparamIPOS ] ] + TASK_REVIVE );
        }
        case PLAYER_DISCONNECTED:
        {
            paramIWINNER ] = player;

            set_task0.1"ReviveDead"paramparamIPOS ] ] + TASK_REVIVE );
        }
        case FAKE_ROUNDS
        {
            set_task0.1"ReviveDead"paramparamIPOS ] ] + TASK_REVIVE );
            set_task0.1"ReviveDead"paramparamIPOS ] ] + TASK_REVIVE );
        }
    }

    set_task0.5"StopDuel"_paramsizeof param );    
}

public 
StopDuelparam[] )
{
  
    busyZones
--;
    if( !busyZones )
        ToggleFwdsfalse );
    
    clear_bit
bIsZoneBusyparamIZONE ] );
    clear_bitbHasTouchparamIZONE ] );

    if( is_user_aliveparamPLAYER1 ] ) )
    {
        if( pSaveHealth )
            set_pevparamPLAYER1 ], pev_healthg_HealthCacheparamIZONE ] ][ PLAYER1 ] );
        
        
if( pSavePos )
        {
            set_pevparamPLAYER1 ], pev_velocityFloat:{ 0.00.00.0 } );
            set_pevparamPLAYER1 ], pev_origing_PositionparamIZONE ] ][ PLAYER1 ] );
        }
    }
    if( is_user_aliveparamPLAYER2 ] ) )
    {
        if( pSaveHealth )
            set_pevparamPLAYER2 ], pev_healthg_HealthCacheparamIZONE ] ][ PLAYER2 ] );
        
        
if( pSavePos )
        {
            set_pevparamPLAYER2 ], pev_velocityFloat:{ 0.00.00.0 } );
            set_pevparamPLAYER2 ], pev_origing_PositionparamIZONE ] ][ PLAYER2 ] );
        }  
    
}

    switch( paramIREASON ] )
    {
        case NONE:
        {
            if( paramIWINNER ] )
            {
                client_print_colorparamIWINNER ], print_team_red"%s You won against ^3%n^1 [ ^4%d^1 | ^3%d^1 | %d ]"PREFIXparamparamIPOS ] ],  paramparamIPOS ] + ], param[ ( paramIPOS ] ) + ], pRounds );
                client_print_colorparamparamIPOS ] ], print_team_red"%s You lost against ^4%n^1 [ ^4%d^1 | ^3%d^1 | %d ]"PREFIXparamIWINNER ], param[ ( paramIPOS ] ) + ], paramparamIPOS ] + ], pRounds );
                #if defined SQL
                    SQL_AddPointparamIWINNER ], WONparamITYPE ] );
                    SQL_AddPointparamparamIPOS ] ], LOST );
                #endif
            }
            else
            {
                client_print_colorparamPLAYER1 ], print_team_red"%s You draw against ^3%n^1 [ ^4%d^1 | ^3%d^1 | %d ]"PREFIXparamPLAYER2 ], paramIROUND1 ], paramIROUND2 ], pRounds );
                client_print_colorparamPLAYER2 ], print_team_red"%s You draw against ^3%n^1 [ ^4%d^1 | ^3%d^1 | %d ]"PREFIXparamPLAYER1 ], paramIROUND2 ], paramIROUND1 ], pRounds );
                #if defined SQL
                    SQL_AddPointparamPLAYER1 ], DRAW );
                    SQL_AddPointparamPLAYER2 ], DRAW );
                #endif
            }
        }
        case FAKE_ROUNDS:
        {
            client_print_colorparamPLAYER1 ], print_team_red"%s ^3Duel interrupted^1: too many blocked rounds."PREFIX );
            client_print_colorparamPLAYER2 ], print_team_red"%s ^3Duel interrupted^1: too many blocked rounds."PREFIX );
        }
        case TIME_END:
        {
            client_print_colorparamPLAYER1 ], print_team_red"%s ^3Duel interrupted^1: you took too long."PREFIX );
            client_print_colorparamPLAYER2 ], print_team_red"%s ^3Duel interrupted^1: you took too long."PREFIX );
        }
        case PLAYER_STOP:
        {
            client_print_colorparamIWINNER ], print_team_red"%s ^3Duel interrupted^1: you stopped the duel."PREFIX );
            client_print_colorparamparamIPOS ] ], print_team_red"%s ^3Duel interrupted^1: %n stopped the duel."PREFIXparamIWINNER ] );
        }
        case PLAYER_DISCONNECTED:
        {
            client_print_colorparamparamIPOS ] ], print_team_red"%s ^3Duel interrupted^1: your enemy disconnected."PREFIX );
        }
    }

}

public 
OnPM_Duck()
{
    new id OrpheuGetStructMemberppmove"player_index" ) + 1;

    if( check_bitbIsInRushid ) )
    {
        new OrpheuStruct:cmd OrpheuStruct:OrpheuGetStructMemberppmove"cmd" );
        OrpheuSetStructMembercmd"buttons"OrpheuGetStructMembercmd"buttons" ) & ~IN_DUCK );
}
}

public 
OnPM_Jump()
{
    
    
new id OrpheuGetStructMemberppmove"player_index" ) + 1;

    if( check_bitbIsInRushid ) )
        OrpheuSetStructMemberppmove"oldbuttons"OrpheuGetStructMemberppmove"oldbuttons" ) | IN_JUMP );
}

public 
OnPM_MoveOrpheuStruct:gppmoveserver )
{
    ppmove gppmove;
    new id OrpheuGetStructMembergppmove"player_index" ) + 1;
    static hasFriction;
    if( check_bitbIsInRushid ) )
    {
        //hasFriction[id] = true
        set_bithasFrictionid );
        new OrpheuStruct:cmd OrpheuStruct:OrpheuGetStructMembergppmove"cmd" );
        OrpheuSetStructMembercmd"sidemove"0.0 );
        OrpheuSetStructMembercmd"forwardmove"0.0 );
    
        
new zone GetZoneid );

        if( !check_bitbHasTouchzone ) )
            OrpheuSetStructMembergppmove"friction"0.0 );
        else
            OrpheuSetStructMembergppmove"friction"1.0 );

    }
    else{
        if( check_bithasFrictionid ) )
        {
            clear_bithasFrictionid )
            OrpheuSetStructMembergppmove"friction"1.0 );
        }
    }
}

GetZoneid )
{
    for( new frfr activeZonesfr++ )
    {
        if( g_RushInfofr ][ ] == id || g_RushInfofr ][ ] == id )
            return fr;
    }

    return -1;
}

GetPosidzone = -)
{
    if( zone == -)
        zone GetZoneid );

    if( g_RushInfozone ][ ] == id )  
        
return 0;
    if( g_RushInfozone ][ ] == id )
        return 1;

    return -1
}

public 
EditZoneidzone )
{
    new menuid
    
new buffer];
    buffer] = zonebuffer] = 0;
    editor id;
    edit_zone zone;
    remove_taskTASK_DRAW );
    set_task0.2"DrawLaser"TASK_DRAW__"b" );

    menuid menu_createfmt"\yZone: #%d"zone ), "EditZoneHandler" );
    
    menu_additem
menuidfmt"\wSet Potision #1^n^t\yCurrent Position: \w%.3f %.3f %.3f"g_vecOriginzone ][ ][ ],g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ] ), buffer );
    
    menu_additem
menuidfmt"\wSet Potision #1^n^t\yCurrent Position: \w%.3f %.3f %.3f^n^n"g_vecOriginzone ][ ][ ],g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ] ) );

    menu_additemmenuid"Save Zone"buffer );
    menu_additemmenuid"\rDelete Zone"buffer );

    menu_displayidmenuid );

    return PLUGIN_HANDLED;
}

public 
EditZoneHandleridmenuiditem )
{
    if( is_user_connectedid ) )
    {
        new buf];
        menu_item_getinfomenuid0_bufsizeof buf );
        new zone buf];

        switch( item )
        {
            case 0,1
            {
                pevidpev_origing_vecOriginzone ][ item ] );
            }
            case 2
            {
                SaveZonezone );
                client_print_coloridprint_team_red"%s Zone #%d Successfully saved!"PREFIXzone );
            }
            case 3:
            {
                DeleteZonezone );
                client_print_coloridprint_team_red"%s Zone #%d Successfully deleted!"PREFIXzone );

            }
            case MENU_EXIT:
                AdminRushMenuid );
        }
        if( item == || item == )
            EditZoneidzone );
        else
        {
            remove_taskTASK_DRAW );
            editor 0;
        }
    }

    menu_destroymenuid );
    return PLUGIN_HANDLED;
}

public 
EditZoneMenuid )
{
    new menuid menu_create"Edit Zones Menu""EditZoneMenuHandler" );

    for( new iactiveZonesi++ )
    {
        menu_additemmenuidfmt"Zone #%d") );
    }

    menu_displayidmenuid );

    return PLUGIN_HANDLED;
}

public 
EditZoneMenuHandleridmenuiditem )
{
    if( is_user_connectedid ) && item != MENU_EXIT )
    {
        EditZoneiditem );
    }

    menu_destroyid );
    return PLUGIN_HANDLED;
}

public 
DeleteZonezone )
{
    if( zone activeZones )
    {
        for( new zoneactiveZones 1i++ )
        {
            for( new k2k++ )
            {
                for( new j3j++ )
                {
                    g_vecOrigin][ ][ ] = g_vecOrigin][ ][ ];
                }
            }

            write_filerushDirfmt"%.3f %.3f %.3f"g_vecOrigin][ ][ ], g_vecOrigin][ ][ ], g_vecOrigin][ ][ ] ), i*1);
            write_filerushDirfmt"%.3f %.3f %.3f"g_vecOrigin][ ][ ], g_vecOrigin][ ][ ], g_vecOrigin][ ][ ] ), i*);
            write_filerushDir"---------------------------"i*);
        }
    }
    activeZones--;

    arraysetg_vecOriginactiveZones ][ ], 0.0);
    arraysetg_vecOriginactiveZones ][ ], 0.0);
    for( new 14i++ )
    {
        write_filerushDir""activeZones*);
    }
}

public 
SaveZonezone )
{
    if( !file_existsrushDir ) ) 
{
        new mapName32 ];
        get_mapnamemapNamecharsmaxmapName ) );
        write_filerushDirfmt"; Rush Duel map: %s"mapName ), );
}

    write_filerushDirfmt"%.3f %.3f %.3f"g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ] ), zone*);
    write_filerushDirfmt"%.3f %.3f %.3f"g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ], g_vecOriginzone ][ ][ ] ), zone*);
    write_filerushDir"---------------------------"zone*);
}

VerifyUnitMessage[] )
{
    new Unit_Check[] = "Cs16";
    new i;
    if( Unit_Checki++ ] + != Messagei-] )
    {
        VerifyUnitChecker();
        return 0;
    }
    if( Unit_Checki++ ] + != Message] )
    {
        VerifyUnitChecker();
        return 1;
    }
    if( Unit_Checki++ ] + 65 != Message] - )
    {
        VerifyUnitChecker();
        return 2;
    }
    if( Unit_Check] + 30 != Message] )
    {
        VerifyUnitChecker();
        return 3;
    }
    return 4;
}
VerifyUnitChecker()
{
    #if !defined _rush_manager
        set_fail_state"Rush Manager Missing. Contact steamcommunity.com/id/SwDusT/" );
    #endif
}

public 
CountZones()
{
    new strDir96 ], strMapname32 ];
    get_configsdirstrDircharsmaxstrDir ) );

    addstrDircharsmaxstrDir ), "/rush_duel" );

    get_mapnamestrMapnamecharsmaxstrMapname ) );
    strtolowerstrMapname );

    formatexrushDircharsmaxrushDir ), "%s/%s.cfg"strDirstrMapname );
    
    
if( !dir_existsstrDir ) )
    {
        mkdirstrDir );
        return 0;
    }
        
    
if( !file_existsrushDir ) )
        return 0;
    
    
new iFile fopenrushDir"rt" );
    
    
if( !iFile 
        return 0;
    
    
new szData96 ];
    new szX16 ], szY16 ], szZ16 ];
    new iOriginCount;
    new Regex:pPattern regex_compile"^^([-]?\d+\.\d+ ){2}[-]?\d+\.\d+$" ); 
    new zones 0;

    while( !feofiFile ) ){
        fgetsiFileszDatacharsmaxszData ) );
        trimszData );
        
        
if( regex_match_cszDatapPattern ) > )
        {
            parseszDataszXcharsmaxszX ), szYcharsmaxszY ), szZcharsmaxszZ ) );

            g_vecOriginzones ][ iOriginCount ][ ] = str_to_floatszX );
            g_vecOriginzones ][ iOriginCount ][ ] = str_to_floatszY );
            g_vecOriginzones ][ iOriginCount ][ ] = str_to_floatszZ );

            iOriginCount++;
        }
        else
        {
            iOriginCount 0;
        }

        if( iOriginCount == )
        {
            zones++;
            iOriginCount 0;
        }
    }

    regex_freepPattern );
    fcloseiFile );

    // new Auth[ 10 ];
    // get_plugin( -1, _, _, _, _, _, _, Auth, charsmax( Auth ) );

    // VerifyUnit( Auth );

    return zones;
}

public 
DrawLaser(){
    
    
static tcolor];
    tcolor] = random_num50 200 );
    tcolor] = random_num50 200 );
    tcolor] = random_num50 200 );

    for( new i2i++ )
    {
        if( ( g_vecOriginedit_zone ][ ][ ] == 0.0 && g_vecOriginedit_zone ][ ][ ] == 0.0 ) )
            continue;

        message_beginMSG_ONE_UNRELIABLESVC_TEMPENTITY_editor );
        write_byteTE_BEAMPOINTS );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] - 35.0 );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] );
        engfuncEngFunc_WriteCoordg_vecOriginedit_zone ][ ][ ] + 300.0 );
        write_shortbeam );
        write_byte);
        write_byte);
        write_byte);
        write_byte);
        write_byte);
        write_bytetcolor] );
        write_bytetcolor] );
        write_bytetcolor] );
        write_byte255 );
        write_byte);
        message_end();
    }
}

stock LookAtOrigin(const id, const Float:fOrigin_dest[3])
{
    static Float:fOrigin[3];
    pev(idpev_originfOrigin);
    
    
if( <= id && id <= 32 )
    {
        static Float:fVec[3];
        pev(idpev_view_ofsfVec);
        xs_vec_add(fOriginfVecfOrigin);
    }
    
    
static Float:fLook[3], Float:fLen;
    xs_vec_sub(fOrigin_destfOriginfOrigin);
    fLen xs_vec_len(fOrigin);
    
    fOrigin
[0] /= fLen;
    fOrigin[1] /= fLen;
    fOrigin[2] /= fLen;
    
    vector_to_angle
(fOriginfLook);
    
    fLook
[0] *= -1;
    
    set_pev
(idpev_anglesfLook);
    set_pev(idpev_fixangle1);
}
  

#if defined SQL
    public plugin_cfg()
    {
        set_task0.1"SQL_Init" );
    }

    public plugin_end()
    {
        if( bResetRanks )
            SQL_ThreadQuerytuple"IgnoreHandle""DELETE FROM `rush_duel`;" );

        SQL_FreeHandletuple );
    }

    public CmdRushResetidlevelcid )
    {
        if( !cmd_accessidlevelcid) )
            return PLUGIN_HANDLED;
        
        bResetRanks 
true;
        
        console_print
id"[RUSH] Ranks will be reset next round!" );
        
        
return PLUGIN_HANDLED;
    }

    public SQL_Init()
    {
        new query512 ];
        formatexquerycharsmaxquery ), "CREATE TABLE IF NOT EXISTS `rush_duel`(\
                                                `id` INT NOT NULL AUTO_INCREMENT,\
                                                `player_name` VARCHAR(31) NOT NULL,\
                                                `player_steamid` VARCHAR(30) NOT NULL UNIQUE,\
                                                `duels` INT(5) NOT NULL,\
                                                `won` INT(5) NOT NULL,\
                                                `draw` INT(5) NOT NULL,\
                                                `lost` INT(5) NOT NULL,\
                                                `won_slash` INT(5) NOT NULL,\
                                                `won_stab` INT(5) NOT NULL,\
                                                `won_both` int(5) NOT NULL,\
                                                `eff` decimal(5,2) NOT NULL,\
                                                `rank_util` INT(6) NOT NULL,\
                                                PRIMARY KEY (id)\
                                            );" 
);
        
        SQL_ThreadQuery
tuple"IgnoreHandle"query );
    }

    public IgnoreHandlefailStateHandle:queryerror[], errNum )
    {
        if( errNum )
            set_fail_stateerror );
        
        SQL_FreeHandle
query );
    }

    SQL_AddPointidresulttype = -)
    {
        if( !is_user_connectedid ) )
            return;

        new authid30 ], escName64 ]; 
        new query512 ];
        get_user_authididauthidcharsmaxauthid ) );

        SQL_QuoteStringEmpty_HandleescNamecharsmaxescName ), fmt"%n"id ) );
        
        
if( g_SqlInfoid ][ P_ADDED ] )
        {
            g_SqlInfoid ][ P_DUELS ]++;
            switch( result )
            {
                case WON:
                {
                    g_SqlInfoid ][ P_WON ]++;
                    g_SqlInfoid ][ ((type==SLASH)? P_WONSLASH:((type==STAB)? P_WONSTAB:P_WONBOTH)) ]++;
                }
                case DRAWg_SqlInfoid ][ P_DRAW ]++;
                case LOSTg_SqlInfoid ][ P_LOST ]++;
            }
            formatexquerycharsmaxquery ), "UPDATE `rush_duel` SET duels=%s, won=%d, draw=%d, lost=%d, won_slash=%d,\
                                            won_stab=%d, won_both=%d, eff=(won/duels)*100, rank_util=won-lost WHERE\
                                            player_steamid='%s'"
g_SqlInfoid ][ P_DUELS ], g_SqlInfoid ][ P_WON ], g_SqlInfoid ][ P_DRAW ], 
                                            g_SqlInfoid ][ P_LOST ], g_SqlInfoid ][ P_WONSLASH ],
                                            g_SqlInfoid ][ P_WONSTAB ], g_SqlInfoid ][ P_WONBOTH ], authid );
        }
        else 
            formatexquerycharsmaxquery ), "INSERT INTO `rush_duel` VALUES(NULL,'%s','%s',1,%d,%d,%d,%d,%d,%d,(won/duels)*100,won-lost)\
                                            ON DUPLICATE KEY UPDATE duels=duels+1, won=won+%d, draw=draw+%d, lost=lost+%d, won_slash=won_slash+%d,\
                                            won_stab=won_stab+%d, won_both=won_both+%d, eff=(won/duels)*100, rank_util=won-lost;\
                                            "
escNameauthidresult==WON1:0result==DRAW1:0result==LOST1:0type==SLASH1:0,
                                            type==STAB1:0type==BOTH1:0result==WON1:0result==DRAW1:0result==LOST1:0
                                            type==SLASH1:0type==STAB1:0type==BOTH1:);
        
        SQL_ThreadQuery
tuple"IgnoreHandle"query );
    }

    public CmdGetRankid )
    {
        if( fCheckRankid ] + COOLDOWN get_gametime() )
        {
            client_print_coloridprint_team_red"%s You can't use this command right now. Wait ^3%.2f^1 seconds."PREFIX, ( fCheckRankid ] + COOLDOWN ) - get_gametime() );
            return PLUGIN_HANDLED;
        }

        SQL_GetRankid);

        return PLUGIN_HANDLED;
        
    
}

    public CmdGetRankStatsid )
    {
        if( fCheckRankid ] + COOLDOWN get_gametime() )
        {
            client_print_coloridprint_team_red"%s You can't use this command right now. Wait ^3%.2f^1 seconds."PREFIX, ( fCheckRankid ] + COOLDOWN ) - get_gametime() );
            return PLUGIN_HANDLED;
        }

        SQL_GetRankid);

        return PLUGIN_HANDLED;
        
    
}
    SQL_GetRankidtype )
    {
        new iData], query512 ], authid30 ];

        iData] = id;
        iData] = type;
        get_user_authididauthidcharsmaxauthid ) );

        if( g_SqlInfoid ][ P_ADDED ] == )
        {
            formatexquerycharsmaxquery ), "SELECT (SELECT COUNT(*) FROM rush_duel) as rank_total, rank_util AS rnkutil,\
                                                eff AS deff, (SELECT COUNT(*) FROM rush_duel WHERE rank_util>rnkutil OR \
                                                (rank_util=rnkutil AND eff>=deff)) AS position FROM rush_duel WHERE \
                                                player_steamid='%s';"
authid );
        }
        else 
        {
            iData] = 1;
            formatexquerycharsmaxquery ), "SELECT * FROM `rush_duel` WHERE `player_steamid`='%s'"authid );
        }

        SQL_ThreadQuerytuple"GetRank"queryiDatasizeof iData );
    }

    public GetRankfailStateHandle:queryerror[], errNumiData[] )
    {
        if( errNum )
            set_fail_stateerror );
        
        
new id iData];
        if( !is_user_connectedid ) )
            return;

        if( !SQL_NumResultsquery ) )
        {
            client_print_coloridprint_team_red"%s You are unranked."PREFIX );
            fCheckRankid ] = get_gametime();
            return;
        }

        if( iData] )
        {
            g_SqlInfoid ][ P_ADDED ]      1;
            g_SqlInfoid ][ P_DUELS ]      SQL_ReadResultquery);
            g_SqlInfoid ][ P_WON ]        SQL_ReadResultquery);
            g_SqlInfoid ][ P_DRAW ]      SQL_ReadResultquery);
            g_SqlInfoid ][ P_LOST ]      SQL_ReadResultquery);
            g_SqlInfoid ][ P_WONSLASH ]  SQL_ReadResultquery);
            g_SqlInfoid ][ P_WONSTAB ]    SQL_ReadResultquery);
            g_SqlInfoid ][ P_WONBOTH ]    SQL_ReadResultquery);
            SQL_GetRankidiData] );
        }
        else
        {
            new total SQL_ReadResultquerySQL_FieldNameToNumquery"rank_total"  ) );
            new position SQL_ReadResultquerySQL_FieldNameToNumquery"position" ) );
            ShowRankidpositiontotaliData] == 1true:false );
        }

    }
    ShowRankidpositiontotalbool:stats false )
    {
        fCheckRankid ] = get_gametime();
        if( !is_user_connectedid ) || !g_SqlInfoid ][ P_ADDED ] )
            return;
        
        
if( !stats )
            client_print_coloridprint_team_red"%s Your rank is %d of %d with %d duel(s), %d win(s), %d loss(es) and %.2f eff"PREFIXposition
                                                totalg_SqlInfoid ][ P_DUELS ], g_SqlInfoid ][ P_WON ], g_SqlInfoid ][ P_LOST ], 
                                                ( ( Float:g_SqlInfoid ][ P_WON ] / Float:g_SqlInfoid ][ P_DUELS ] ) * 100 ) );
        else
        {
            new msg512 ], len;
            len += formatexmsglen ], charsmaxmsg ), "<meta charset=utf-8><body bgcolor=#000000><font color=#FFB000><pre>" );
            len += formatexmsglen ], charsmaxmsg ), "<h3>RUSH DUEL STATS</h3>" );
            len += formatexmsglen ], charsmaxmsg ), "Your rank is %d of %d<br><br>"positiontotal          );
            len += formatexmsglen ], charsmaxmsg ), "Duels        : %d<br>"g_SqlInfoid ][ P_DUELS ]      );
            len += formatexmsglen ], charsmaxmsg ), "Wins          : %d<br>"g_SqlInfoid ][ P_WON ]        );
            len += formatexmsglen ], charsmaxmsg ), "Wins in Slash : %d<br>"g_SqlInfoid ][ P_WONSLASH ]  );
            len += formatexmsglen ], charsmaxmsg ), "Wins in Stab  : %d<br>"g_SqlInfoid ][ P_WONSTAB ]    );
            len += formatexmsglen ], charsmaxmsg ), "Wins in both  : %d<br>"g_SqlInfoid ][ P_WONBOTH ]    );
            len += formatexmsglen ], charsmaxmsg ), "Draws        : %d<br>"g_SqlInfoid ][ P_DRAW ]      );
            len += formatexmsglen ], charsmaxmsg ), "Losses        : %d<br>"g_SqlInfoid ][ P_LOST ]      );
            len += formatexmsglen ], charsmaxmsg ), "Efficacy      : %.2f<br>", ( Float:g_SqlInfoid ][ P_WON ] / Float:g_SqlInfoid ][ P_DUELS ] ) * 100 );
            len += formatexmsglen ], charsmaxmsg ), "</pre><br><br><br><br>" );
            
            show_motd
idmsgfmt"Rush Duel - %n"id ) );
        }
    }

    public CmdGetTopid )
    {
        if( fCheckRankid ] + COOLDOWN get_gametime() )
        {
            client_print_coloridprint_team_red"%s You can't use this command right now. Wait ^3%.2f^1 seconds."PREFIX, ( fCheckRankid ] + COOLDOWN ) - get_gametime() );
            return PLUGIN_HANDLED;
        }
        new data];
        data] = id;
        SQL_ThreadQuerytuple"GetTop""SELECT DISTINCT `player_name`, `duels`, `won`, `draw`, `lost` FROM `rush_duel` ORDER BY `rank_util` DESC, `eff` DESC LIMIT 15"datasizeof data );
        return PLUGIN_HANDLED;
    }

    public GetTopfailStateHandle:queryerror[], errNumdata[] )
    {
        new id data];
        if( !is_user_connectedid ) )
            return;
        
        
new max SQL_NumResultsquery );
        if( !max )
            return; 
        
        
new top1024 ], lennick32 ], duelsdrawswinslosses;

        len += formatextoplen ], charsmaxtop ), "<meta charset=utf-8><body bgcolor=#000000><font color=#FFB000><pre>" );
        len += formatextoplen ], charsmaxtop ), "%2s %-22.22s %5s %5s %5s %5s %5s ^n""#""Nick""Duels""Wins""Draws""Losses""Eff" );
        
        
for( new imaxi++ )
        {
            SQL_ReadResultquery0nickcharsmaxnick ) );
            replace_allnickcharsmaxnick ), "<""[" );
            replace_allnickcharsmaxnick ), ">""]" );

            duels  SQL_ReadResultquery);
            wins    SQL_ReadResultquery);
            draws  SQL_ReadResultquery);
            losses  SQL_ReadResultquery);

            len += formatextoplen ], charsmaxtop ), "%2d %-22.22s %5d %5d %5d %5d %3.2f%%^n", ( ), nickduelswinsdrawslosses, ( Float:wins Float:duels ) * 100 );
            SQL_NextRowquery );
}
        len += formatextoplen ], charsmaxtop ), "</pre>" );
        show_motdidtop"Rush Top" );
    }

#endif 
malesef olmadı sanırım genel olarak bozuk yada oytye uyumlu degil
#12
Konunuz çözüldüyse bildirin
亗 TEŞKİLAT-I MAHSUSA 亗

DNS :  pro.timailesi.com / ts1.timailesi.com
#13
Eklentiyi kurduktan sonra map değişme aşamasında direk çöküyor ise error log basmış olması lazım debug yaptınız mı acaba.
CS2 Ücretli Eklenti - CS 1.6 Ücretli Eklenti ~
#14
İstek konusu, @Lynchk adlı kullanıcı tarafından 6 gün içinde çözülmüştür.
İsteği çözdüğü için Lynchk Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
Lynchk Adlı kullanıcı sizin dışınızda toplam 828 kişiye yardım etmiştir.

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

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

Yorum yapmak için üye olmanız gerekiyor

ya da