View Single Post
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-22-2015 , 05:53   Re: [Request] Prevent killings on end round
Reply With Quote #7

Example:
PHP Code:
// We need this include
// If you already included it, no need to rewrite it again
#include <hamsandwich>

// Bool to detect round end
new bool:g_bRoundHasEnd

public plugin_init()
{
    
register_event("HLTV""NewRound""a""1=0""2=0")
    
register_logevent("RoundEnd"2"1=Round_End")
    
    
RegisterHam(Ham_TraceAttack"player""fw_TakeDamage")
}

public 
NewRound()
{
    
// Is new round
    
g_bRoundHasEnd false
}

public 
RoundEnd()
{
    
// Round has end
    
g_bRoundHasEnd true
}
    
// Ham Take Damage Forward
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Round has end
    
if(g_bRoundHasEnd)
    {    
        
// If attacker and victim is not the same
        
if(attacker != victim)
        {
            return 
HAM_SUPERCEDE
        
}
    }
    
    return 
HAM_IGNORED


Last edited by zmd94; 10-22-2015 at 12:15.
zmd94 is offline