Raised This Month: $ Target: $400
 0% 

Why this function dont work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-06-2011 , 06:31   Re: Why this function dont work?
Reply With Quote #1

Try this anyway UNTESTED
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) { 
        
SetHamParamFloat(4damage 0.0
        return 
HAM_SUPERCEDE 
    

    
// 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
    { 
        
SetHamParamFloat(4damage 0.0
        return 
HAM_SUPERCEDE 
    

    
// 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"); 
    } 

__________________

Last edited by Snaker beatter; 12-06-2011 at 06:31.
Snaker beatter 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 11:58.


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