Raised This Month: $ Target: $400
 0% 

FreindlyFire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-04-2013 , 08:56   FreindlyFire
Reply With Quote #1

How can i only give 1 in the Terroist Team Freindlyfire ON?
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-04-2013 , 21:10   Re: FreindlyFire
Reply With Quote #2

You will need to enable friendly fire for all and then hook Ham_TakeDamage and block or not block appropriately.
__________________
fysiks is offline
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
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-06-2013 , 14:10   Re: FreindlyFire
Reply With Quote #4

Quote:
Originally Posted by simanovich View Post
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;

I want to make a menu there you can choose a terroist that can kill other terroist but other terroist cant kill him

I have no idea how i can make that
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 02-06-2013 at 14:10.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 02-06-2013 , 17:08   Re: FreindlyFire
Reply With Quote #5

Then you should post in the suggestions forum i think.
__________________
n0br41ner is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-06-2013 , 17:18   Re: FreindlyFire
Reply With Quote #6

Quote:
Originally Posted by simanovich View Post
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;

and for cstrike I was told you should use cs_get_user_team and CS_TEAM_CT/T
Doc-Holiday is offline
Reply



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