AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   FreindlyFire (https://forums.alliedmods.net/showthread.php?t=207575)

ironskillz1 02-04-2013 08:56

FreindlyFire
 
How can i only give 1 in the Terroist Team Freindlyfire ON?

fysiks 02-04-2013 21:10

Re: FreindlyFire
 
You will need to enable friendly fire for all and then hook Ham_TakeDamage and block or not block appropriately.

simanovich 02-05-2013 02:13

Re: FreindlyFire
 
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;



ironskillz1 02-06-2013 14:10

Re: FreindlyFire
 
Quote:

Originally Posted by simanovich (Post 1887381)
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

n0br41ner 02-06-2013 17:08

Re: FreindlyFire
 
Then you should post in the suggestions forum i think.

Doc-Holiday 02-06-2013 17:18

Re: FreindlyFire
 
Quote:

Originally Posted by simanovich (Post 1887381)
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


All times are GMT -4. The time now is 20:32.

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