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

[SOLVED] Make player can't buy anything


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 07-18-2009 , 06:58   [SOLVED] Make player can't buy anything
Reply With Quote #1

How can I do that....?? fm_set_user_nobuy ??
If there's any better way..please tell me
__________________

Last edited by 5c0r-|3i0; 07-19-2009 at 22:28. Reason: solved
5c0r-|3i0 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 07-18-2009 , 07:26   Re: Make player can't buy anything
Reply With Quote #2

Huh u want to restrict all weapons or restrict any weapons?or u mean anything elsE?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 07-18-2009 , 07:50   Re: Make player can't buy anything
Reply With Quote #3

Make Terrorists can't buy weapon.....that's all
__________________
5c0r-|3i0 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 07-18-2009 , 08:05   Re: Make player can't buy anything
Reply With Quote #4

get player team & restrict.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
zwfgdlc
Senior Member
Join Date: May 2006
Old 07-18-2009 , 09:57   Re: Make player can't buy anything
Reply With Quote #5

try this.not tested.
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta> #define PLUGIN_NAME "no buy" #define PLUGIN_VERSION  "1.0" #define PLUGIN_AUTHOR   "zwfgdlc" #define OFFSET_MAP_BUYZONE    235 #define CS_MAPZONE_BUY    (1<<0) public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);     RegisterHam(Ham_Touch,"func_buyzone","fw_TouchBuyZone"); } public fw_TouchBuyZone(iEnt,id) {     fm_block_buy(id);     return HAM_SUPERCEDE; } stock fm_block_buy(id) {     set_pdata_int(id,OFFSET_MAP_BUYZONE,get_pdata_int(id,OFFSET_MAP_BUYZONE)&~CS_MAPZONE_BUY); }
zwfgdlc is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-18-2009 , 17:05   Re: Make player can't buy anything
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init( ) {
    
register_plugin"No Terr Buying""1.0""xPaw" );
    
    
register_messageget_user_msgid"StatusIcon" ), "Msg_StatusIcon" );
}

public 
Msg_StatusIconmsgidmsgdestid ) {
    if( 
get_user_teamid ) != )
        return 
PLUGIN_CONTINUE;
    
    static 
szMsg];
    
get_msg_arg_string2szMsg);
    
    if( 
equalszMsg"buyzone" ) && get_msg_arg_int) ) {
        
set_pdata_intid235get_pdata_intid235 ) & ~( << ) );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

__________________
xPaw is offline
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
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 07-19-2009 , 22:27   Re: Make player can't buy anything
Reply With Quote #8

Thanks a lot ...SOLVED
__________________
5c0r-|3i0 is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 07-20-2009 , 21:04   Re: [SOLVED] Make player can't buy anything
Reply With Quote #9

What is an offset?
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- 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 03:15.


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