Raised This Month: $ Target: $400
 0% 

Why this function dont work?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 12-05-2011 , 11:17   Why this function dont work?
Reply With Quote #1

Im trying to do a simple function, if FF is on then CTs cant kill other CTs...

but it dont work..
look at my code.. whats is wrong? or what i need to do?
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new bool:ffon;

public 
plugin_init() {
    
register_clcmd("say /friendlyfire""Blablabla")
    
RegisterHam(Ham_TakeDamage"player""dmgevent"
}
public 
dmgevent(victiminflictorattackerFloat:damagebits
{
    
    if(
ffon && cs_get_user_team(attacker) == CS_TEAM_CT && cs_get_user_team(victim) == CS_TEAM_CT) {
        
// return HAM_SUPERCEDE
        // dont work
        // SetHamParamFloat(4, damage = 0.0)
        // dont work
    
}
    
// or
    
new CsTeams:iTeamACsTeams:iTeamV
    iTeamA 
cs_get_user_team(attacker)
    
iTeamV cs_get_user_team(victim)
    
    if(
ffon && iTeamA == CS_TEAM_CT && iTeamV == CS_TEAM_CT)
    {
        
// return HAM_SUPERCEDE
        // dont work
        // SetHamParamFloat(4, damage = 0.0)
        // dont work.....
    
}
    
// the two ways dont work!
}
public 
Blablabla(id)
{
    
ffon = !ffon
    
    
if(ffon) {
        
set_cvar_num("mp_friendlyfire"1)
        
client_print(0print_chat"FF ON");
    } else {
        
set_cvar_num("mp_friendlyfire"0)
        
client_print(0print_chat"FF OFF");
    }

TheArmagedon 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 11:58.


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