Raised This Month: $51 Target: $400
 12% 

Need help with plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Janx
New Member
Join Date: Apr 2012
Old 04-08-2012 , 11:02   Need help with plugin
Reply With Quote #1

Hi,

I've tried to do it myself but i'm really new to coding. I've been trying for days. Can someone help me?
I'd like that vips could have green text in chat
that vips could only open weapons menu once in a round.
that vips could use multijump (double-jump)
that vips would get 200$ more when they kill and 300$ more when they kill with headshot
and damage in real time.

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

#define ADMIN_VIP ADMIN_LEVEL_H

new g_iCurrentRound;

new 
g_msgSayText;

new 
bool:g_bMenuUsed33 ];

public 
plugin_init()
{
    
register_plugin"Vip Menu""1.0""nikhilgupta345" );
    
    
register_clcmd"say vipmenu","CmdVIPMenu" );
    
register_clcmd"say /vipmenu""CmdVIPMenu" );
    
    
register_clcmd"say /vips""CmdShowVIP" );
    
    
register_logevent"Event_RoundEnd"2"1=Round_End" );
    
    
g_msgSayText get_user_msgid"SayText" );
}

public 
Event_RoundEnd()
{
    
g_iCurrentRound++;
    
    for( new 
0sizeof g_bMenuUsedi++ )
        
g_bMenuUsed] = false;
        
    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 75"szName );
        }
    }
}

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_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 ) )
            {
                
client_printidprint_chat"You do not have access to this menu." );
                return 
PLUGIN_HANDLED;
            }
            
            else if( 
g_iCurrentRound )
            {
                
client_printidprint_chat"You can't use this until the second round is over." );
                return 
PLUGIN_HANDLED;
            }
            
            else 
WeaponMenuid );
        }
        
        case 
1show_motdid"vip.txt""VIP 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"Famas""4");
    
menu_additemhMenu"AUG""5");
    
menu_additemhMenu"Galil""6");
    
menu_additemhMenu"M249""7");
    
menu_additemhMenu"M3""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 );
    
    
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 );

            
print_messageid"^x04[VIP]^x01 You have chosen m4a1." );
        }
        
        case 
2:
        {
            
give_itemid"weapon_ak47" );
            
cs_set_user_bpammoidCSW_AK4790 );

            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
print_messageid"^x04[VIP]^x01 You have chosen ak47." );
        }
        case 
3:
        {
            
give_item(id,"weapon_awp")
            
cs_set_user_bpammoidCSW_AWP30 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
            
            
print_messageid"^x04[VIP]^x01 You have chosen AWP." );
        }
        case 
4:
        {
            
give_itemid"weapon_famas" );
            
cs_set_user_bpammoidCSW_FAMAS90 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
print_messageid"^x04[VIP]^x01 You have chosen famas." );
        }
        case 
5:
        {
            
give_itemid"weapon_aug" );
            
cs_set_user_bpammoidCSW_AUG90 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
print_messageid"^x04[VIP]^x01 You have chosen AUG." );
        }
        case 
6:
        {
            
give_itemid"weapon_galil" );
            
cs_set_user_bpammoidCSW_GALIL90 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
print_messageid"^x04[VIP]^x01 You have chosen galil." );
        }
        case 
7:
        {
            
give_itemid"weapon_m249" );
            
cs_set_user_bpammoidCSW_M249200 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
print_messageid"^x04[VIP]^x01 You have chosen m249." );
        }
        case 
8:
        {
            
give_itemid"weapon_m3" );
            
cs_set_user_bpammoidCSW_M332 );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLE35 );

            
print_messageid"^x04[VIP]^x01 You have chosen M3." );
        }
            
    }
    
    
give_itemid"weapon_knife" );
    
    
give_itemid"weapon_hegrenade" );
    
give_itemid"weapon_flashbang" );
    
give_itemid"weapon_smokegrenade" );
    
    
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 ), "^x04 VIPS ONLINE: " );
    
    if( 
iCount 
    {
        for( 
iCount x++ ) 
        {
            
iLen += formatszMessage[iLen], charsmaxszMessage ) - iLen"%s%s "szVIPNames], < ( iCount ) ? ", " "" );
            if( 
iLen 96 
            {
                
print_messageidszMessage );
                
iLen formatszMessage255"^x04" );
            }
        }
        
        
print_messageidszMessage );
    }
    
    else 
    {
        
iLen += formatszMessageiLen ], charsmaxszMessage ) - iLen"No admins online." );
        
print_messageidszMessage );
    }
}

print_messageidmsg[] ) 
{
    
message_beginMSG_ONEg_msgSayText, { 00}, id );
    
write_byteid );
    
write_stringmsg );
    
message_end();

thx

Last edited by Janx; 04-08-2012 at 16:04.
Janx 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 20:58.


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