View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-18-2009 , 19:36   Re: Make player can't buy anything
Reply With Quote #7

@zwfgdlc: It will not work with map without this entity. "Later releases of CS don't require a func_buyzone, as the player spawn area defines the buy area."

So xPaw's way is fine :

Code:
    #include <amxmodx>     #include <fakemeta>     #include <cstrike>     const OFFSET_MAP_BUYZONE = 235;     const CS_MAPZONE_BUY     = ( 1 << 0 );     public plugin_init ()     {         register_plugin( "No Terr Buying", "1.0", "xPaw" );         register_message( get_user_msgid( "StatusIcon" ), "Msg_StatusIcon" );     }         public Msg_StatusIcon( const MsgId, const MsgDest, const Player )     {         if( cs_get_user_team( Player ) == CS_TEAM_T && get_msg_arg_int( 1 ) )         {             static Message[ 8 ];             get_msg_arg_string( 2, Message, charsmax( Message ) );                         if( equal( Message, "buyzone" ) )             {                 set_pdata_int( Player, OFFSET_MAP_BUYZONE, get_pdata_int( Player, OFFSET_MAP_BUYZONE ) & ~CS_MAPZONE_BUY );                 return PLUGIN_HANDLED;             }         }                 return PLUGIN_CONTINUE;     }

Another version which keep the icon but let a (existing) message text when T is trying to buy :

Code:
    #include <amxmodx>     #include <fakemeta>     #include <engine>         new gFwdKeyValue;         public plugin_precache()     {         new Entity = create_entity( "info_map_parameters" );         DispatchKeyValue( Entity, "buying", "1" );         DispatchSpawn( Entity );                 gFwdKeyValue = register_forward( FM_KeyValue, "Forward_KeyValue" );     }     public Forward_KeyValue( const Entity, const KvdHandle )     {         if ( pev_valid( Entity ) )         {             new ClassName[ 20 ];             get_kvd( KvdHandle, KV_ClassName, ClassName, charsmax( ClassName ) );                         if( equal( ClassName, "info_map_parameters" ) )             {                 remove_entity( Entity );                 return FMRES_SUPERCEDE;             }         }                 return FMRES_IGNORED;     }         public plugin_init()     {         register_plugin( "Disable T's Buy", "1.0.0", "Arkshine" );         unregister_forward( FM_KeyValue, gFwdKeyValue );     }
__________________
Arkshine is offline