Raised This Month: $ Target: $400
 0% 

preventing from buying and hide/delete money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 05-26-2013 , 11:25   preventing from buying and hide/delete money
Reply With Quote #1

What i need is that buy zone would be deleted (or any other method to prevent from opening buy menu) and hide/delete money.

How could this code be upgraded or it's fine?

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

#define PLUGIN_NAME "No buyzone & money"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Not me"

#define OFFSET_CSMONEY 115

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
register_clcmd("buy""menu_block")
    
register_clcmd("buyequip""menu_block")
    
    
register_message(get_user_msgid("Money"), "MessageMoney")
}

public 
menu_block(id)
{
    return 
PLUGIN_HANDLED
}

public 
MessageMoney(id)
{
    
set_pdata_int(idOFFSET_CSMONEY0);
    
set_msg_arg_int(1ARG_LONG0);


Last edited by GhostMan; 05-26-2013 at 11:38.
GhostMan is offline
fl0werD
Senior Member
Join Date: May 2011
Old 05-26-2013 , 11:56   Re: preventing from buying and hide/delete money
Reply With Quote #2

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


public plugin_init( )
{
    
register_message102"MSG_Money" );
    
register_message107"MSG_StatusIcon" );

    
RegisterHamHam_Spawn"player""CPlayer__Spawn_Post", .Post );
}

public 
CPlayer__Spawn_PostiPlayer )
{
    if( !
is_user_aliveiPlayer ) )
        return;

    
set_task0.4"CTask__HideMoney"iPlayer +500 );
}

public 
CTask__HideMoneyiTask )
{
    new 
iPlayer iTask 500;

    if( 
is_user_aliveiPlayer ) )
    {
        
message_beginMSG_ONE94_iPlayer ); // 94 - HideWeapon.
        
write_byte1<<); // (1<<5)  -  Money, +
        
message_end( );

        
message_beginMSG_ONE110_iPlayer ); // 110 - Crosshair.
        
write_byte); // Removes a crosshair ( Like in spectator mode ).
        
message_end( );
    }
}

public 
MSG_Moneymsg_idMSG_DESTiPlayer )
{
    
set_pdata_intiPlayer1150); // 115 - m_iAccount
    
return PLUGIN_HANDLED;
}

public 
MSG_StatusIconmsg_idMSG_DESTiPlayer )
{
    new 
szIcon];
    
get_msg_arg_string2szIconcharsmaxszIcon ) );

    if( 
szIcon] == 'b' && szIcon] == 'y' && szIcon] == 'z' )
    {
        if( 
get_msg_arg_int) )
        {
            
// 235 - m_fClientMapZone, ( 1<<0 ) - Player in buy zone.
            
set_pdata_intiPlayer235get_pdata_intiPlayer235) & ~( 1<<), );
            return 
PLUGIN_HANDLED;
        }
    }

    return 
PLUGIN_CONTINUE;


Last edited by fl0werD; 05-26-2013 at 12:04.
fl0werD is offline
Send a message via ICQ to fl0werD
Reply


Thread Tools
Display Modes

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:21.


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