Jump to content

Recommended Posts

1. Nume plugin: VIP Clasic
2. Autor & Versiune: Shadows Adi / 1.2
3. Comenzi:

Quote

/vmenu - afiseaza meniul VIP
/vm - afiseaza meniul VIP
/vip - afiseaza motd-ul cu preturi VIP

4. Cvar:

Quote

vip_kill_hp 10 - cat hp sa primeasca un jucator VIP pe kill
vip_kill_ap 10 - cat armura sa primeasca un jucator VIP pe kill
vip_killhs_hp 15 - cat hp sa primeasca un jucator VIP pe kill prin headshot
vip_killhs_ap 15 - cata armura sa primeasca un jucator VIP pe kill prin headshot
vip_max_hp 110 - cat hp poata sa aiba maxim un jucator VIP
vip_max_ap 110 - cata arumra poata sa aiba maxim un jucator VIP
vip_msg_prefix " [VIP]" - prefixul mesajelor din chat
vip_chat_prefix "[VIP]" - prefixul jucatorilor VIP cand scriu in Chat
vip_multi_jumps 2 - cate sarituri sa aiba un jucator VIP
vip_prices_motd "vip_info.html" - numele fisierului motd ( default: amxmodx/configs/vip_info.html )
vip_rounds_showmenu 3 - din a cata runda sa se deschida meniul VIP

5. Alte detalii: Acest plugin adauga pe server VIP, are un meniu de arme, VIP-ii apar in TAB, meniul de arme se deschide automat la inceputul fiecarei runde. Este customizabil prin cvar-urile de mai sus.
6. Link download: Click aici
SMA
 

Quote

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < engine >
#include < fun >
#include < hamsandwich >

#pragma semicolon 1

#define PLUGIN "VIP Clasic"
#define VERSION "1.0"
#define AUTHOR "Shadows Adi"

//Aici modifici 'ADMIN_LEVEL_H' in functie de flagul pe care il vrei. Default: 't'
#define is_user_vip(%1) (get_user_flags(%1) & ADMIN_LEVEL_H)

//Aici vei pune "//" in fata lui #define daca nu vrei sa ii apara tag in chat cand scrie.
#define VIP_CHAT

enum _:CvarsSettings {
    VipHP,
    VipHsHP,
    VipAP,
    VipHsAP,
    VipMaxHP,
    VipMaxAP,
    VipPrefix,
#if defined VIP_CHAT
    VipChatPrefix,
#endif
    VipJumps,
    VipPrices,
    VipMenuRounds
};

enum _:Weapons {
    WeapName[64],
    WeaponID[32],
    BpAmmo
};

new const VipWeapons[][Weapons] = {
    { "AK47 \d+ \wDeagle \d+ \wSet Grenade", "weapon_ak47", 90 },
    { "M4A1 \d+ \wDeagle \d+ \wSet Grenade","weapon_m4a1", 90 },
    { "AWP \d+ \wDeagle \d+ \wSet Grenade", "weapon_awp", 30 }
};

new pCvars[CvarsSettings];

new bool:WeaponSelected[33];
new g_iRound;
new jumpnum[ 33 ] = 0;
new bool:dojump[ 33 ] = false;

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

public plugin_init( )
{
    register_plugin( PLUGIN, VERSION, AUTHOR);
    
    register_clcmd( "say /vm", "ShowVIPMenu" );
    register_clcmd( "say /vmenu", "ShowVIPMenu" );
    register_clcmd( "say_team /vm", "ShowVIPMenu" );
    register_clcmd( "say_team /vmenu", "ShowVIPMenu" );
    register_clcmd( "say /vip", "ShowVIPMotd" );
    
    pCvars [ VipHP ] = register_cvar( "vip_kill_hp", "10" );
    pCvars [ VipAP ] = register_cvar( "vip_kill_ap", "10" );
    pCvars [ VipHsHP ] = register_cvar( "vip_killhs_hp", "15" );
    pCvars [ VipHsAP ] = register_cvar( "vip_killhs_ap", "15" );
    pCvars [ VipMaxHP ] = register_cvar( "vip_max_hp", "110" );
    pCvars [ VipMaxAP ] = register_cvar( "vip_max_ap", "110" );
    pCvars [ VipPrefix ] = register_cvar( "vip_msg_prefix", "[VIP]" );
    
    #if defined VIP_CHAT
    register_clcmd( "say ", "hook_say" );
    register_clcmd( "say_team ", "hook_sayteam" );
    pCvars [ VipChatPrefix ] = register_cvar( "vip_chat_prefix", "[VIP]" );
    #endif
    
    pCvars [ VipJumps ] = register_cvar( "vip_multi_jumps", "2" );
    pCvars [ VipPrices ] = register_cvar( "vip_prices_motd", "vip_info.html" );
    pCvars [ VipMenuRounds ] = register_cvar( "vip_rounds_showmenu", "3" );
    
    RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawnPost", 1);
    RegisterHam( Ham_Killed, "player", "ham_PlayerKilled", 1);
    register_event( "HLTV", "ev_NewRound", "a", "1=0", "2=0" );
    register_logevent( "logev_Restart", 2, "1&Restart_Round", "1&Game_Commencing" );
}

public client_putinserver( id )
{
    jumpnum[ id ] = 0;
    dojump[ id ] = false;
}

public client_disconnect( id )
{
    jumpnum[ id ] = 0;
    dojump[ id ] = false;
}

public ev_NewRound( )
{
    g_iRound++;
}

public logev_Restart( )
{
    g_iRound = 0;
}

public ShowVIPMenu( id )
{
    new Tag[32];
    get_pcvar_string( pCvars[ VipPrefix ], Tag, charsmax( Tag ) );
    
    if(is_user_vip( id ) )
    {
        if( g_iRound >= get_pcvar_num( pCvars[ VipMenuRounds ] ) )
        {
            if(!WeaponSelected [ id ] )
            {
                new g_iMenu = menu_create("\wVIP Menu", "handle_vip_menu" );
                
                for ( new i; i < sizeof VipWeapons; i++ )
                    menu_additem( g_iMenu, VipWeapons[ i ][ WeapName ] );
                
                menu_display( id, g_iMenu );
            }
            else 
            {
                color_chat( id, "!g%s!y: Asteapta runda viitoare pentru a-ti alege iar armele!", Tag );
                return PLUGIN_HANDLED;
            }
        }
        else 
        {
            color_chat( id, "!g%s!y: Meniul pentru VIP se va deschide in %d runde!", Tag, get_pcvar_num( pCvars[ VipMenuRounds ] ) );
            return PLUGIN_HANDLED;
        }
    }
    else 
    {
        color_chat( id, "!g%s!y: Acest meniu este doar pentru jucatorii !gVIP!y!", Tag );
        return PLUGIN_HANDLED;
    }
    return PLUGIN_HANDLED;
}

public handle_vip_menu( id, menu, item )
{
    if( item == MENU_EXIT || !is_user_alive( id ) )
        menu_destroy( menu );
        
    if( is_user_vip( id ) )
    {
        drop_weapons( id, 1);
        drop_weapons( id, 2);
        give_item( id, "weapon_knife" );
        give_item( id, "weapon_hegrenade" );
        give_item( id, "weapon_flashbang" );
        cs_set_user_bpammo( id, CSW_FLASHBANG, 2 );
        WeaponSelected [ id ] = true;
        
        give_item( id, VipWeapons[ item ][ WeaponID ] );
        cs_set_user_bpammo( id, get_weaponid( VipWeapons[ item ][ WeaponID ] ), VipWeapons[ item ][ BpAmmo ] );
        give_item( id, "weapon_deagle" );
        cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
    }
    return PLUGIN_HANDLED;
}

public ham_PlayerSpawnPost( id )
{
    if(!is_user_alive( id ) )
        return HAM_IGNORED;
    
    if( is_user_vip( id ) )
    {
        WeaponSelected [ id ] = false;
        
        ShowVIPMenu( id );
        
        cs_set_user_armor( id, 100, CsArmorType:2 );
        
        if( get_user_team( id ) == 2 )
            give_item( id, "item_thighpack" );
    }
    return PLUGIN_HANDLED;
}

public ham_PlayerKilled( iVictim, iAttacker )
{
    if( !iVictim || !iAttacker || !is_user_alive( iAttacker ) )
        return HAM_IGNORED;
        
    if( is_user_vip( iAttacker ) )
    {
        new g_iIsHeadshot = read_data( 3 );
        new g_iHealth = get_user_health( iAttacker );
        new g_iArmor = get_user_armor( iAttacker );
        new g_iHealthAdd = get_pcvar_num( pCvars[ VipHP ] );
        new g_iHealthHSAdd = get_pcvar_num( pCvars[ VipHsHP ] );
        new g_iArmorAdd = get_pcvar_num( pCvars[ VipAP ] );
        new g_iArmorHSAdd = get_pcvar_num( pCvars[ VipHsAP ] );
        new g_iMaxHP = get_pcvar_num( pCvars[ VipMaxHP ] );
        new g_iMaxAP = get_pcvar_num( pCvars[ VipMaxAP ] );
        
        if( g_iIsHeadshot )
        {
            if( g_iHealth >= g_iMaxHP || g_iArmor >= g_iMaxAP )
            {
                set_user_health( iAttacker, g_iMaxHP );
                set_user_armor( iAttacker, g_iMaxAP );
            }
            else
            {
                set_user_health( iAttacker, g_iHealth + g_iHealthHSAdd );
                set_user_armor( iAttacker, g_iHealth + g_iArmorHSAdd );
            }
        }
        else
        {
            if( g_iHealth >= g_iMaxHP || g_iArmor >= g_iMaxAP )
            {
                set_user_health( iAttacker, g_iMaxHP );
                set_user_armor( iAttacker, g_iMaxAP );
            }
            else
            {
                set_user_health( iAttacker, g_iHealth + g_iHealthAdd );
                set_user_armor( iAttacker, g_iHealth + g_iArmorAdd );
            }
        }
    }
    return PLUGIN_HANDLED;
}

public client_PreThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE;
    
    new nbut = get_user_button(id);
    new obut = get_user_oldbutton(id);
    if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
    {
        if( is_user_vip( id ) )
        {
            if(jumpnum[id] < get_pcvar_num( pCvars[ VipJumps ] ))
            {
                dojump[id] = true;
                jumpnum[id]++;
                return PLUGIN_CONTINUE;
            }
        }
    }
    if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        jumpnum[id] = 0;
        return PLUGIN_CONTINUE;
    }
    return PLUGIN_CONTINUE;
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE;
    if( is_user_vip( id ) )
    {
        if(dojump[id] == true)
        {
            new Float:velocity[3]    ;
            entity_get_vector(id,EV_VEC_velocity,velocity);
            velocity[2] = random_float(265.0,285.0);
            entity_set_vector(id,EV_VEC_velocity,velocity);
            dojump[id] = false;
            return PLUGIN_CONTINUE;
        }
    }
    return PLUGIN_CONTINUE;
}

#if defined VIP_CHAT
public hook_say( id )
{
    if( is_user_vip( id ) )
    {
        new szName[ 32 ], szMessage[ 192 ], szPrefix[ 32 ];
        get_user_name( id, szName, charsmax( szName ) );
        get_pcvar_string( pCvars[ VipChatPrefix ], szPrefix, charsmax( szPrefix ) );
        
        read_args( szMessage, charsmax( szMessage ) );
        remove_quotes( szMessage );
        
        if( is_user_alive( id ) )
            color_chat( 0, "!g%s!team %s!y: %s", szPrefix, szName, szMessage );
            
        else if(!is_user_alive( id ) )
            color_chat( 0, "!y*DEAD* !g%s!team %s!y: %s", szPrefix, szName, szMessage );
    }
    else 
    {
        new szName[ 32 ], szMessage[ 192 ];
        get_user_name( id, szName, charsmax( szName ) );

        read_args( szMessage, charsmax( szMessage ) );
        remove_quotes( szMessage );
        
        if( is_user_alive( id ) )
            color_chat( 0, "!team %s!y: %s", szName, szMessage );
            
        else if(!is_user_alive( id ) )
            color_chat( 0, "!y*DEAD* %s!team %s!y: %s", szName, szMessage );
    }
    return PLUGIN_HANDLED;
}

public hook_sayteam( id )
{
    if( is_user_vip( id ) )
    {
        new szName[ 32 ], szMessage[ 192 ], szPrefix[ 32 ];
        get_user_name( id, szName, charsmax( szName ) );
        get_pcvar_string( pCvars[ VipChatPrefix ], szPrefix, charsmax( szPrefix ) );
        
        read_args( szMessage, charsmax( szMessage ) );
        remove_quotes( szMessage );
        if(get_user_team( id ) == 1 )
        {
            if( is_user_alive( id ) )
                color_chat( 0, "!y(Terrorist) !g%s!team %s!y: %s", szPrefix, szName, szMessage );
                
            else if( !is_user_alive( id ) )
                color_chat( 0, "!y*DEAD* (Terrorist) !g%s!team %s!y: %s", szPrefix, szName, szMessage );
        }
        if(get_user_team( id ) == 2 )
        {
            if( is_user_alive( id ) )
                color_chat( 0, "!y(Counter-Terrorist) !g%s!team %s!y: %s", szPrefix, szName, szMessage );
                
            else if( !is_user_alive( id ) )
                color_chat( 0, "!y*DEAD* (Counter-Terrorist) !g%s!team %s!y: %s", szPrefix, szName, szMessage );
        }
    }
    else
    {
        new szName[ 32 ], szMessage[ 192 ];
        get_user_name( id, szName, charsmax( szName ) );
        
        read_args( szMessage, charsmax( szMessage ) );
        remove_quotes( szMessage );
        if(get_user_team( id ) == 1 )
        {
            if( is_user_alive( id ) )
                color_chat( 0, "!y(Terrorist)!team %s!y: %s", szName, szMessage );
                
            else if( !is_user_alive( id ) )
                color_chat( 0, "!y*DEAD* (Terrorist)!team %s!y: %s", szName, szMessage );
        }
        if(get_user_team( id ) == 2 )
        {
            if( is_user_alive( id ) )
                color_chat( 0, "!y(Counter-Terrorist)!team %s!y: %s", szName, szMessage );
                
            else if( !is_user_alive( id ) )
                color_chat( 0, "!y*DEAD* (Counter-Terrorist)!team %s!y: %s", szName, szMessage );
        }
    }
    
    return PLUGIN_HANDLED;
}
#endif

public ShowVIPMotd(id)
{
    if( !is_user_connected( id ) )
        return PLUGIN_HANDLED;
    
    new szString[ 64 ], Temp[ 64 ];
    get_pcvar_string( pCvars[ VipPrices ], szString, charsmax( szString ) );
    
    formatex( Temp, charsmax( Temp ), "addons/amxmodx/configs/%s", szString );
    
    show_motd( id, Temp, "Avantajele VIP-ului" );
    return PLUGIN_HANDLED;
}

stock drop_weapons(id, dropwhat)
{
    // Get user weapons
    new weapons[32], num_weapons, index, weaponid;
    get_user_weapons(id, weapons, num_weapons);
    
    // Loop through them and drop primaries or secondaries
    for (index = 0; index < num_weapons; index++)
    {
        // Prevent re-indexing the array
        weaponid = weapons[index];
        
        if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) 
        || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
        || (dropwhat == 3) && (((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM) || ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            // Get weapon entity
            new wname[32];
            get_weaponname(weaponid, wname, charsmax(wname));
            
            // Player drops the weapon
            engclient_cmd(id, "drop", wname);
        }
    }

stock color_chat( id, const szStr[], any:... ) 
{
    new szMsg[ 191 ], iPlayers[ 32 ], iCount = 1;
    
    vformat( szMsg, charsmax(szMsg), szStr, 3 );
    
    replace_all( szMsg, 190, "!g", "^4" );
    replace_all( szMsg, 190, "!y", "^1" );
    replace_all( szMsg, 190, "!team", "^3" );
    
    if( id )
        iPlayers[ 0 ] = id;

    else 
        get_players( iPlayers, iCount, "ch" );
    
    for( new i = 0 ; i < iCount ; i++ )
    {
        if(is_user_connected( iPlayers[ i ] ) )
        {
            message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[ i ] );
            write_byte( iPlayers[ i ] );
            write_string( szMsg );
            message_end( );
        }
    }
}


7. Poze: RhH1MLk.png
              o40B2R3.png
              AaHnnp0.png
              8fHQw4t.png
              Cpyj3Hx.png

Sursa: extreamCS


Link-uri utile, nu ezita sa le folosesti! 😁
Counter-Strike 1.6 (AMXX) Support - click aici

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...