AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   preventing from buying and hide/delete money (https://forums.alliedmods.net/showthread.php?t=216855)

GhostMan 05-26-2013 11:25

preventing from buying and hide/delete money
 
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);



fl0werD 05-26-2013 11:56

Re: preventing from buying and hide/delete money
 
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;




All times are GMT -4. The time now is 16:21.

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