Thread: some things
View Single Post
atom0s
Senior Member
Join Date: Jul 2009
Old 04-21-2010 , 12:20   Re: some things
Reply With Quote #7

I'm not fully sure if you can block damage easily with a basic hook on something like player_hurt without having to do some storage of health before/after events and such. I've tried before and couldn't seem to overwrite the event data.

However you can detect if someones in a buy zone by using something like this:

PHP Code:
    // Storage Variable
    
new g_PlayerInBuyZone;

    
// Obtain Buy Zone Offset
    
g_PlayerInBuyZone FindSendPropOffs"CCSPlayer""m_bInBuyZone" );
    if( 
g_PlayerInBuyZone == -)
    {
        
SetFailState"Unable to obtain offset for CCSPlayer::m_bInBuyZone" );
    }

    
// Check Entity
    
new bInBuyZone GetEntDataclientg_PlayerInBuyZone ); 
Those are bits from an older plugin I wrote a while back for something else. But thats how you can tell if a client is in a buy zone or not.
atom0s is offline