Raised This Month: $ Target: $400
 0% 

Restrict vipmenu on certain maps!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WarZ
Member
Join Date: Aug 2006
Old 03-18-2012 , 08:25   Restrict vipmenu on certain maps!
Reply With Quote #1

Hi!

I have a VIP-weapon menu. And I want it to be not able to use on certain maps, like fy_buzzkill and 35hp_2.

PHP Code:
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < colorchat >

#define ADMIN_VIP ADMIN_VOTE // Change access to menu here

new g_iCurrentRound;

new 
bool:g_bMenuUsed33 ];

public 
plugin_init()
{
    
register_plugin"Vip Menu""1.0""nikhilgupta345/Byyy" );

    
register_clcmd"say vipmenu","CmdVIPMenu" );
    
register_clcmd"say /vipmenu""CmdVIPMenu" );
    
    
register_clcmd"say /vip""CmdMotd" );
    
register_clcmd"say /admin""CmdMotdadmin" );
    
    
register_clcmd"say /vips""CmdShowVIP" );

    
register_logevent"Event_RoundStart"2"1=Round_Start" );
}

public 
CmdMotdid )
{
    
show_motdid"vip.txt""VIP Information" );
}

public 
CmdMotdadminid )
{
    
show_motdid"admin.txt""ADMIN Information" );
}

public 
Event_RoundStart()
{
    
g_iCurrentRound++;
        
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum );

    new 
iPlayerszName32 ];

    for( new 
0iNumi++ )
    {
        
iPlayer iPlayers];
        
        if( 
get_user_flagsiPlayer ) & ADMIN_VIP )
        {
            
get_user_nameiPlayerszNamecharsmaxszName ) );
            
            
server_cmd"wc3_givexp ^"%s^" 50"szName );
        }
    }
    
    for( new 
0sizeof g_bMenuUsedi++ )
        
g_bMenuUsed] = false;
}

public 
client_connectid )
{
    
g_bMenuUsedid ] = false;
}

public 
CmdVIPMenuid )
{        
    new 
hMenu menu_create"VIP Menu""VIPMenu_Handler" );

    if( 
get_user_flagsid ) & ADMIN_VIP )
        
menu_additemhMenu"Weapon Menu""0" );
    else
        
menu_additemhMenu,  "\dWeapon Menu""0" );
        
    
menu_additemhMenu"Want VIP""1" );
    
menu_additemhMenu"Want ADMIN""2" );

    
menu_displayidhMenu);

    return 
PLUGIN_HANDLED;
}

public 
VIPMenu_HandleridhMenuiItem )
{
    new 
szData], szName64 ];
    new 
iAccesshCallback;
     
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), szNamecharsmaxszName ), hCallback );

    switch( 
str_to_numszData ) )
    {
        case 
0:
        {
            if( !( 
get_user_flagsid ) & ADMIN_VIP ) )
            {
                
ColorChatidNORMAL"[ ^04VIP ^01] You do not have access to this menu." );
                
                return 
PLUGIN_HANDLED;
            }
       
       else if( !
is_user_aliveid ) ) 
            { 
                
ColorChatidNORMAL"[ ^04VIP ^01] You can't use this when you are dead, dumbass." ); 
                return 
PLUGIN_HANDLED
            }
            
            else if( 
g_iCurrentRound )
            {
                
ColorChatidNORMAL"[ ^04VIP ^01] You can't use this until the second round is over." );
                return 
PLUGIN_HANDLED;
            }
            
            else if( 
g_bMenuUsedid ] )
            {
                
ColorChatidNORMAL"[ ^04VIP ^01] You have already used this menu this round!" );
                return 
PLUGIN_HANDLED;
            }
            
            else 
WeaponMenuid );
        }
        
        case 
1show_motdid"vip.txt""VIP Information" );
    case 
2show_motdid"admin.txt""ADMIN Information" );
    }

    
menu_destroyhMenu );
    return 
PLUGIN_HANDLED;
}

public 
WeaponMenuid )
{
    new 
hMenu menu_create"VIP Guns""WeaponMenu_Handler" );
    
menu_additemhMenu"M4A1""1");
    
menu_additemhMenu"AK47""2");
    
menu_additemhMenu"AWP""3");
    
menu_additemhMenu"Clarion""4");
    
menu_additemhMenu"Gailil""5");
    
menu_additemhMenu"D3/AU-1""6");
    
menu_additemhMenu"M249""7");
    
menu_additemhMenu"MP5""8");

    
menu_setprophMenuMPROP_EXITMEXIT_ALL );

    
menu_displayidhMenu);
}

public 
WeaponMenu_HandleridhMenuiItem )
{

    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyhMenu );
        return 
PLUGIN_HANDLED;
    }

    new 
szData], szName64 ];
    new 
iAccesshCallback;
     
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), szNamecharsmaxszName ), hCallback );

    if( 
user_has_weaponidCSW_C4 ) )
    {
        
strip_user_weaponsid );
        
give_itemid"weapon_c4" );
    }
    
    else
        
strip_user_weaponsid );

    switch( 
str_to_numszData ) )
    {
        case 
1
        {
            
give_itemid"weapon_m4a1" );
            
cs_set_user_bpammoidCSW_M4A190 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen M4A1, use it wisely." );
        }
        
        case 
2:
        {
            
give_itemid"weapon_ak47" );
            
cs_set_user_bpammoidCSW_AK4790 );

            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen AK47, use it wisely." );
        }
        case 
3:
        {
            
give_item(id,"weapon_awp")
            
cs_set_user_bpammoidCSW_AWP30 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen AWP, use it wisely." );
        }
    case 
4:
        {
            
give_item(id,"weapon_famas")
            
cs_set_user_bpammoidCSW_FAMAS90 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen Clarion, use it wisely." );
        }
    case 
5:
        {
            
give_item(id,"weapon_galil")
            
cs_set_user_bpammoidCSW_GALIL90 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen Galil, use it wisely." );
        }
    case 
6:
        {
            
give_item(id,"weapon_g3sg1")
            
cs_set_user_bpammoidCSW_G3SG190 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen D3/AU-1, use it wisely." );
        }
    case 
7:
        {
            
give_item(id,"weapon_m249")
            
cs_set_user_bpammoidCSW_M249200 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen M249, use it wisely." );
        }
    case 
8:
        {
            
give_item(id,"weapon_mp5navy")
            
cs_set_user_bpammoidCSW_MP5NAVY120 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
ColorChatidNORMAL"[ ^04VIP ^01] You have chosen MP5, use it wisely." );
        }
    }

    
give_itemid"weapon_knife" );

    
give_itemid"weapon_hegrenade" );

    
give_itemid"item_assaultsuit" );
    
give_itemid"item_thighpack" );

    
g_bMenuUsedid ] = true;

    
menu_destroyhMenu );
    return 
PLUGIN_HANDLED;

}

public 
CmdShowVIPid // Taken from AMX_SUPER
{
    new 
szMessage256 ];

    new 
szVIPNames33 ][ 32 ];
    new 
iCountxiLen;

    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum );

    new 
iPlayer;

    for( new 
0iNumi++ )
    {
        
iPlayer iPlayers];
        
        if( 
get_user_flagsiPlayer ) & ADMIN_VIP )
        {
            
get_user_nameiPlayerszVIPNamesiCount++ ], 31 );
        }
    }

    
iLen formatszMessagecharsmaxszMessage ), "^04 VIPS ONLINE: " );

    if( 
iCount 
    {
        for( 
iCount x++ ) 
        {
            
iLen += formatszMessage[iLen], charsmaxszMessage ) - iLen"%s%s "szVIPNames], < ( iCount ) ? ", " "" );
            if( 
iLen 96 
            {
                
ColorChatidNORMALszMessage );
                
iLen formatszMessage255"^04" );
            }
        }
        
        
ColorChatidNORMALszMessage );
    }

    else 
    {
        
iLen += formatszMessageiLen ], charsmaxszMessage ) - iLen"No vips online." );
        
ColorChatidNORMALszMessage );
    }

Also, add a amx_vote Next map on this menu too.

Please help. Would mean alot!
__________________
WarZ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:28.


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