|
Author
|
Message
|
|
Veteran Member
|

07-31-2014
, 11:11
Re: Ham_TakeDamage, CsTeams tag mismatch
|
#1
|
Quote:
Originally Posted by Flick3rR
Hey, guys! I just want to ask why is this tag mismatch caused in the code. It's purpose is to block FF for Terrorist and allow it for CTs. Thanks!
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "CT FF"
#define VERSION "1.0"
#define AUTHOR "Flicker"
new mpFriendlyFire
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
mpFriendlyFire = get_cvar_pointer("mp_friendlyfire")
set_pcvar_num(mpFriendlyFire, 1)
RegisterHam(Ham_TakeDamage, "player", "onTakeDamage")
}
public onTakeDamage(victim, inflictor, attacker, Float:damage, dmgbits)
{
new CsTeams:Vteam = cs_get_user_team(victim)
new CsTeams:Ateam = cs_get_user_team(attacker)
return (Vteam == Ateam == CS_TEAM_T) ? HAM_SUPERCEDE : HAM_IGNORED
}
|
Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "CT FF"
#define VERSION "1.0"
#define AUTHOR "Flicker"
new mpFriendlyFire
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
mpFriendlyFire = get_cvar_pointer("mp_friendlyfire")
set_pcvar_num(mpFriendlyFire, 1)
RegisterHam(Ham_TakeDamage, "player", "onTakeDamage")
}
public onTakeDamage(victim, inflictor, attacker, Float:damage, dmgbits)
{
new CsTeams:Vteam = cs_get_user_team(victim)
new CsTeams:Ateam = cs_get_user_team(attacker)
return (Vteam && Ateam == CS_TEAM_T) ? HAM_SUPERCEDE : HAM_IGNORED
}
__________________
|
|
|
|