eyal282 icon

Guard Weapons Menu

eyal282 | PRO | 01/15/13 01:56:58 PM UTC | 0 ⭐ | 706 👁️ | Never ⏰ | []
Pawn |

3.77 KB

|

None

|

0 👍

/

0 👎

/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
 
#define PLUGIN "Advanced Guard Weapons"
#define VERSION "1.0"
#define AUTHOR "Eyal"
 
new Weapon[33][ 100 ], Weapon2[33][ 100 ], Gun[33][ 100 ], Gun2[33][ 100 ], M4A1[33], AK47[33], MECHINEGUN[33], SHOTGUN[33], USP[33], GLOCK[33], FIVESEVEN[33], DEAGLE[33], grenadenum[33];
 
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawn", 1)
}
public FwdHamPlayerSpawn(id) {
    if(is_user_connected(id) && is_user_alive(id)) {
    fm_strip_user_weapons(id)
    fm_give_item(id, "weapon_knife")
    if(cs_get_user_team(id) == CS_TEAM_CT) {
    WeaponMenu(id)
        }
    }
}
public WeaponMenu(id)
{
    if(cs_get_user_team(id) == CS_TEAM_CT) {
    new ChooseWeapon = menu_create("\r[\w Extreme Jail \r]\y Choose Your Weapon", "sub_Weapon_Choosed");
    new GUN[ 100 ];                          
    formatex( GUN, charsmax( GUN ), "\yWeapon -\r [\d %s \r]", Weapon[id] );
    menu_additem( ChooseWeapon, GUN, "1" );
    formatex( GUN, charsmax( GUN ), "\yGun -\r [\d %s \r]", Gun[id]);
    menu_additem( ChooseWeapon, GUN, "2" );
    formatex( GUN, charsmax( GUN ), "\yGrenade Amount -\r [\d %i \r]^n", grenadenum[id]);
    menu_additem( ChooseWeapon, GUN, "3" );
    formatex( GUN, charsmax( GUN ), "\yDone");
    menu_additem( ChooseWeapon, GUN, "4" );
    
    
    menu_display(id, ChooseWeapon);
    }
    return PLUGIN_HANDLED;
    }
public sub_Weapon_Choosed(id, ChooseWeapon, item)
{
    if(item == MENU_EXIT)
        return
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(ChooseWeapon, item, access, data, 6, iName, 63, callback)
    
    new key = str_to_num(data)
    switch(key)
    {
        case 1:
        {
        if(M4A1[id]) {
        Weapon[id] = "AK47"
        Weapon2[id] = "weapon_ak47"
        M4A1[id] = false
        AK47[id] = true
        }
        else if(AK47[id]) {
        Weapon[id] = "MECHINEGUN"
        Weapon2[id] = "weapon_m249"
        Weapon3[id] = "ammo_m249"
        AK47[id] = false
        MECHINEGUN[id] = true
        }
        else if(MECHINEGUN[id]) {
        Weapon[id] = "SHOTGUN"
        Weapon2[id] = "weapon_m3"
        MECHINEGUN[id] = false
        SHOTGUN[id] = true
        }
        else if(SHOTGUN[id]) {
        Weapon[id] = "M4A1"
        Weapon2[id] = "weapon_m4a1"
        SHOTGUN[id] = false
        M4A1[id] = true
            }
        }
        case 2:
        {
        if(USP[id]) {
        Gun[id] = "GLOCK"
        Gun2[id] = "weapon_glock18"
        Gun3[id] = "ammo_glock18"
        USP[id] = false
        GLOCK[id] = true
        }
        else if(GLOCK[id]) {
        Gun[id] = "FIVESEVEN"
        Gun2[id] = "weapon_fiveseven"
        GLOCK[id] = false
        FIVESEVEN[id] = true
        }
        else if(FIVESEVEN[id]) {
        Gun[id] = "DEAGLE"
        Gun2[id] = "weapon_deagle"
        Gun3[id] = "ammo_deagle"
        FIVESEVEN[id] = false
        DEAGLE[id] = true
        }
        else if(DEAGLE[id]) {
        Gun[id] = "USP"
        Gun2[id] = "weapon_usp"
        DEAGLE[id] = false
        USP[id] = true
            }
        }
        case 3:
        {
        if(grenadenum[id] > 1)
        grenadenum[id] = 0
        else 
        grenadenum[id]++
        }
        case 4: 
        {
        GiveWeapons(id)
        }
        }
    if(key != 4)
    WeaponMenu(id)
}
public GiveWeapons(id)
{
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
fm_give_item(id, Weapon2[id])
fm_give_item(id, Gun2[id])
fm_give_item(id, "weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, grenadenum[id])
if(M4A1[id])
cs_set_user_bpammo(id, CSW_M4A1, 500)
else if(AK47[id])
cs_set_user_bpammo(id, CSW_AK47, 500)
else if(MECHINEGUN[id])
cs_set_user_bpammo(id, CSW_M249, 500)
else if(SHOTGUN[id])
cs_set_user_bpammo(id, CSW_M3, 500)
if(GLOCK[id])
cs_set_user_bpammo(id, CSW_GLOCK18, 500)
else if(USP[id])
cs_set_user_bpammo(id, CSW_GLOCK18, 500)
else if(FIVESEVEN[id])
cs_set_user_bpammo(id, CSW_FIVESEVEN, 500)
else if(DEAGLE[id])
cs_set_user_bpammo(id, CSW_DEAGLE, 500)
}

Comments