Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSAdd flag on this plugin


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hello!
Can someone help me to add access to this plugin only on the "x" flag, and if the one who does not have this flag uses the command to display a colored message [TAG] You do not have access to this command!

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <colorchat>
#include <fakemeta>

native fcs_get_user_creditsid )
native fcs_set_user_creditsidamount )

new 
g_bitOwned_M4A133 ], g_iEquipped_M4A133 ]
new 
g_bitOwned_AK4733 ], g_iEquipped_AK4733 ]
new 
g_bitOwned_AWP33 ], g_iEquipped_AWP33 ]
new 
g_bitOwned_Deagle33 ], g_iEquipped_Deagle33 ]
new 
g_bitOwned_Knife33 ], g_iEquipped_Knife33 ]

#define BIT(%0) (1<<%0)

new g_iHisMenu33 ]

enum _:skin_e
{
    
ITEM_NAME32 ],
    
ITEM_CREDITS,
    
ITEM_MODEL64 ]
}
new const 
M4A1_Stuff[][ skin_e ] =
{
    { 
"Default M4A1" },
    { 
"M4A1 | Decimator"250"models/alexandru/m4a1/m4a1_decimator.mdl" },
    { 
"M4A1 | Tiger"250"models/alexandru/m4a1/m4a1_tiger.mdl" },
    { 
"M4A1 | Assimov"250"models/alexandru/m4a1/m4a1_assimov.mdl" },
    { 
"M4A1 | Eswc"250"models/alexandru/m4a1/m4a1_eswc.mdl" },
    { 
"M4A1 | Freez"250"models/alexandru/m4a1/m4a1_freeze.mdl" }
}
new const 
AK47_Stuff[][ skin_e ] =
{
    { 
"Default AK47" },
    { 
"AK47 | Arckos"250"models/alexandru/ak47/ak47_arckos.mdl" },
    { 
"AK47 | Blue Wolf"250"models/alexandru/ak47/ak47_bluewolf.mdl" },
    { 
"AK47 | Challenger"250"models/alexandru/ak47/ak47_challenger.mdl" },
    { 
"AK47 | Furious Peacock"250"models/alexandru/ak47/ak47_furious_peacock.mdl" },
    { 
"AK47 | Jackcal"250"models/alexandru//ak47/ak47_jackcal.mdl" }
}
new const 
AWP_Stuff[][ skin_e ] =
{
    { 
"Default AWP" },
    { 
"AWP | Dragon Lore"500"models/alexandru/awp/awp_dlore.mdl" },
    { 
"AWP | Blue Wolf"500"models/alexandru/awp/awp_bluewolf.mdl" },
    { 
"AWP | Brotherhodd"500"models/alexandru/awp/awp_brotherhodd.mdl" },
    { 
"AWP | Fade"700"models/alexandru/awp/awp_fade.mdl" },
    { 
"AWP | Starkeepersticker"500"models/alexandru/awp/awp_starkeepersticker.mdl" }
}
new const 
Deagle_Stuff[][ skin_e ] =
{
    { 
"Default Deagle" },
    { 
"DEAGLE | Ghost"150"models/alexandru/deagle/deagle_ghost.mdl" },
    { 
"DEAGLE | Jungle"150"models/alexandru/deagle/deagle_jungle.mdl" },
    { 
"DEAGLE | Kaneki"150"models/alexandru/deagle/deagle_kaneki.mdl" },
    { 
"DEAGLE | Salient"150"models/alexandru/deagle/deagle_salient.mdl" },
    { 
"DEAGLE | Utopiandreams"150"models/alexandru/deagle/deagle_utopiandreams.mdl" }
}
new const 
Knife_Stuff[][ skin_e ] =
{
    { 
"Default Knife" },
    { 
"M9 BAYONET | Fade"700"models/alexandru/knife/m9_fade.mdl" },
    { 
"M9 BAYONET | Gamma Doppler"700"models/alexandru/knife/m9_gamma_doppler.mdl" },
    { 
"M9 BAYONET | Dragon Lore"700"models/alexandru/knife/m9_lore.mdl" },
    { 
"M9 BAYONET | Neon"700"models/alexandru/knife/m9_neon.mdl" },
    { 
"M9 BAYONET | Stickerbomb"700"models/alexandru/knife/m9_stickerbomb.mdl" }
}
new const 
g_szWeaponHeader[][] =
{
    
"M4A1",
    
"Ak47",
    
"AWP",
    
"Deagle",
    
"Knife"
}

public 
plugin_init()
{
    
register_plugin"BuySkin Menu""1.0""JocA" )
    
RegisterHamHam_Item_Deploy"weapon_m4a1""CM4A1_Deploy_Post"true )
    
RegisterHamHam_Item_Deploy"weapon_ak47""CAK47_Deploy_Post"true )
    
RegisterHamHam_Item_Deploy"weapon_awp""CAWP_Deploy_Post"true )
    
RegisterHamHam_Item_Deploy"weapon_deagle""CDeagle_Deploy_Post"true )
    
RegisterHamHam_Item_Deploy"weapon_knife""CKnife_Deploy_Post"true )

    
register_clcmd"say /buyskin""buy_skin_pre" )
}
public 
plugin_precache()
{
    for( new 
1sizeof M4A1_Stuffi++)
        
precache_modelM4A1_Stuff][ ITEM_MODEL ] )
    for( new 
1sizeof AK47_Stuffi++)
        
precache_modelAK47_Stuff][ ITEM_MODEL ] )
    for( new 
1sizeof AWP_Stuffi++)
        
precache_modelAWP_Stuff][ ITEM_MODEL ] )
    for( new 
1sizeof Deagle_Stuffi++)
        
precache_modelDeagle_Stuff][ ITEM_MODEL ] )
    for( new 
1sizeof Knife_Stuffi++)
        
precache_modelKnife_Stuff][ ITEM_MODEL ] )
}
public 
client_putinserverid )
{
    
g_iHisMenuid ] = -1

    g_iEquipped_M4A1
id ] = 0g_bitOwned_M4A1id ] = 0
    g_iEquipped_AK47
id ] = 0g_bitOwned_AK47id ] = 0
    g_iEquipped_AWP
id ] = 0g_bitOwned_AWPid ] = 0
    g_iEquipped_Deagle
id ] = 0g_bitOwned_Deagleid ] = 0
    g_iEquipped_Knife
id ] = 0g_bitOwned_Knifeid ] = 0
}
public 
client_disconnectedid )
{
    
g_iHisMenuid ] = -1
}
public 
buy_skin_preid )
{
    new 
menu menu_create"Buy Skin Menu""handle_pre" )

    
menu_additemmenu"M4A1" )
    
menu_additemmenu"AK47" )
    
menu_additemmenu"AWP" )
    
menu_additemmenu"Deagle" )
    
menu_additemmenu"Knife" )

    
menu_displayidmenu )
    return 
PLUGIN_HANDLED
}
public 
handle_preidmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
        
g_iHisMenuid ] = -1
        
return PLUGIN_HANDLED
    
}
    
g_iHisMenuid ] = item
    show_skins
iditem )
    
menu_destroymenu )
    return 
PLUGIN_HANDLED
}
public 
show_skinsidweapon )
{
    new 
name100 ]
    
formatexnamecharsmaxname ), "%s Skins"g_szWeaponHeaderweapon ] )

    new 
menu menu_createname"handle_weapon" )
    for( new 
i6i++ )
    {
        new 
mitem150 ]
        switch( 
g_iHisMenuid ] )
        {
            case 
0formatexmitemcharsmaxmitem ), "%s\y [ %d Credits] %s"M4A1_Stuff][ ITEM_NAME ], M4A1_Stuff][ ITEM_CREDITS ], g_bitOwned_M4A1id ] & BIT) ? "\r[ OWNED ]":"" )
            case 
1formatexmitemcharsmaxmitem ), "%s\y [ %d Credits] %s"AK47_Stuff][ ITEM_NAME ], AK47_Stuff][ ITEM_CREDITS ], g_bitOwned_AK47id ] & BIT) ? "\r[ OWNED ]":""  )
            case 
2formatexmitemcharsmaxmitem ), "%s\y [ %d Credits] %s"AWP_Stuff][ ITEM_NAME ], AWP_Stuff][ ITEM_CREDITS ], g_bitOwned_AWPid ] & BIT) ? "\r[ OWNED ]":""  )
            case 
3formatexmitemcharsmaxmitem ), "%s\y [ %d Credits] %s"Deagle_Stuff][ ITEM_NAME ], Deagle_Stuff][ ITEM_CREDITS ], g_bitOwned_Deagleid ] & BIT) ? "\r[ OWNED ]":""  )
            case 
4formatexmitemcharsmaxmitem ), "%s\y [ %d Credits] %s"Knife_Stuff][ ITEM_NAME ], Knife_Stuff][ ITEM_CREDITS ], g_bitOwned_Knifeid ] & BIT) ? "\r[ OWNED ]":""  )
        }
        new 
Pos
        
if( ( Pos containmitem"[" ) ) != -&& == )
            
mitem[Pos] = EOS //removing [credits] for default skin

        
menu_additemmenumitem )
    }
    
menu_displayidmenu )
    return 
PLUGIN_HANDLED
}
public 
handle_weaponidmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
buy_skin_preid )
        
menu_destroymenu )
        return 
PLUGIN_HANDLED
    
}
    switch( 
g_iHisMenuid ] )
    {
        case 
0:
        {
            if( !( 
g_bitOwned_M4A1id ] & BITitem ) ) && item )
            {
                if( 
fcs_get_user_creditsid ) >= M4A1_Stuffitem ][ ITEM_CREDITS ] )
                {
                    
g_bitOwned_M4A1id ] |= BITitem )
                    
ColorChatidBLUE"^4[BuySkin]^1 You bought^3 %s^4 [ %d Credits]"M4A1_Stuffitem ][ ITEM_NAME ], M4A1_Stuffitem ][ ITEM_CREDITS ] )

                    
fcs_set_user_creditsidfcs_get_user_creditsid ) - M4A1_Stuffitem ][ ITEM_CREDITS ] )
                }
                else
                {
                    
ColorChatidBLUE"^4[BuySkin]^1 You don't have enough credits." )
                    
g_iHisMenuid ] = -1
                    
return PLUGIN_HANDLED
                
}
            }
            else
                
ColorChatidBLUE"^4[BuySkin]^1 You are now using^3 %s^1 skin!"M4A1_Stuffitem ][ ITEM_NAME ] )

            
g_iEquipped_M4A1id ] = item
            
if( is_user_aliveid ) )
            {
                new 
pActiveItem get_pdata_cbase(id3735)
                if( 
is_valid_entpActiveItem ) && cs_get_weapon_idpActiveItem ) == CSW_M4A1 )
                {
                    
ExecuteHamBHam_Item_HolsterpActiveItem)
                    
ExecuteHamBHam_Item_DeploypActiveItem )
                }
            }
        }
        case 
1:
        {
            if( !( 
g_bitOwned_AK47id ] & BITitem ) ) && item )
            {
                if( 
fcs_get_user_creditsid ) >= AK47_Stuffitem ][ ITEM_CREDITS ] )
                {
                    
g_bitOwned_AK47id ] |= BITitem )
                    
ColorChatidBLUE"^4[BuySkin]^1 You bought^3 %s^4 [ %d Credits]"AK47_Stuffitem ][ ITEM_NAME ], AK47_Stuffitem ][ ITEM_CREDITS ] )

                    
fcs_set_user_creditsidfcs_get_user_creditsid ) - AK47_Stuffitem ][ ITEM_CREDITS ] )
                }
                else
                {
                    
ColorChatidBLUE"^4[BuySkin]^1 You don't have enough credits." )
                    
g_iHisMenuid ] = -1
                    
return PLUGIN_HANDLED
                
}
            }
            else
                
ColorChatidBLUE"^4[BuySkin]^1 You are now using^3 %s^1 skin!"AK47_Stuffitem ][ ITEM_NAME ] )

            
g_iEquipped_AK47id ] = item
            
if( is_user_aliveid ) )
            {
                new 
pActiveItem get_pdata_cbase(id3735)
                if( 
is_valid_entpActiveItem ) && cs_get_weapon_idpActiveItem ) == CSW_AK47 )
                {
                    
ExecuteHamBHam_Item_HolsterpActiveItem)
                    
ExecuteHamBHam_Item_DeploypActiveItem )
                }
            }
        }
        case 
2:
        {
            if( !( 
g_bitOwned_AWPid ] & BITitem ) ) && item )
            {
                if( 
fcs_get_user_creditsid ) >= AWP_Stuffitem ][ ITEM_CREDITS ] )
                {
                    
g_bitOwned_AWPid ] |= BITitem )
                    
ColorChatidBLUE"^4[BuySkin]^1 You bought^3 %s^4 [ %d Credits]"AWP_Stuffitem ][ ITEM_NAME ], AWP_Stuffitem ][ ITEM_CREDITS ] )

                    
fcs_set_user_creditsidfcs_get_user_creditsid ) - AWP_Stuffitem ][ ITEM_CREDITS ] )
                }
                else
                {
                    
ColorChatidBLUE"^4[BuySkin]^1 You don't have enough credits." )
                    
g_iHisMenuid ] = -1
                    
return PLUGIN_HANDLED
                
}
            }
            else
                
ColorChatidBLUE"^4[BuySkin]^1 You are now using^3 %s^1 skin!"AWP_Stuffitem ][ ITEM_NAME ] )

            
g_iEquipped_AWPid ] = item
            
if( is_user_aliveid ) )
            {
                new 
pActiveItem get_pdata_cbase(id3735)
                if( 
is_valid_entpActiveItem ) && cs_get_weapon_idpActiveItem ) == CSW_AWP )
                {
                    
ExecuteHamBHam_Item_HolsterpActiveItem)
                    
ExecuteHamBHam_Item_DeploypActiveItem )
                }
            }
        }
        case 
3:
        {
            if( !( 
g_bitOwned_Deagleid ] & BITitem ) ) && item )
            {
                if( 
fcs_get_user_creditsid ) >= Deagle_Stuffitem ][ ITEM_CREDITS ] )
                {
                    
g_bitOwned_Deagleid ] |= BITitem )
                    
ColorChatidBLUE"^4[BuySkin]^1 You bought^3 %s^4 [ %d Credits]"Deagle_Stuffitem ][ ITEM_NAME ], Deagle_Stuffitem ][ ITEM_CREDITS ] )

                    
fcs_set_user_creditsidfcs_get_user_creditsid ) - Deagle_Stuffitem ][ ITEM_CREDITS ] )
                }
                else
                {
                    
ColorChatidBLUE"^4[BuySkin]^1 You don't have enough credits." )
                    
g_iHisMenuid ] = -1
                    
return PLUGIN_HANDLED
                
}
            }
            else
                
ColorChatidBLUE"^4[BuySkin]^1 You are now using^3 %s^1 skin!"Deagle_Stuffitem ][ ITEM_NAME ] )

            
g_iEquipped_Deagleid ] = item
            
if( is_user_aliveid ) )
            {
                new 
pActiveItem get_pdata_cbase(id3735)
                if( 
is_valid_entpActiveItem ) && cs_get_weapon_idpActiveItem ) == CSW_DEAGLE )
                {
                    
ExecuteHamBHam_Item_HolsterpActiveItem)
                    
ExecuteHamBHam_Item_DeploypActiveItem )
                }
            }
        }
        case 
4:
        {
            if( !( 
g_bitOwned_Knifeid ] & BITitem ) ) && item )
            {
                if( 
fcs_get_user_creditsid ) >= Knife_Stuffitem ][ ITEM_CREDITS ] )
                {
                    
g_bitOwned_Knifeid ] |= BITitem )
                    
ColorChatidBLUE"^4[BuySkin]^1 You bought^3 %s^4 [ %d Credits]"Knife_Stuffitem ][ ITEM_NAME ], Knife_Stuffitem ][ ITEM_CREDITS ] )

                    
fcs_set_user_creditsidfcs_get_user_creditsid ) - Knife_Stuffitem ][ ITEM_CREDITS ] )
                }
                else
                {
                    
ColorChatidBLUE"^4[BuySkin]^1 You don't have enough credits." )
                    
g_iHisMenuid ] = -1
                    
return PLUGIN_HANDLED
                
}
            }
            else
                
ColorChatidBLUE"^4[BuySkin]^1 You are now using^3 %s^1 skin!"Knife_Stuffitem ][ ITEM_NAME ] )

            
g_iEquipped_Knifeid ] = item
            
if( is_user_aliveid ) )
            {
                new 
pActiveItem get_pdata_cbase(id3735)
                if( 
is_valid_entpActiveItem ) && cs_get_weapon_idpActiveItem ) == CSW_KNIFE )
                {
                    
ExecuteHamBHam_Item_HolsterpActiveItem)
                    
ExecuteHamBHam_Item_DeploypActiveItem )
                }
            }
        }
    }
    
menu_destroymenu )
    
g_iHisMenuid ] = -1
    
return PLUGIN_HANDLED
}
public 
CM4A1_Deploy_Post(iEntity)
{
    new 
id get_pdata_cbaseiEntity41)
    new 
iwpn g_iEquipped_M4A1id ]

    if( 
M4A1_Stuffiwpn ][ ITEM_MODEL ][ ] )
        
entity_set_stringidEV_SZ_viewmodelM4A1_Stuffiwpn ][ ITEM_MODEL ] )
}
public 
CAK47_Deploy_Post(iEntity)
{
    new 
id get_pdata_cbaseiEntity41)
    new 
iwpn g_iEquipped_AK47id ]

    if( 
AK47_Stuffiwpn ][ ITEM_MODEL ][ ] )
        
entity_set_stringidEV_SZ_viewmodelAK47_Stuffiwpn ][ ITEM_MODEL ] )
}
public 
CAWP_Deploy_Post(iEntity)
{
    new 
id get_pdata_cbaseiEntity41)
    new 
iwpn g_iEquipped_AWPid ]

    if( 
AWP_Stuffiwpn ][ ITEM_MODEL ][ ] )
        
entity_set_stringidEV_SZ_viewmodelAWP_Stuffiwpn ][ ITEM_MODEL ] )
}
public 
CDeagle_Deploy_Post(iEntity)
{
    new 
id get_pdata_cbaseiEntity41)
    new 
iwpn g_iEquipped_Deagleid ]

    if( 
Deagle_Stuffiwpn ][ ITEM_MODEL ][ ] )
        
entity_set_stringidEV_SZ_viewmodelDeagle_Stuffiwpn ][ ITEM_MODEL ] )
}
public 
CKnife_Deploy_Post(iEntity)
{
    new 
id get_pdata_cbaseiEntity41)
    new 
iwpn g_iEquipped_Knifeid ]

    if( 
Knife_Stuffiwpn ][ ITEM_MODEL ][ ] )
        
entity_set_stringidEV_SZ_viewmodelKnife_Stuffiwpn ][ ITEM_MODEL ] )


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...