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

Anti Furien Weapon menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 03-24-2013 , 11:53   Anti Furien Weapon menu
Reply With Quote #1

PHP Code:
/****************************************************************************\
            ==============================    
            =     Anti-Furien Weapons    =
            ==============================    

    ---------------------
    -    Description    - 
    ---------------------
    
    This menu include all primary and secondary weapons of CS
    ** Choose Weapons
    ** Last Weapons choosen
    ** Last Weapons choosen + save
             
    ----------------------
    -    Requirements    - 
    ----------------------
    
    ** AMXX: Version 1.8.1
    ** AMXX Modules: Cstrike, Fun and Hamsandwich modules
    
    ----------------------
    -    Installation    - 
    ----------------------
    
    1- Download and compile the plugin from:
    2- Upload the amxx file to your server (cstrike>addons>amxmodx>plugins).
    3- Edit the config file and add the plugin (cstrike>addons>amxmodx>configs>plugins.ini).
    
    ----------------------
    -    Contact Info    - 
    ----------------------
    
    For reporting bugs or post your feedback visit:
     http://forums.alliedmods.net/showthread.php?p=1757094
    
    If you want some private job pm me on alliedmodders forum's or send me and email to:
     [email protected]
    
    -----------------
    -    Credits    -
    -----------------
    
    ** Freestyle
       - Main/Inicial Code
    
    ------------------
    -  Updates Logs  -
    ------------------
    
    ** v1.0 [Jul 2012] 
       - Added Original Options.

\************************************************************************************/

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include "furien.inc"

#define PLUGIN "Anti-Furien Weapons"
#define VERSION "1.0"
#define AUTHOR "Freestyle"

// Weapons Stuff
#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_MP5NAVY)
#define RIFLE_WEAPONS_BIT    (1<<CSW_AK47|1<<CSW_M4A1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ( (1<<%1) & PRIMARY_WEAPONS_BIT )
#define IsSecondaryWeapon(%1) ( (1<<%1) & PISTOL_WEAPONS_BIT )
#define MIN_WEAPON        CSW_P228
#define MAX_WEAPON         CSW_P90
        
new const g_iMaxBPAmmoMAX_WEAPON ] =
{
    
052090132010090112010010090909010012030,
    
12020032901209023590900100
}

new const 
g_szWeaponClassnamesMAX_WEAPON ][ ] =
{
    
"""weapon_hegrenade",
    
"weapon_xm1014""weapon_c4",
    
"weapon_smokegrenade",
    
"weapon_usp""weapon_glock18""weapon_mp5navy",
    
"weapon_m3""weapon_m4a1",
    
"weapon_flashbang""weapon_deagle",
    
"weapon_knife"
}

new const 
g_szWeaponNamesMAX_WEAPON ][ ] =
{
    
"""""XM1014 (Auto-Shotgun)""",
    
"""USP""Glock-18""MP5-Navy",
    
"M3 (Pump-Shotgun)""M4A1""""Deagle",
    
""
}

new 
g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns33 ]
new 
g_iPrimaryWeapon33 ];
new 
g_iSecondaryWeapon33 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
    
register_clcmd"say /guns",     "CmdGunsEnable" );
}

public 
Ham_CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        if( 
furien_get_user_team(id) == AntiFurien )
        {
                if( 
g_bRememberGunsid ] )
                    
GiveWeaponsid );
                
                else if( 
g_iPrimaryWeaponid ] == || g_iSecondaryWeaponid ] == )
                {
                    
menu_displayidg_hPrimaryWeaponMenu );
                }
                
                else 
menu_displayidg_hWeaponMenu );
        }
    }
}

public 
CmdEnableGunsid )
{
    if( 
g_bRememberGunsid ] )
    {
        
client_print(idprint_chat"Your Anti-Furien WeaponsMenu it's now activate." );
        
g_bRememberGunsid ] = false;
    }
    
    else
        
client_print(idprint_chat"Your Anti-Furien WeaponsMenu it's already activate." );
}
    
public 
client_putinserverid )
{
    
g_bRememberGunsid ] = false;
        
    
g_iPrimaryWeaponid ] = 0;
    
g_iSecondaryWeaponid ] = 0;
}

public 
GunsMenu()
{
    
g_hWeaponMenu menu_create"\rWeapons Menu\w""WeaponMainMenu_Handler" );
    
menu_additemg_hWeaponMenu"New Weapons""0" );
    
menu_additemg_hWeaponMenu"Last Weapons""1" );
    
menu_additemg_hWeaponMenu"2 + Dont ask again""2" );
        
    
g_hPrimaryWeaponMenu menu_create"\rWeapons Menu^n\yChoose your Primary Weapon:\w""PrimaryWeapons_Handler" );
    
g_hSecondaryWeaponMenu menu_create"\rWeapons Menu^n\yChoose your Secondary Weapon:\w""SecondaryWeapons_Handler" );
    
    new 
szInfo];
    for( new 
MIN_WEAPON<= MAX_WEAPONi++ )
    {
        if( 
IsPrimaryWeapon) )
        {
            
num_to_striszInfocharsmaxszInfo ) );
            
menu_additemg_hPrimaryWeaponMenug_szWeaponNames], szInfo );
        }
        
        else if( 
IsSecondaryWeapon) )
        {
            
num_to_striszInfocharsmaxszInfo ) );
            
menu_additemg_hSecondaryWeaponMenug_szWeaponNames], szInfo );
        }
            
        else continue;
    }
}

public 
WeaponMainMenu_HandleridhMenuiItem )
{
    switch( 
iItem )
    {
        case 
0menu_displayidg_hPrimaryWeaponMenu);
        case 
1
        {
            
GiveWeaponsid );
        }
            
        case 
2
        {
            
GiveWeaponsid );
            
g_bRememberGunsid ] = true;
            
client_print(idprint_chat"Weapons choice has been save, for this menu open again type in chat /guns" );
        }
    }
}

public 
PrimaryWeapons_HandleridhMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {    
        
menu_destroy(hMenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iAccesshCallback;
    new 
szData];
    
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), __hCallback );
        
    
g_iPrimaryWeaponid ] = str_to_numszData );

    
menu_displayidg_hSecondaryWeaponMenu);
        
    return 
PLUGIN_HANDLED;
}

public 
SecondaryWeapons_HandleridhMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroy(hMenu);
        return 
PLUGIN_HANDLED;
    }
        
    new 
iAccesshCallback;
    new 
szData];
    
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), __hCallback );
    
    
g_iSecondaryWeaponid ] = str_to_numszData );

    
GiveWeaponsid );
        
    return 
PLUGIN_HANDLED;
}

GiveWeaponsid )
{
    new 
iPrimary g_iPrimaryWeaponid ];
    new 
iSecondary g_iSecondaryWeaponid ];
        
    
give_itemidg_szWeaponClassnamesiPrimary ] );
    
give_itemidg_szWeaponClassnamesiSecondary ] );
        
    
cs_set_user_bpammoidiPrimaryg_iMaxBPAmmoiPrimary ] );
    
cs_set_user_bpammoidiSecondaryg_iMaxBPAmmoiSecondary ] );
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/ 
What it's wrong on this plugin?I tried to delete some gun but doesn't work.

This is the original .sma:
PHP Code:
/****************************************************************************\
            ==============================    
            =     Anti-Furien Weapons    =
            ==============================    

    ---------------------
    -    Description    - 
    ---------------------
    
    This menu include all primary and secondary weapons of CS
    ** Choose Weapons
    ** Last Weapons choosen
    ** Last Weapons choosen + save
             
    ----------------------
    -    Requirements    - 
    ----------------------
    
    ** AMXX: Version 1.8.1
    ** AMXX Modules: Cstrike, Fun and Hamsandwich modules
    
    ----------------------
    -    Installation    - 
    ----------------------
    
    1- Download and compile the plugin from:
    2- Upload the amxx file to your server (cstrike>addons>amxmodx>plugins).
    3- Edit the config file and add the plugin (cstrike>addons>amxmodx>configs>plugins.ini).
    
    ----------------------
    -    Contact Info    - 
    ----------------------
    
    For reporting bugs or post your feedback visit:
     http://forums.alliedmods.net/showthread.php?p=1757094
    
    If you want some private job pm me on alliedmodders forum's or send me and email to:
     [email protected]
    
    -----------------
    -    Credits    -
    -----------------
    
    ** Freestyle
       - Main/Inicial Code
    
    ------------------
    -  Updates Logs  -
    ------------------
    
    ** v1.0 [Jul 2012] 
       - Added Original Options.

\************************************************************************************/

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include "furien.inc"

#define PLUGIN "Anti-Furien Weapons"
#define VERSION "1.0"
#define AUTHOR "Freestyle"

// Weapons Stuff
#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT    (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ( (1<<%1) & PRIMARY_WEAPONS_BIT )
#define IsSecondaryWeapon(%1) ( (1<<%1) & PISTOL_WEAPONS_BIT )
#define MIN_WEAPON        CSW_P228
#define MAX_WEAPON         CSW_P90
        
new const g_iMaxBPAmmoMAX_WEAPON ] =
{
    
052090132010090112010010090909010012030,
    
12020032901209023590900100
}

new const 
g_szWeaponClassnamesMAX_WEAPON ][ ] =
{
    
"""weapon_p228""""weapon_scout""weapon_hegrenade",
    
"weapon_xm1014""weapon_c4""weapon_mac10""weapon_aug",
    
"weapon_smokegrenade""weapon_elite""weapon_fiveseven",
    
"weapon_ump45""weapon_sg550""weapon_galil""weapon_famas",
    
"weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy",
    
"weapon_m249""weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1",
    
"weapon_flashbang""weapon_deagle""weapon_sg552""weapon_ak47",
    
"weapon_knife""weapon_p90"
}

new const 
g_szWeaponNamesMAX_WEAPON ][ ] =
{
    
"""P228""""Schmidt Scout""""XM1014 (Auto-Shotgun)""",
    
"Mac-10""AUG""""Dual Elites""Five-Seven""UMP-45""SG-550",
    
"Galil""Famas""USP""Glock-18""AWP""MP5-Navy""M249 (Para)",
    
"M3 (Pump-Shotgun)""M4A1""TMP""G3SG1""""Deagle""SG-552",
    
"AK-47""""P90"
}

new 
g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns33 ]
new 
g_iPrimaryWeapon33 ];
new 
g_iSecondaryWeapon33 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
    
register_clcmd"say /guns",     "CmdGunsEnable" );
}

public 
Ham_CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        if( 
furien_get_user_team(id) == AntiFurien )
        {
                if( 
g_bRememberGunsid ] )
                    
GiveWeaponsid );
                
                else if( 
g_iPrimaryWeaponid ] == || g_iSecondaryWeaponid ] == )
                {
                    
menu_displayidg_hPrimaryWeaponMenu );
                }
                
                else 
menu_displayidg_hWeaponMenu );
        }
    }
}

public 
CmdEnableGunsid )
{
    if( 
g_bRememberGunsid ] )
    {
        
client_print(idprint_chat"Your Anti-Furien WeaponsMenu it's now activate." );
        
g_bRememberGunsid ] = false;
    }
    
    else
        
client_print(idprint_chat"Your Anti-Furien WeaponsMenu it's already activate." );
}
    
public 
client_putinserverid )
{
    
g_bRememberGunsid ] = false;
        
    
g_iPrimaryWeaponid ] = 0;
    
g_iSecondaryWeaponid ] = 0;
}

public 
GunsMenu()
{
    
g_hWeaponMenu menu_create"\rWeapons Menu\w""WeaponMainMenu_Handler" );
    
menu_additemg_hWeaponMenu"New Weapons""0" );
    
menu_additemg_hWeaponMenu"Last Weapons""1" );
    
menu_additemg_hWeaponMenu"2 + Dont ask again""2" );
        
    
g_hPrimaryWeaponMenu menu_create"\rWeapons Menu^n\yChoose your Primary Weapon:\w""PrimaryWeapons_Handler" );
    
g_hSecondaryWeaponMenu menu_create"\rWeapons Menu^n\yChoose your Secondary Weapon:\w""SecondaryWeapons_Handler" );
    
    new 
szInfo];
    for( new 
MIN_WEAPON<= MAX_WEAPONi++ )
    {
        if( 
IsPrimaryWeapon) )
        {
            
num_to_striszInfocharsmaxszInfo ) );
            
menu_additemg_hPrimaryWeaponMenug_szWeaponNames], szInfo );
        }
        
        else if( 
IsSecondaryWeapon) )
        {
            
num_to_striszInfocharsmaxszInfo ) );
            
menu_additemg_hSecondaryWeaponMenug_szWeaponNames], szInfo );
        }
            
        else continue;
    }
}

public 
WeaponMainMenu_HandleridhMenuiItem )
{
    switch( 
iItem )
    {
        case 
0menu_displayidg_hPrimaryWeaponMenu);
        case 
1
        {
            
GiveWeaponsid );
        }
            
        case 
2
        {
            
GiveWeaponsid );
            
g_bRememberGunsid ] = true;
            
client_print(idprint_chat"Weapons choice has been save, for this menu open again type in chat /guns" );
        }
    }
}

public 
PrimaryWeapons_HandleridhMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {    
        
menu_destroy(hMenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iAccesshCallback;
    new 
szData];
    
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), __hCallback );
        
    
g_iPrimaryWeaponid ] = str_to_numszData );

    
menu_displayidg_hSecondaryWeaponMenu);
        
    return 
PLUGIN_HANDLED;
}

public 
SecondaryWeapons_HandleridhMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroy(hMenu);
        return 
PLUGIN_HANDLED;
    }
        
    new 
iAccesshCallback;
    new 
szData];
    
    
menu_item_getinfohMenuiItemiAccessszDatacharsmaxszData ), __hCallback );
    
    
g_iSecondaryWeaponid ] = str_to_numszData );

    
GiveWeaponsid );
        
    return 
PLUGIN_HANDLED;
}

GiveWeaponsid )
{
    new 
iPrimary g_iPrimaryWeaponid ];
    new 
iSecondary g_iSecondaryWeaponid ];
        
    
give_itemidg_szWeaponClassnamesiPrimary ] );
    
give_itemidg_szWeaponClassnamesiSecondary ] );
        
    
cs_set_user_bpammoidiPrimaryg_iMaxBPAmmoiPrimary ] );
    
cs_set_user_bpammoidiSecondaryg_iMaxBPAmmoiSecondary ] );
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/ 
But i want to keep in menu just Golck,USP,DEAGLE,MP5,M3,XM1014,AK47 and M4A1.

Also...how can I add in shop "Buy 50 health" ?

PHP Code:
/*    Formatright © 2010, ConnorMcLeod

    Furien Shop is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Furien Shop; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>

#include "furien.inc"
#include "furien_shop.inc"

new const szPickAmmoSound[] = "items/9mmclip1.wav"

enum _:ItemDatas
{
    
m_szItemName[32],
    
m_iItemCost,
    
m_iItemForwardIndex,
    
m_iItemExtraArg
}

enum ( <<= )
{
    
ShouldBeInBuyZone 1,
    
ShouldBeInBuyTime
}

#define HUD_PRINTCENTER        4

new g_iBlinkAcctg_iTextMsg

new g_iBuyTypeg_pCvarBuyTime

new Array:g_aItems[2]
new 
g_iMenuId[2] = {-1, -1}

new 
bool:g_bFreezeTime truebool:g_bBuyTime true
new bool:g_bSwitchTime
new Float:g_flRoundStartGameTime

public plugin_init()
{
    
register_plugin("Furien Shop"FURIEN_VERSION"ConnorMcLeod")

    
register_dictionary("common.txt")

    new 
pCvar register_cvar("furien_shop_version"FURIEN_VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
set_pcvar_string(pCvarFURIEN_VERSION)

    
ReadCfgFile()

    if( 
g_iBuyType ShouldBeInBuyZone )
    {
        
register_event("StatusIcon""Event_StatusIcon_OutOfBuyZone""b""1=0""2=buyzone")
    }

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
register_logevent("LogEvent_Round_Start"2"1=Round_Start")

    
register_clcmd("shop""ClientCommand_Shop")
    
register_clcmd("say shop""ClientCommand_Shop")
    
register_clcmd("say_team shop""ClientCommand_Shop")
    
register_clcmd("buy""ClientCommand_Shop")

    
g_iBlinkAcct get_user_msgid("BlinkAcct")
    
g_iTextMsg get_user_msgid("TextMsg")
    
g_pCvarBuyTime get_cvar_pointer("mp_buytime")
}

ReadCfgFile()
{
    new 
szConfigFile[128]
    
get_localinfo("amxx_configsdir"szConfigFilecharsmax(szConfigFile))
    
format(szConfigFilecharsmax(szConfigFile), "%s/furien/shop.ini"szConfigFile);

    new 
fp fopen(szConfigFile"rt")
    if( !
fp )
    {
        return
    }

    new 
szDatas[32], szKey[16], szValue[16]
    while( !
feof(fp) )
    {
        
fgets(fpszDatascharsmax(szDatas))
        
trim(szDatas)
        if(!
szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
        {
            continue
        }

        
parse(szDatasszKeycharsmax(szKey), szValuecharsmax(szValue))

        switch( 
szKey[0] )
        {
            case 
'B':
            {
                if( 
equal(szKey"BUY_TYPE" ) )
                {
                    
g_iBuyType str_to_num(szValue)
                }
            }
        }
    }
    
fclosefp )
}

public 
plugin_precache()
{
    
precache_sound(szPickAmmoSound)
}

public 
Event_HLTV_New_Round()
{
    
g_bFreezeTime true
    g_bBuyTime 
true
    g_bSwitchTime 
false
}

public 
LogEvent_Round_Start()
{
    
g_bFreezeTime false
    g_bBuyTime 
true
    g_bSwitchTime 
false
    g_flRoundStartGameTime 
get_gametime()
}

bool:bIsBuyTimeid )
{
    new 
Float:flBuyTime
    
if(    !g_bFreezeTime
    
&&    ( !g_bBuyTime || !(g_bBuyTime get_gametime() < g_flRoundStartGameTime + (flBuyTime get_buytime_value() * 60.0)) )    )
    {
        if( 
id )
        {
            new 
szBuyTime[3]
            
float_to_str(flBuyTimeszBuyTimecharsmax(szBuyTime))
            
Util_ClientPrint(idHUD_PRINTCENTER"#Cant_buy"szBuyTime)
        }
        return 
false
    
}
    return 
true
}

Float:get_buytime_value()
{
    new 
Float:flBuyTime get_pcvar_float(g_pCvarBuyTime)
    if( 
flBuyTime 0.25 )
    {
        
set_pcvar_float(g_pCvarBuyTime0.25)
        
flBuyTime 0.25
    
}
    if( 
flBuyTime 1.5 )
    {
        
set_pcvar_float(g_pCvarBuyTime1.5)
        
flBuyTime 1.5
    
}
    return 
flBuyTime
}

public 
furien_team_change()
{
    
g_bSwitchTime true

    
new iPlayers[32], iNum
    get_players
(iPlayersiNum"a")
    for(new 
ii<iNumi++)
    {
        
CheckMenuClose(iPlayers[i])
    }
}

public 
Event_StatusIcon_OutOfBuyZoneid )
{
    
CheckMenuClose(id)
}

CheckMenuClose(id)
{
    new 
iCrapiMenuId
    player_menu_info
(idiCrapiMenuId)
    if( 
iMenuId > -&& (iMenuId == g_iMenuId[Furien] || iMenuId == g_iMenuId[AntiFurien]) )
    {
        
menu_cancel(id)
    }
}

public 
plugin_natives()
{
    
register_library("furien_shop")
    
register_native("furien_register_item""fr_register_item")
}

public 
fr_register_item(iPlugin)
{
    new 
mDatas[ItemDatas], szCallBack[32]

    
get_string(5szCallBackcharsmax(szCallBack))
    
mDatas[m_iItemForwardIndex] = CreateOneForward(iPluginszCallBackFP_CELLFP_CELL)

    
mDatas[m_iItemExtraArg] = get_param(6)

    if( (
mDatas[m_iItemCost] = get_param(2)) > )
    {
        
get_string(1mDatas[m_szItemName], charsmax(mDatas[m_szItemName]))
        
AddItemToMenuFurien mDatas )
    }

    if( (
mDatas[m_iItemCost] = get_param(4)) > )
    {
        
get_string(3mDatas[m_szItemName], charsmax(mDatas[m_szItemName]))
        
AddItemToMenuAntiFurien mDatas )
    }

    return 
mDatas[m_iItemForwardIndex]
}

AddItemToMenuiTeam mDatas[ItemDatas] )
{
    new Array:
iArray g_aItems[iTeam]
    if( 
iArray == Invalid_Array )
    {
        
iArray g_aItems[iTeam] = ArrayCreate(ItemDatas)
    }

    new 
iMenu g_iMenuId[iTeam]
    if( 
iMenu == -)
    {
        new 
szMenuNames[][] = {"Furien Shop""AntiFurien Shop"}
        new 
szHandlers[][] = {"FurienMenuHandler""AntiMenuHandler"}
        
iMenu g_iMenuId[iTeam] = menu_create(szMenuNames[iTeam], szHandlers[iTeam])
        
menu_setprop(iMenuMPROP_NUMBER_COLOR"\y")
    }

    
ArrayPushArray(iArraymDatas)
    new 
szItemInformation[64]
    
formatex(szItemInformationcharsmax(szItemInformation), "%s\R\y$%d"mDatas[m_szItemName], mDatas[m_iItemCost])
    
menu_additem(iMenuszItemInformation)
}

public 
ClientCommand_Shopid )
{
    if( !
g_bSwitchTime && is_user_alive(id) )
    {
        if( !
bCanBuyid ) )
        {
            return 
PLUGIN_HANDLED_MAIN
        
}

        
ShowShopMenu(id)
        return 
PLUGIN_CONTINUE
    
}

    return 
PLUGIN_HANDLED_MAIN
}

bCanBuyid )
{
    if(    ( 
g_iBuyType ShouldBeInBuyZone && !cs_get_user_buyzone(id) )
    ||    ( 
g_iBuyType ShouldBeInBuyTime && !bIsBuyTime(id) )    )
    {
        return 
false
    
}

    return 
true
}

ShowShopMenu(id)
{
    new 
iTeam furien_get_user_team(id)
    
menu_display(idg_iMenuId[iTeam])
}

public 
FurienMenuHandler(idiMenuiItem)
{
    if( 
iItem MENU_MORE && is_user_alive(id) && furien_get_user_team(id) == Furien && bCanBuyid ) )
    {
        new 
mDatas[ItemDatas]
        
ArrayGetArray(Array:g_aItems[Furien], iItemmDatas)
        Function(
mDatasid)
    }
}

public 
AntiMenuHandler(idiMenuiItem)
{
    if( 
iItem MENU_MORE && is_user_alive(id) && furien_get_user_team(id) == AntiFurien && bCanBuyid ) )
    {
        new 
mDatas[ItemDatas]
        
ArrayGetArray(Array:g_aItems[AntiFurien], iItemmDatas)
        Function(
mDatasid)
    }
}

Function(
mDatas[ItemDatas], id)
{
    new 
iRet
    ExecuteForward
(mDatas[m_iItemForwardIndex], iRetidmDatas[m_iItemExtraArg])
    switch( 
iRet )
    {
        case 
ShopBought:
        {
            
emit_sound(idCHAN_ITEMszPickAmmoSoundVOL_NORMATTN_NORM0PITCH_NORM)
            return 
1
        
}
        case 
ShopTeamNotAvail:
        {
            
Util_ClientPrint
            
(
                
id,
                
HUD_PRINTCENTER,
                
"#Alias_Not_Avail",
                
mDatasm_szItemName ]
            )
        }
        case 
ShopNotEnoughMoney:
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Not_Enough_Money")

            
message_begin(MSG_ONE_UNRELIABLEg_iBlinkAcct, .player=id)
            {
                
write_byte(2)
            }
            
message_end()
        }
        case 
ShopAlreadyHaveOne:
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Already_Have_One")
        }
        case 
ShopCantCarryAnymore:
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Cannot_Carry_Anymore")
        }
        case 
ShopCannotBuyThis:
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Cannot_Buy_This")
        }
        case 
ShopCloseMenu:
        {
            return 
1
        
}
    }
    return 
0
}

// Only submessage1 is used but fully implemented for example.
// Based on HLSDK ClientPrint and UTIL_ClientPrintAll from util.cpp
Util_ClientPrint(idiMsgDestszMessage[], szSubMessage1[] = ""szSubMessage2[] = ""szSubMessage3[] = ""szSubMessage4[] = "")
{
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTg_iTextMsg, .player=id)
    {
        
write_byte(iMsgDest)
        
write_string(szMessage)
        if( 
szSubMessage1[0] )
        {
            
write_string(szSubMessage1)
        }
        if( 
szSubMessage2[0] )
        {
            
write_string(szSubMessage2)
        }
        if( 
szSubMessage3[0] )
        {
            
write_string(szSubMessage3)
        }
        if( 
szSubMessage4[0] )
        {
            
write_string(szSubMessage4)
        }
    }
    
message_end()
}

////// client_print //////
// #Cstrike_TitlesTXT_Cannot_Buy_This        "You cannot buy this item!"
// #Cstrike_TitlesTXT_Cannot_Carry_Anymore    "You cannot carry anymore!"
// #Cstrike_Already_Own_Weapon            "You already own that weapon."
// #Cstrike_TitlesTXT_Weapon_Not_Available    "This weapon is not available to you!"
// #Cstrike_TitlesTXT_Not_Enough_Money        "You have insufficient funds!"
// #Cstrike_TitlesTXT_CT_cant_buy            "CTs aren't allowed to buy"
// #Cstrike_TitlesTXT_Terrorist_cant_buy    "Terrorists aren't allowed to buy anything on this map!"
// #Cstrike_TitlesTXT_VIP_cant_buy            "You are the VIP. You can't buy anything!"

////// Util_ClientPrint ///////
// #Cstrike_TitlesTXT_Alias_Not_Avail + szWeapon        "The \"%s1\"is not available for your team to buy."
// #Cstrike_TitlesTXT_Cant_buy + szSeconds            "%s1 seconds have passed. You can't buy anything now!" 
Ty!
Bladell is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 03-26-2013 , 11:42   Re: Anti Furien Weapon menu
Reply With Quote #2

Solved with antii furien wepons menu...
But I don't know how can I add to shop BuyHp, Wallhang, BuyAp, Bunnyhop and maybe MultiJump.
Bladell is offline
Adryyy
Member
Join Date: Oct 2011
Old 06-28-2014 , 17:33   Re: Anti Furien Weapon menu
Reply With Quote #3

Really author freestyle ? )) no, author is Askhanar, damn
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
4dead
Member
Join Date: Jun 2012
Old 06-28-2014 , 20:34   Re: Anti Furien Weapon menu
Reply With Quote #4

Quote:
Originally Posted by Bladell View Post
Solved with antii furien wepons menu...
But I don't know how can I add to shop BuyHp, Wallhang, BuyAp, Bunnyhop and maybe MultiJump.
If your using connors's mod
You should add the plugin of the item in your plugins.ini
Example:
Quote:
furien_armor.amxx
furien_defusekit.amxx
furien_nightvision.amx
furien_shop.amxx
furien_health.amxx
furien_wallhang.amxx
furien_parachute.amxx
furien_noflash.amxx
furien_superknife.amxx
__________________
Too old
4dead 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:38.


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