PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >
public plugin_init( )
{
register_message( 102, "MSG_Money" );
register_message( 107, "MSG_StatusIcon" );
RegisterHam( Ham_Spawn, "player", "CPlayer__Spawn_Post", .Post = 1 );
}
public CPlayer__Spawn_Post( iPlayer )
{
if( !is_user_alive( iPlayer ) )
return;
set_task( 0.4, "CTask__HideMoney", iPlayer +500 );
}
public CTask__HideMoney( iTask )
{
new iPlayer = iTask - 500;
if( is_user_alive( iPlayer ) )
{
message_begin( MSG_ONE, 94, _, iPlayer ); // 94 - HideWeapon.
write_byte( 1<<5 ); // (1<<5) - Money, +
message_end( );
message_begin( MSG_ONE, 110, _, iPlayer ); // 110 - Crosshair.
write_byte( 0 ); // Removes a crosshair ( Like in spectator mode ).
message_end( );
}
}
public MSG_Money( msg_id, MSG_DEST, iPlayer )
{
set_pdata_int( iPlayer, 115, 0, 4 ); // 115 - m_iAccount
return PLUGIN_HANDLED;
}
public MSG_StatusIcon( msg_id, MSG_DEST, iPlayer )
{
new szIcon[ 5 ];
get_msg_arg_string( 2, szIcon, charsmax( szIcon ) );
if( szIcon[ 0 ] == 'b' && szIcon[ 2 ] == 'y' && szIcon[ 3 ] == 'z' )
{
if( get_msg_arg_int( 1 ) )
{
// 235 - m_fClientMapZone, ( 1<<0 ) - Player in buy zone.
set_pdata_int( iPlayer, 235, get_pdata_int( iPlayer, 235, 5 ) & ~( 1<<0 ), 5 );
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}