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

[REQ] 6 Guns for CTs ONLY + Disarm Terrorists


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheSpirit
BANNED
Join Date: Apr 2010
Location: Canada WTF LOL
Old 05-25-2011 , 18:08   [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #1

Can someone make this please?

All CT players get a Menu that pops up after the round start and choose 1 gun for the whole round.

+ Auto Disarm all Terrorists when they have a gun

M4A1
Auto Shotgun
AK47
Shotgun
AWP
TMP

Last edited by TheSpirit; 05-25-2011 at 18:13.
TheSpirit is offline
stevenisecko138
Senior Member
Join Date: Dec 2008
Location: CA
Old 05-25-2011 , 19:30   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #2

Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fun >
#include < hamsandwich >

#define PLUGIN "6 ct guns + strip for ts and cts"
#define VERSION "1.0.0"
#define AUTHOR "EcKo"


public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    RegisterHam( Ham_Spawn, "player" , "CtPlayerspawn" , 1 );
}

public CtPlayerspawn( id )
{
    if( is_user_alive( id ) )
    {
        strip_user_weapons( id );
        if( cs_get_user_team( id ) == CS_TEAM_CT )
        {
            ctgun_menu( id );
        }
    }
}

public ctgun_menu( id )
{    
    if( is_user_alive( id ) )
        return PLUGIN_HANDLED;
        
    new ctgunmenu = menu_create( "\yChoose your weapon:", "sub_primgun_menu" )

    menu_additem( ctgunmenu, "\wM4a1", "1", 0 );
    menu_additem( ctgunmenu, "\wAk-47", "2", 0 );
    menu_additem( ctgunmenu, "\wAuto-Shotgun", "3", 0 );
    menu_additem( ctgunmenu, "\wAwp", "4", 0 );
    menu_additem( ctgunmenu, "\wTmp", "5", 0 );
    menu_additem( ctgunmenu, "\wM3", "6", 0 );
        
    menu_setprop( ctgunmenu, MPROP_EXIT, MEXIT_ALL );
    menu_display( id, ctgunmenu, 0 );
    return PLUGIN_HANDLED;
}    

public sub_primgun_menu( id, ctgunmenu, item )
{
    
    if (item == MENU_EXIT)
    {
        menu_destroy( ctgunmenu );
        return PLUGIN_HANDLED;
    }
    
    new Data[7], Name[64];
    new Access, Callback;
    menu_item_getinfo(ctgunmenu, item, Access, Data,5, Name, 63, Callback);
    
    new Key = str_to_num(Data);
    
    switch (Key)
    {
        case 1:
        {
            ctgun1( id );
        }
        case 2: 
        {
            ctgun2( id );
        }
        case 3:
        {
            ctgun3( id );
        }
        case 4:
        {
            ctgun4( id );
        }
        case 5:
        {
            ctgun5( id );
        }
        case 6:
        {
            ctgun6( id );
        }
    }
    
    menu_destroy( ctgunmenu );
    return PLUGIN_HANDLED;
}

public ctgun1( id )
{
    give_item( id, "weapon_m4a1" );
    cs_set_user_bpammo( id, CSW_M4A1, 200 );
}

public ctgun2( id )
{
    give_item( id, "weapon_ak47" );
    cs_set_user_bpammo( id, CSW_AK47, 200 );
}

public ctgun3( id )
{
    give_item( id, "weapon_xm1014" );
    cs_set_user_bpammo( id, CSW_XM1014, 200 );
}

public ctgun4( id )
{
    give_item( id, "weapon_awp" );
    cs_set_user_bpammo( id, CSW_AWP, 200 );
}    

public ctgun5( id )
{
    give_item( id, "weapon_tmp" );
    cs_set_user_bpammo( id, CSW_TMP, 200 );
}
public ctgun6( id )
{
    give_item( id, "weapon_m3" );
    cs_set_user_bpammo( id, CSW_M3, 200 );
}
dont know if it works but compiled fine ;)

Last edited by stevenisecko138; 05-25-2011 at 20:38.
stevenisecko138 is offline
Send a message via AIM to stevenisecko138
TheSpirit
BANNED
Join Date: Apr 2010
Location: Canada WTF LOL
Old 05-25-2011 , 20:05   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #3

Ecko, since when you started coding? good to see you here buddy
TheSpirit is offline
TheSpirit
BANNED
Join Date: Apr 2010
Location: Canada WTF LOL
Old 05-25-2011 , 20:06   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #4

Got some errors:

/tmp/text0XfO7u.sma(101) : error 017: undefined symbol "ctgun5"
/tmp/text0XfO7u.sma(105) : error 017: undefined symbol "ctgun6"
TheSpirit is offline
stevenisecko138
Senior Member
Join Date: Dec 2008
Location: CA
Old 05-25-2011 , 20:22   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #5

Quote:
Originally Posted by TheSpirit View Post
Got some errors:

/tmp/text0XfO7u.sma(101) : error 017: undefined symbol "ctgun5"
/tmp/text0XfO7u.sma(105) : error 017: undefined symbol "ctgun6"
i think i fixed them right now check the code out again
stevenisecko138 is offline
Send a message via AIM to stevenisecko138
TheSpirit
BANNED
Join Date: Apr 2010
Location: Canada WTF LOL
Old 05-25-2011 , 20:35   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #6

Compiled.

But it doesn't work for some reason...
TheSpirit is offline
stevenisecko138
Senior Member
Join Date: Dec 2008
Location: CA
Old 05-25-2011 , 20:38   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #7

Quote:
Originally Posted by TheSpirit View Post
Compiled.

But it doesn't work for some reason...
opps made a boo boo i fixed it tho should work 100% now
stevenisecko138 is offline
Send a message via AIM to stevenisecko138
TheSpirit
BANNED
Join Date: Apr 2010
Location: Canada WTF LOL
Old 05-25-2011 , 20:45   Re: [REQ] 6 Guns for CTs ONLY + Disarm Terrorists
Reply With Quote #8

Works

Thank you Ecko
TheSpirit is offline
Reply


Thread Tools
Display Modes

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 03:10.


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