Raised This Month: $ Target: $400
 0% 

FreindlyFire


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 02-05-2013 , 02:13   Re: FreindlyFire
Reply With Quote #3

Turn on FF and then block Ham_TakeDamage hook (before that check if the player is a terrorist and he is attacking a terrorist, if it's true, then don't block and if not, block)

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

new bool:CanAttackFriends[33];

public 
plugin_init(){
    
RegisterHam(Ham_TakeDamage,"player","fw_HamTakeDamage");
}

public 
fw_HamTakeDamage(victiminflictorattackerFloat:dmgdmgbits){
    if (
get_user_team(victim) == && get_user_team(attacker) == && CanAttackFriends[attacker])
        return 
HAM_IGNORED;
        
    return 
HAM_SUPERCEDE;

__________________
simanovich is offline
 



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 20:32.


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