Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage, CsTeams tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bat
Veteran Member
Join Date: Jul 2012
Old 07-31-2014 , 11:11   Re: Ham_TakeDamage, CsTeams tag mismatch
Reply With Quote #1

Quote:
Originally Posted by Flick3rR View Post
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(PLUGINVERSIONAUTHOR)
    
    
mpFriendlyFire get_cvar_pointer("mp_friendlyfire")
    
set_pcvar_num(mpFriendlyFire1)
    
    
RegisterHam(Ham_TakeDamage"player""onTakeDamage")
}

public 
onTakeDamage(victiminflictorattackerFloat:damagedmgbits)
{
    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 
}
__________________
bat is offline
Send a message via Skype™ to bat
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 12:56.


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